/* ── Global defaults ──────────────────────────────────────────────────────
   Baseline styles for the app. Bootstrap 5.3 --bs-* variables are set here
   with hardcoded deeppurple-amber defaults so the site renders correctly
   with no external theme stylesheet.

   When a non-default theme is active, ThemeMiddleware serves
   /theme.{fingerprint}.css which overrides these :root values.
   ─────────────────────────────────────────────────────────────────────────── */

/* Default theme: deeppurple-amber (light).
   Values are pre-computed by the same HSL five-point formula used by ThemeCss.
   If a custom theme is loaded it will override these via a later :root block. */
:root {
    /* Primary — #673ab7 (deep purple) */
    --bs-primary: #673ab7;
    --bs-primary-rgb: 103, 58, 183;
    --bs-primary-bg-subtle: #daceef;
    --bs-primary-border-subtle: #bda7e3;
    --bs-primary-text-emphasis: #261543;
    /* Secondary — M3-derived muted purple (H=262, S=20%, L=45%) */
    --bs-secondary: #6c5c8a;
    --bs-secondary-rgb: 108, 92, 138;
    --bs-secondary-bg-subtle: #d7d1e0;
    --bs-secondary-border-subtle: #bcb3cc;
    --bs-secondary-text-emphasis: #241f2e;
    /* Tertiary — #ffd740 (amber) */
    --bs-tertiary: #ffd740;
    --bs-tertiary-rgb: 255, 215, 64;
    --bs-tertiary-bg-subtle: #ffffff;
    --bs-tertiary-border-subtle: #fff7d9;
    --bs-tertiary-text-emphasis: #a68300;
    /* Links & focus ring */
    --bs-link-color: var(--bs-primary);
    --bs-link-color-rgb: var(--bs-primary-rgb);
    --bs-link-hover-color: #46287d; /* primary H=262 S=52 L=32 */
    --bs-link-hover-color-rgb: 70, 40, 125;
    --bs-focus-ring-color: rgba(var(--bs-primary-rgb), .25);
}

/* ── Bootstrap component variable overrides ──────────────────────────────
   Bootstrap 5.3 compiles button and nav component variables from SASS at
   build time (hardcoded to Bootstrap's blue). Setting --bs-primary in :root
   alone updates utility classes (.bg-primary, .text-primary, .alert-primary,
   badges, etc.) but NOT button backgrounds or nav pills. These rules wire the
   component-level CSS variables to the runtime theme colours.

   Note: utility classes (.bg-primary, .text-primary, .badge.bg-primary,
   .alert-primary, .progress-bar.bg-primary) already use CSS variables and
   do NOT need overrides here.
   ─────────────────────────────────────────────────────────────────────────── */

.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--bs-primary) 90%, black);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--bs-primary) 90%, black);
    --bs-btn-active-bg: color-mix(in srgb, var(--bs-primary) 80%, black);
    --bs-btn-active-border-color: color-mix(in srgb, var(--bs-primary) 75%, black);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
}

.btn-secondary {
    --bs-btn-bg: var(--bs-secondary);
    --bs-btn-border-color: var(--bs-secondary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--bs-secondary) 90%, black);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--bs-secondary) 90%, black);
    --bs-btn-active-bg: color-mix(in srgb, var(--bs-secondary) 80%, black);
    --bs-btn-active-border-color: color-mix(in srgb, var(--bs-secondary) 75%, black);
    --bs-btn-focus-shadow-rgb: var(--bs-secondary-rgb);
    --bs-btn-disabled-bg: var(--bs-secondary);
    --bs-btn-disabled-border-color: var(--bs-secondary);
}

.btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: var(--bs-primary);
    --bs-btn-active-border-color: var(--bs-primary);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.btn-outline-secondary {
    --bs-btn-color: var(--bs-secondary);
    --bs-btn-border-color: var(--bs-secondary);
    --bs-btn-hover-bg: var(--bs-secondary);
    --bs-btn-hover-border-color: var(--bs-secondary);
    --bs-btn-active-bg: var(--bs-secondary);
    --bs-btn-active-border-color: var(--bs-secondary);
    --bs-btn-focus-shadow-rgb: var(--bs-secondary-rgb);
}

/* .btn-link: Bootstrap compiles --bs-btn-color from $link-color (SASS) at build time.
   Override via component variable so it tracks our runtime --bs-primary. */
.btn-link {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-hover-color: var(--bs-link-hover-color);
}

/* Nav pills active: Bootstrap compiles --bs-nav-pills-link-active-bg from $primary. */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    --bs-nav-pills-link-active-bg: var(--bs-primary);
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Explicit link override — our direct color: rule overrides Bootstrap's CSS-variable
   hover mechanism, so explicit hover and visited rules are required here. */
a {
    color: var(--bs-primary);
}

    a:hover {
        color: var(--bs-link-hover-color);
    }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--bs-primary);
}

h1:focus {
    outline: none;
}

/* ── Blazor validation & error ───────────────────────────────────────────── */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.form-floating:has(.form-control.invalid) > label,
.form-floating:has(.form-select.invalid) > label,
.mb-3:has(.form-control.invalid) > label,
.mb-3:has(.form-select.invalid) > label {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ── Form helpers ────────────────────────────────────────────────────────── */

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Bootstrap's form-floating label colours are visually backwards (.75 at rest, .65 floated).
   Three states, covering text inputs, date pickers (input[type="date"]) and selects:
     1. At rest  — muted, reads like a placeholder
     2. Floated, not focused — readable dark label
     3. Floated + focused — theme primary, matches the border colour */
.form-floating > label {
    color: rgba(var(--bs-body-color-rgb), 0.65);
}

.form-floating > .form-control:not(:placeholder-shown):not(:focus) ~ label,
.form-floating > input[type="date"]:not(:focus) ~ label,
.form-floating > .form-select:not(:focus) ~ label {
    color: rgba(var(--bs-body-color-rgb), 0.8);
}

.form-floating > .form-control:focus ~ label,
.form-floating > input[type="date"]:focus ~ label,
.form-floating > .form-select:focus ~ label {
    color: var(--bs-primary);
}

/* Select: mute the control text when the placeholder (empty value) option is selected.
   colour cascades to <option> children when the dropdown opens, so explicitly restore
   full colour on real options so only the closed/unselected display is muted. */
.form-select:has(option[value=""]:checked) {
    color: rgba(var(--bs-body-color-rgb), 0.65);
}

    .form-select:has(option[value=""]:checked) option:not([value=""]) {
        color: var(--bs-body-color);
    }

/* Date input: always float the label because the browser always shows the format hint
   (yyyy-mm-dd), which would overlap a label sitting at rest in the field centre.
   Bootstrap only auto-floats via :not(:placeholder-shown), so we apply the same
   transform and background notch unconditionally for type="date". */
.form-floating > input[type="date"] ~ label {
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

    .form-floating > input[type="date"] ~ label::after {
        position: absolute;
        inset: 1rem 0.375rem;
        z-index: -1;
        height: 1.5em;
        content: "";
        background-color: var(--bs-body-bg);
        border-radius: var(--bs-border-radius);
    }

/* Date input: mute the format hint only when the field is empty, using :invalid as the
   CSS signal. The input carries the HTML `required` attribute so :invalid fires when
   empty and :valid fires once a date is chosen — updating live as the user picks.
   The form's `novalidate` suppresses native browser error messages; `required` here
   is purely a CSS state hook. A date beyond `max` also reads as :invalid and is
   dimmed, which is coherent (it is genuinely invalid input).
   Webkit only — Firefox uses its own native date chrome. */
input[type="date"]:invalid:not(:focus)::-webkit-datetime-edit {
    color: rgba(var(--bs-body-color-rgb), 0.65);
}

input[type="date"]:focus::-webkit-datetime-edit {
    color: var(--bs-body-color);
}

/* ── Page layout ─────────────────────────────────────────────────────────── */

.identity-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bs-tertiary-bg);
}

