h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--gl-success);
}

.invalid {
    outline: 1px solid var(--gl-danger);
}

.validation-message {
    color: var(--gl-danger);
}

#blazor-error-ui {
    background: rgba(21, 25, 34, 0.92);
    bottom: 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    color: var(--gl-text);
    display: none;
    left: 0;
    padding: 0.9rem 1.25rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 1px solid var(--gl-border);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

#blazor-error-ui .reload {
    color: var(--gl-accent);
}

.blazor-error-boundary {
    background: linear-gradient(135deg, rgba(197, 58, 88, 0.95), rgba(139, 22, 54, 0.95));
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Ett fel uppstod.";
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--gl-border);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--gl-accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 700;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--gl-text-muted);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "GymLog");
}

/* ── Generic content pages (legal, 404, etc.) ───────────────────────────── */

.gl-page-content {
    padding: 2rem var(--gl-page-inline, 1rem) 4rem;
    max-width: 44rem;
    margin-inline: auto;
    width: 100%;
}

/* 404 page */
.gl-not-found {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60dvh;
    text-align: center;
}

.gl-not-found-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2.5rem 1.5rem;
}

.gl-not-found-code {
    font-size: clamp(3.5rem, 12vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    background: var(--gl-accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gl-not-found-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gl-text-high);
    margin: 0;
}

.gl-not-found-body {
    font-size: 0.95rem;
    color: var(--gl-text-muted);
    max-width: 28rem;
    line-height: 1.65;
    margin: 0;
}

.gl-not-found-cta {
    margin-top: 0.75rem;
}

/* Legal pages (privacy & terms) */
.gl-legal-page {
    padding-top: 0.5rem;
}

.gl-legal-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.2rem;
}

.gl-legal-back-button {
    flex: 0 0 auto;
}

.gl-legal-close-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gl-text-muted);
}

.gl-legal-close-link:hover {
    color: var(--gl-text-high);
}

.gl-legal-page h1 {
    font-size: clamp(1.6rem, 4vw, 2rem);
    font-weight: 800;
    color: var(--gl-text-high);
    margin-bottom: 0.25rem;
}

.gl-legal-page .gl-legal-updated {
    font-size: 0.875rem;
    color: var(--gl-text-soft);
    margin-bottom: 2rem;
}

.gl-legal-page h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gl-text-high);
    margin-top: 1.75rem;
    margin-bottom: 0.4rem;
}

.gl-legal-page p,
.gl-legal-page li {
    font-size: 0.9375rem;
    color: var(--gl-text-muted);
    line-height: 1.7;
}

.gl-legal-page ul {
    padding-left: 1.25rem;
    margin-top: 0.35rem;
}

.gl-legal-page li {
    margin-bottom: 0.3rem;
}

.gl-legal-page a {
    color: var(--gl-accent);
    text-underline-offset: 2px;
}

.gl-legal-page a:hover {
    color: var(--gl-accent-light);
}