/* ── App header toolbar ──────────────────────────────────────────────────── */

.identity-header {
    background-color: var(--bs-primary);
    color: #fff;
    height: 56px;
    display: flex;
    align-items: center;
    /* flex-start, not space-between: the hamburger toggle + app name pack
       together at the left (cso's layout); .identity-header-actions supplies
       its own margin-left: auto to push the desktop actions row to the
       right, so space-between isn't needed for that and would otherwise
       shove the mobile toggle and title to opposite ends. */
    justify-content: flex-start;
    padding: 0 16px;
    flex-shrink: 0;
    /* Above the offcanvas backdrop (z-index 1040) so the header stays
       undimmed and the hamburger toggle stays clickable — re-clicking it
       is the only way to close the drawer (no separate close button). */
    position: relative;
    z-index: 1050;
}

.identity-app-link {
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

    .identity-app-link:hover {
        color: rgba(255, 255, 255, .75);
        text-decoration: none;
    }

.identity-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

    .identity-header-actions a,
    .identity-header-actions button {
        color: #fff;
        text-decoration: none;
        white-space: nowrap;
    }

        .identity-header-actions a:hover,
        .identity-header-actions button:hover {
            color: rgba(255, 255, 255, .75);
        }

    /* Restore body text colour inside dropdown panels. The header rule above forces white
   on all .identity-header-actions a/button, bleeding into dropdown-menu items.
   Override for both <a> and <button> (e.g. Sign Out) with Bootstrap's theme-aware vars. */
    .identity-header-actions .dropdown-menu a,
    .identity-header-actions .dropdown-menu button {
        color: var(--bs-dropdown-link-color);
        background-color: transparent;
    }

        .identity-header-actions .dropdown-menu a:hover,
        .identity-header-actions .dropdown-menu button:hover {
            color: var(--bs-dropdown-link-hover-color);
            background-color: var(--bs-dropdown-link-hover-bg);
        }

/* ── Header icon buttons ─────────────────────────────────────────────────── */
/* Keep colour white across all btn-link states (default, hover, active, .show).
   Bootstrap's btn-link drives colour through CSS variables; overriding them here
   avoids specificity fights and removes the need for !important. */
.identity-header-actions .btn-link {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: rgba(255, 255, 255, .75);
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: rgba(255, 255, 255, .4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 6px;
    border-radius: 4px;
}

/* Suppress the double white+primary box-shadow that the global .btn:focus rule
   applies — it looks jarring on the coloured header background. */
.identity-header-actions .btn-link:focus,
.identity-header-actions .btn-link:active:focus {
    box-shadow: none;
}

/* WCAG 2.2 SC 2.4.11: visible keyboard focus indicator.
   White outline on the purple header gives well above 3:1 contrast ratio. */
.identity-header-actions .btn-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

/* ── App Launcher menu ───────────────────────────────────────────────────── */

.app-launcher-menu {
    min-width: 240px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(var(--bs-body-color-rgb), 0.16), 0 0 1px rgba(var(--bs-body-color-rgb), 0.08);
    border: none;
    padding: 8px 0;
}

.app-launcher-menu .dropdown-item {
    padding: 1rem 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.app-launcher-menu .dropdown-item:hover,
.app-launcher-menu .dropdown-item:focus {
    background-color: var(--bs-dropdown-link-hover-bg);
    color: var(--bs-dropdown-link-hover-color);
}

/* ── User menu ───────────────────────────────────────────────────────────── */

.user-menu {
    min-width: 200px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(var(--bs-body-color-rgb), 0.16), 0 0 1px rgba(var(--bs-body-color-rgb), 0.08);
    border: none;
    padding: 8px 0;
}

/* Icon + text row shared by both the <a> and the submit <button> */
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1rem 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
}

.user-menu-item:hover,
.user-menu-item:focus {
    background-color: var(--bs-dropdown-link-hover-bg);
    color: var(--bs-dropdown-link-hover-color);
}

/* Icon: block so it doesn't inherit inline baseline spacing */
.user-menu-icon {
    display: block;
    flex-shrink: 0;
}

/* Collapse form margin so the submit button row is indistinguishable from links */
.user-menu form {
    margin: 0;
}

/* ── Culture toggle (icon + text, used in both the header row and the drawer) ── */

.culture-toggle-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ── Mobile nav hamburger + offcanvas ────────────────────────────────────── */

/* Same white-on-primary treatment as .identity-header-actions .btn-link,
   scoped directly since the toggle sits outside that container. Leads the
   header (left-aligned, before the app name) — matching the side the
   drawer slides out from, and cso's layout. */
.identity-header .mobile-nav-toggle {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: rgba(255, 255, 255, .75);
    --bs-btn-active-color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 6px;
    border-radius: 4px;
    margin-right: 12px;
}

.identity-header .mobile-nav-toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

/* Starts below the header instead of covering it — Bootstrap's base .offcanvas
   class already sets bottom:0, so overriding just top: gives the remaining
   height for free (no explicit height needed). offcanvas-start (added in
   MainLayout.razor) handles the left-edge slide-in and border-right. */
/* Compound selector needed: Bootstrap's own .offcanvas.offcanvas-start rule
   is also two classes, so a single-class override here would lose despite
   loading later in the cascade — equal specificity falls back to source
   order only when the compound classes match exactly. */
.offcanvas.mobile-nav-offcanvas {
    top: 56px;
    width: min(320px, 85vw);
}

@media (prefers-reduced-motion: reduce) {
    .offcanvas.mobile-nav-offcanvas {
        transition: none;
    }
}

.mobile-nav-list {
    margin: 0;
    padding: 0;
}

.mobile-nav-list-item {
    border-bottom: 1px solid var(--bs-border-color);
}

    .mobile-nav-list-item:last-child {
        border-bottom: none;
    }

    /* A gated item (e.g. UserMenu when signed out) renders an empty <li> —
       hide it instead of leaving a stray blank divider row. */
    .mobile-nav-list-item:empty {
        display: none;
        border: none;
    }

    /* CultureToggle renders unchanged inside the drawer (icon + text link) —
       just ensure legible colour on the offcanvas's body background instead
       of the header's forced white. ThemePicker uses .mobile-nav-flat-item
       in List mode, styled below alongside AppLauncher/UserMenu's rows. */
    .mobile-nav-list-item .nav-link {
        display: flex;
        align-items: center;
        gap: 14px;
        color: var(--bs-body-color);
        padding: 1rem 0;
    }

/* AppLauncher/UserMenu "List" mode rows — same visual language as
   .app-launcher-menu .dropdown-item / .user-menu-item, but full-width
   flat rows instead of dropdown-menu items (no dropdown shell in a drawer). */
.mobile-nav-flat-list {
    margin: 0;
}

.mobile-nav-flat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 1rem 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    text-align: left;
    background: none;
    border: none;
    color: var(--bs-body-color);
    text-decoration: none;
}

    .mobile-nav-flat-item:hover,
    .mobile-nav-flat-item:focus {
        color: var(--bs-primary);
    }

/* ── Main content — centered ─────────────────────────────────────────────── */

.identity-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem 3rem;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.identity-card {
    background: var(--bs-body-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .08);
    padding: 2.5rem;
    width: 100%;
    max-width: 560px;
}

.identity-card--wide {
    max-width: 900px;
}

/* ── Typography ──────────────────────────────────────────────────────────── */

.identity-title {
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.identity-subtitle {
    font-size: 1rem;
    color: var(--bs-secondary-color);
    margin-bottom: 1.75rem;
    line-height: 1.4;
}

    .identity-subtitle a {
        color: var(--bs-primary);
        text-decoration: none;
    }

        .identity-subtitle a:hover {
            text-decoration: underline;
        }

/* ── Form controls (card-scoped) ─────────────────────────────────────────── */

.identity-card .form-control:focus,
.identity-card .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--bs-primary) 25%, transparent);
}

/* Form-floating: hide placeholder when unfocused so the label acts as the placeholder.
   Bootstrap sets this too, but explicit overrides guard against specificity conflicts. */
.identity-card .form-floating > .form-control::placeholder {
    color: transparent;
    opacity: 0;
}

.identity-card .form-floating > .form-control:focus::placeholder {
    color: var(--bs-secondary-color, #6c757d);
    opacity: 1;
}

/* Remove the extra margin that form-label adds when inside form-floating — it
   can shift the absolute-positioned label out of the expected float position. */
.identity-card .form-floating > label.form-label {
    margin-bottom: 0;
}

.identity-card .form-check-input:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--bs-primary) 25%, transparent);
}

.identity-card .form-check-input:checked {
    background-color: var(--bs-tertiary);
    border-color: var(--bs-tertiary);
}

/* ── Links ───────────────────────────────────────────────────────────────── */

.identity-card a:not(.btn) {
    color: var(--bs-primary);
}

/* ── Manage account form width ───────────────────────────────────────────── */
/* Constrains simple edit forms (Profile, Email, Password) so fields don't
   stretch across the full col-lg-9 content column. Matches the effective
   content width of the standard identity-card (560px − 2×2.5rem padding). */

.manage-form {
    max-width: 480px;
}

/* ── Nav pills (manage account sidebar) ──────────────────────────────────── */

.identity-card .nav-link {
    color: var(--bs-primary);
}

.identity-card .nav-pills .nav-link.active {
    background-color: var(--bs-primary);
}

/* ── Alert / status messages ─────────────────────────────────────────────── */

.identity-card .alert {
    border-radius: 8px;
    font-size: 0.875rem;
}

/* ── Link row below form (Forgot password, Register, etc.) ──────────────── */

.identity-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

/* ── Horizontal divider with text ───────────────────────────────────────── */

.identity-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    margin: 1.25rem 0;
}

    .identity-divider::before,
    .identity-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--bs-border-color);
    }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.identity-footer {
    border-top: 1px solid var(--bs-border-color);
    width: 100%;
    margin-top: auto;
    padding: 0.6rem 0;
    text-align: center;
    font-size: 13px; 
    background-color: transparent;
}

.footer-content {
    display: inline-block;
}

.footer-divider {
    margin: 0 0.45rem;
    color: var(--bs-border-color);
    opacity: 0.5;
    user-select: none;
}

.footer-support {
    color: var(--bs-link-color);
    text-decoration: none;
}

.footer-support:hover {
    text-decoration: underline;
}

/* ── Theme diagnostics showcase ─────────────────────────────────────────── */
/* Applies the same form-check accent as .identity-card so the showcase      */
/* reflects the actual checked styling without pulling in card layout rules. */
.theme-showcase-checks .form-check-input:checked {
    background-color: var(--bs-tertiary);
    border-color: var(--bs-tertiary);
}

/* ── Responsive — full-bleed card on small screens ──────────────────────── */

@media (max-width: 576px) {
    .identity-card {
        border-radius: 0;
        box-shadow: none;
        padding: 1.5rem 1.25rem;
        max-width: 100%;
    }

    .identity-main {
        padding: 0 0 2rem;
        align-items: flex-start;
    }
}

/* ── Idempotency Token ─────────────────────────────────────────── */
button[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    filter: grayscale(1);
    pointer-events: none;
}

button[type="submit"].btn-processing::after {
    content: "...";
}
