/* ==========================================================================
   Identity portal on Bootstrap 5.3 with its own design tokens on top.
   Bootstrap supplies the components (card, form-control, form-select, form-check, input-group, btn, alert,
   list-group, badge, visually-hidden); this file only sets tokens, restyles them to the tokens and adds the layouts.
   The organisation theme (accent, logo background, identity portal background settings) arrives in a separate
   stylesheet served from the portal itself (/home/IdentityTheme), so no inline style is ever needed.
   Every colour below can be changed per organisation (Cp3IdentityPortalColourCatalogue): card, text and page colours
   apply to the light scheme; brand and message colours apply in both.
   Server-rendered attributes on <html> (Views/Shared/_LoginLayout.cshtml):
     data-layout = classic | split | spotlight                     (theme setting, default classic)
     data-side   = start | end                                       (split: which side the form is on)
     data-bg     = particles | solid | gradient | image              (background mode setting)
     data-bg-fit = cover | contain | stretch | centre | tile         (image display mode setting)
     data-theme  = light | dark | device (device, or no attribute, follows the device setting)
   ========================================================================== */

:root {
    /* Organisation theme defaults (overridden by the theme stylesheet). */
    --id-accent: #0e97d5;
    --id-accent-text: #ffffff;
    --id-logo-bg: #ffffff;
    --id-bg-particle: #0057c3;
    --id-particle-color: #ffffff;
    --id-bg-solid: #0057c3;
    --id-grad-1: #0057c3;
    --id-grad-2: #003270;
    --id-grad-3: #4a6f9e;
    --id-grad-angle: 237deg;
    --id-bg-image: none;
    --id-on-bg: #ffffff;

    /* Design tokens: surfaces, text, status colours, sizes and motion */
    --id-surface: #ffffff;
    --id-surface-2: #f8f9fc;
    --id-page: #f5f6fa;
    --id-border: #e3e6ee;
    --id-border-strong: #cfd4df;
    --id-text: #1f2430;
    --id-text-2: #4b5263;
    --id-muted: #7b8396;
    --id-danger: #c62828;
    --id-success: #1e8e5a;
    --id-warning: #b26a00;
    --id-radius: 4px;
    --id-shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
    --id-control-h: 32px;
    --id-control-h-lg: 40px;
    --id-text-xs: .6875rem;
    --id-text-sm: .75rem;
    --id-text-base: .8125rem;
    --id-text-md: .9375rem;
    --id-text-lg: 1.125rem;
    --id-ease-out: cubic-bezier(.22, 1, .36, 1);
    --id-dur: 180ms;
    --id-fill: color-mix(in srgb, var(--id-text) 5%, var(--id-surface));
    --id-fill-hover: color-mix(in srgb, var(--id-text) 4%, var(--id-fill));
    --id-fill-accent: color-mix(in srgb, var(--id-accent) 12%, var(--id-surface));
    --id-focus-ring: 0 0 0 3px color-mix(in srgb, var(--id-accent) 28%, transparent);
    --id-focus-border: color-mix(in srgb, var(--id-accent) 60%, var(--id-border-strong));

    /* Bootstrap variables mapped onto the tokens */
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-size: var(--id-text-base);
    --bs-body-line-height: 1.4;
    --bs-body-color: var(--id-text);
    --bs-body-bg: var(--id-surface);
    --bs-secondary-color: var(--id-muted);
    --bs-border-color: var(--id-border);
    --bs-border-radius: var(--id-radius);
    --bs-border-radius-sm: var(--id-radius);
    --bs-border-radius-lg: var(--id-radius);
    --bs-link-color: var(--id-accent);
    --bs-link-color-rgb: 14, 151, 213;
    --bs-link-hover-color: color-mix(in srgb, var(--id-accent) 80%, #000);
    --bs-emphasis-color: var(--id-text);
    --bs-tertiary-bg: var(--id-fill);
    --bs-form-invalid-color: var(--id-danger);
    --bs-form-invalid-border-color: var(--id-danger);
    color-scheme: light;
}

/* Links follow the organisation accent; in dark mode it is lifted so dark accents stay readable. */
:root { --id-link: var(--id-accent); }
a { color: var(--id-link); }

/* Dark: either chosen explicitly, or following the device unless the organisation chose Always light. */
html[data-theme="dark"] {
    --id-surface: #1b1f29;
    --id-surface-2: #222734;
    --id-page: #141821;
    --id-border: #2e3442;
    --id-border-strong: #3a4152;
    --id-text: #e8eaf0;
    --id-text-2: #c0c5d2;
    --id-muted: #8c93a6;
    --id-danger: #ef6b6b;
    --id-success: #4cc38a;
    --id-warning: #f0b44c;
    --id-shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
    --id-fill: color-mix(in srgb, var(--id-text) 7%, var(--id-surface));
    --id-fill-hover: color-mix(in srgb, var(--id-text) 5%, var(--id-fill));
    --id-fill-accent: color-mix(in srgb, var(--id-accent) 18%, var(--id-surface));
    --bs-body-color: var(--id-text);
    --bs-body-bg: var(--id-surface);
    --bs-secondary-color: var(--id-muted);
    --bs-border-color: var(--id-border);
    --bs-emphasis-color: var(--id-text);
    --bs-tertiary-bg: var(--id-fill);
    --bs-form-invalid-color: var(--id-danger);
    --bs-form-invalid-border-color: var(--id-danger);
    --id-select-arrow: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c0c5d2' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    --id-link: color-mix(in srgb, var(--id-accent) 45%, #e8eaf0);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --id-surface: #1b1f29;
        --id-surface-2: #222734;
        --id-page: #141821;
        --id-border: #2e3442;
        --id-border-strong: #3a4152;
        --id-text: #e8eaf0;
        --id-text-2: #c0c5d2;
        --id-muted: #8c93a6;
        --id-danger: #ef6b6b;
        --id-success: #4cc38a;
        --id-warning: #f0b44c;
        --id-shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
        --id-fill: color-mix(in srgb, var(--id-text) 7%, var(--id-surface));
        --id-fill-hover: color-mix(in srgb, var(--id-text) 5%, var(--id-fill));
        --id-fill-accent: color-mix(in srgb, var(--id-accent) 18%, var(--id-surface));
        --bs-body-color: var(--id-text);
        --bs-body-bg: var(--id-surface);
        --bs-secondary-color: var(--id-muted);
        --bs-border-color: var(--id-border);
        --bs-emphasis-color: var(--id-text);
        --bs-tertiary-bg: var(--id-fill);
        --bs-form-invalid-color: var(--id-danger);
        --bs-form-invalid-border-color: var(--id-danger);
        --id-select-arrow: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c0c5d2' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
        --id-link: color-mix(in srgb, var(--id-accent) 45%, #e8eaf0);
        color-scheme: dark;
    }
}

html, body { min-height: 100%; }
body { background: var(--id-bg-particle); -webkit-font-smoothing: antialiased; }

/* ==========================================================================
   Background: one layer, four modes (existing identity portal theme settings).
   ========================================================================== */
.id-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--id-bg-particle);
}
[data-bg="solid"] .id-bg { background: var(--id-bg-solid); }
[data-bg="gradient"] .id-bg { background: linear-gradient(var(--id-grad-angle), var(--id-grad-1), var(--id-grad-2) 55%, var(--id-grad-3)); }
[data-bg="image"] .id-bg { background: var(--id-bg-solid) var(--id-bg-image) center / cover no-repeat; }
[data-bg="image"][data-bg-fit="contain"] .id-bg { background-size: contain; }
[data-bg="image"][data-bg-fit="stretch"] .id-bg { background-size: 100% 100%; }
[data-bg="image"][data-bg-fit="centre"] .id-bg { background-size: auto; }
[data-bg="image"][data-bg-fit="tile"] .id-bg { background-position: left top; background-size: auto; background-repeat: repeat; }
.id-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(10, 16, 28, 0) 0%, rgba(10, 16, 28, .28) 100%);
}
[data-theme="dark"] .id-bg::after { background: rgba(8, 11, 18, .45); }
.id-particles { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
[data-bg="particles"] .id-particles { display: block; }

/* ==========================================================================
   Shell, aside (brand panel) and card. The layouts below only rearrange these.
   ========================================================================== */
.id-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
}
.id-main {
    display: grid;
    grid-template-rows: 1fr auto;
    justify-items: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem 1rem .75rem;
}

/* Brand panel: big logo, welcome title and text. Used by Split and Spotlight. */
.id-aside { display: none; color: var(--id-on-bg); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.id-aside-logo {
    display: inline-flex;
    padding: .75rem 1rem;
    background: var(--id-logo-bg);
    border-radius: var(--id-radius);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.id-aside-logo img { display: block; max-height: 64px; max-width: 220px; width: auto; height: auto; }
.id-aside-title { margin: 1.25rem 0 .25rem; font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.id-aside-text { margin: 0; max-width: 32rem; font-size: var(--id-text-md); opacity: .9; }
.id-aside-foot { display: none; margin: 0; font-size: var(--id-text-sm); opacity: .75; }

.id-card {
    --bs-card-border-width: 0;
    --bs-card-border-radius: var(--id-radius);
    --bs-card-inner-border-radius: var(--id-radius);
    --bs-card-bg: var(--id-surface);
    --bs-card-cap-bg: var(--id-surface-2);
    --bs-card-cap-padding-y: .75rem;
    --bs-card-cap-padding-x: 1.5rem;
    --bs-card-spacer-x: 1.5rem;
    --bs-card-spacer-y: 1rem;
    width: min(25rem, 100%);
    box-shadow: var(--id-shadow-lg);
    overflow: hidden;
    animation: id-rise .35s ease-out both;
}
/* Fade only: a moving card never settles for browser automation with scripting off, so its buttons can't be clicked. */
@keyframes id-rise { from { opacity: 0; } to { opacity: 1; } }

.id-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    border-top: 1px solid var(--id-border);
    color: var(--id-muted);
    font-size: var(--id-text-sm);
}

/* Progress strip. Only shown by server-rendered waiting pages. */
.id-progress { height: 3px; overflow: hidden; background: color-mix(in srgb, var(--id-accent) 18%, transparent); }
.id-progress span { display: block; width: 35%; height: 100%; background: var(--id-accent); animation: id-sweep 1.4s ease-in-out infinite; }
@keyframes id-sweep { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* Logo in the card: the organisation's logo, never stretched; on its logo plate in dark mode. */
.id-brand { display: flex; justify-content: center; padding: 1.5rem 1.5rem .5rem; }
.id-brand img { display: block; max-width: 200px; max-height: 56px; width: auto; height: auto; }
[data-theme="dark"] .id-brand { margin: 1rem 1.5rem 0; padding: .75rem; background: var(--id-logo-bg); border-radius: var(--id-radius); }
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .id-brand { margin: 1rem 1.5rem 0; padding: .75rem; background: var(--id-logo-bg); border-radius: var(--id-radius); }
}

.id-card .card-body { display: grid; align-content: start; gap: 1rem; padding-bottom: 1.5rem; }
.id-card .card-body.text-center .id-hero { justify-self: center; }
.id-title { margin: 0; font-size: var(--id-text-lg); font-weight: 600; line-height: 1.25; }
.id-lede { margin: -.75rem 0 0; color: var(--id-text-2); }

/* Step indicator on the verification pages. */
.id-steps { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.id-steps li { width: 24px; height: 4px; border-radius: var(--id-radius); background: color-mix(in srgb, var(--id-accent) 45%, transparent); }
.id-steps li[aria-current] { background: var(--id-accent); }

/* ==========================================================================
   Bootstrap components restyled: filled controls, white with a ring on focus.
   ========================================================================== */
.form-label { margin-bottom: .375rem; font-size: var(--id-text-sm); font-weight: 600; color: var(--id-text-2); }
.form-text { margin-top: .375rem; font-size: var(--id-text-sm); color: var(--id-muted); }
.form-control,
.form-select {
    min-height: var(--id-control-h-lg);
    font-size: var(--id-text-md);
    color: var(--id-text);
    background-color: var(--id-fill);
    border-color: transparent;
    border-radius: var(--id-radius);
    transition: background-color var(--id-dur) var(--id-ease-out), border-color var(--id-dur) var(--id-ease-out), box-shadow var(--id-dur) var(--id-ease-out);
}
.form-select { --bs-form-select-bg-img: var(--id-select-arrow, url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234b5263' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e")); }
.form-control:hover:not(:focus, :disabled),
.form-select:hover:not(:focus, :disabled) { background-color: var(--id-fill-hover); }
.form-control:focus,
.form-select:focus { color: var(--id-text); background-color: var(--id-surface); border-color: var(--id-focus-border); box-shadow: var(--id-focus-ring); }
.form-control::placeholder { color: var(--id-muted); }
.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--id-danger); background-color: color-mix(in srgb, var(--id-danger) 6%, var(--id-surface)); }
.form-control.is-invalid:focus,
.form-select.is-invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--id-danger) 22%, transparent); }
.invalid-feedback { font-size: var(--id-text-sm); }

.input-group-text { min-width: 2.5rem; justify-content: center; color: var(--id-muted); background: var(--id-fill); border-color: transparent; }
.input-group .btn-reveal { color: var(--id-muted); background: var(--id-fill); border: 1px solid transparent; }
.input-group .btn-reveal:hover { color: var(--id-text); background: var(--id-fill-hover); }
.input-group:focus-within .input-group-text,
.input-group:focus-within .btn-reveal { background: var(--id-surface); }
.input-group > .form-control:focus { z-index: 3; }

.form-check-input { border-color: var(--id-border-strong); border-radius: var(--id-radius); background-color: var(--id-surface); }
.form-check-input:checked { background-color: var(--id-accent); border-color: var(--id-accent); }
.form-check-input:focus { border-color: var(--id-focus-border); box-shadow: var(--id-focus-ring); }
.form-check-label { color: var(--id-text-2); }

.btn { --bs-btn-font-weight: 600; --bs-btn-border-radius: var(--id-radius); --bs-btn-focus-box-shadow: var(--id-focus-ring); }
.btn-lg { --bs-btn-padding-y: 0; --bs-btn-font-size: var(--id-text-md); min-height: var(--id-control-h-lg); display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-primary {
    --bs-btn-color: var(--id-accent-text);
    --bs-btn-bg: var(--id-accent);
    --bs-btn-border-color: var(--id-accent);
    --bs-btn-hover-color: var(--id-accent-text);
    --bs-btn-hover-bg: color-mix(in srgb, var(--id-accent) 88%, #000);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--id-accent) 88%, #000);
    --bs-btn-active-color: var(--id-accent-text);
    --bs-btn-active-bg: color-mix(in srgb, var(--id-accent) 80%, #000);
    --bs-btn-active-border-color: color-mix(in srgb, var(--id-accent) 80%, #000);
    --bs-btn-disabled-color: var(--id-accent-text);
    --bs-btn-disabled-bg: var(--id-accent);
    --bs-btn-disabled-border-color: var(--id-accent);
}
.btn-quiet {
    --bs-btn-color: var(--id-text-2);
    --bs-btn-font-weight: 500;
    --bs-btn-hover-color: var(--id-text);
    --bs-btn-hover-bg: var(--id-fill);
    --bs-btn-active-bg: var(--id-fill-hover);
}
.btn-link { --bs-btn-font-weight: 500; --bs-btn-color: var(--id-link); --bs-btn-hover-color: var(--bs-link-hover-color); padding: 0; text-decoration: none; }
.card-footer .btn-link, .card-footer a { color: var(--id-text-2); text-decoration: none; }
.card-footer a:hover { color: var(--id-text); text-decoration: none; }
.btn + .btn-quiet { margin-top: -.5rem; }

.alert { --bs-alert-padding-y: .5rem; --bs-alert-padding-x: .75rem; --bs-alert-margin-bottom: 0; --bs-alert-border-radius: var(--id-radius); display: flex; gap: .5rem; align-items: flex-start; }
.alert-danger { --bs-alert-color: var(--id-danger); --bs-alert-bg: color-mix(in srgb, var(--id-danger) 10%, var(--id-surface)); --bs-alert-border-color: transparent; border-left: 3px solid var(--id-danger); }
.alert-warning { --bs-alert-color: var(--id-warning); --bs-alert-bg: color-mix(in srgb, var(--id-warning) 12%, var(--id-surface)); --bs-alert-border-color: transparent; border-left: 3px solid var(--id-warning); }
.alert-success { --bs-alert-color: var(--id-success); --bs-alert-bg: color-mix(in srgb, var(--id-success) 10%, var(--id-surface)); --bs-alert-border-color: transparent; border-left: 3px solid var(--id-success); }
.alert-info { --bs-alert-color: var(--id-text); --bs-alert-bg: var(--id-fill); --bs-alert-border-color: transparent; border-left: 3px solid var(--id-accent); }
.alert i { margin-top: 2px; }
.alert-list { display: grid; gap: 2px; }

/* Choice lists (sign-in and verification methods) */
.id-choices { --bs-list-group-bg: var(--id-fill); --bs-list-group-border-width: 0; --bs-list-group-action-hover-bg: var(--id-fill-accent); --bs-list-group-action-active-bg: var(--id-fill-accent); --bs-list-group-color: var(--id-text); --bs-list-group-action-color: var(--id-text); --bs-list-group-action-hover-color: var(--id-text); gap: 6px; }
.id-choices .list-group-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border-radius: var(--id-radius); text-align: left; }
.id-choices .list-group-item:focus-visible { outline: none; box-shadow: var(--id-focus-ring); position: relative; z-index: 1; }
.id-choice-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--id-radius); background: var(--id-surface); color: var(--id-link); font-size: 1rem; }
.id-choice-icon.is-brand { color: #2f6fd1; }
.id-choice-icon.is-muted { color: var(--id-muted); }
.id-choice-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.id-choice-text strong { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.id-choice-text small { color: var(--id-muted); font-size: var(--id-text-sm); }
.id-choices .fa-chevron-right { color: var(--id-muted); transition: transform 120ms; }
.id-choices .list-group-item:hover .fa-chevron-right { color: var(--id-link); transform: translateX(2px); }
.badge { --bs-badge-font-weight: 600; --bs-badge-border-radius: var(--id-radius); }
.badge.is-accent { color: var(--id-link); background: var(--id-fill-accent); }
.badge.is-muted { color: var(--id-text-2); background: var(--id-border); }
.id-device { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border-radius: var(--id-radius); background: var(--id-fill); }

/* One-time code: one native input drawn as six boxes. Autofill, paste and screen readers all see one field. */
.form-control.id-otp {
    --box: 2.75rem;
    --gap: .5rem;
    width: calc(6 * (var(--box) + var(--gap)) + var(--box));
    max-width: 100%;
    min-height: 3rem;
    padding: 0 0 0 calc((var(--box) - 1ch) / 2);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: calc(var(--box) + var(--gap) - 1ch);
    background-color: transparent;
    background-image: repeating-linear-gradient(90deg, var(--id-otp-box, var(--id-fill)) 0 var(--box), transparent var(--box) calc(var(--box) + var(--gap)));
    background-size: calc(6 * (var(--box) + var(--gap)) - var(--gap)) 100%;
    background-repeat: no-repeat;
    border: 0;
    box-shadow: none;
}
.id-otp:hover:not(:focus) { --id-otp-box: var(--id-fill-hover); background-color: transparent; }
.id-otp:focus { --id-otp-box: var(--id-fill-accent); background-color: transparent; box-shadow: none; outline: 2px solid var(--id-focus-border); outline-offset: 3px; }
.id-otp.is-invalid { --id-otp-box: color-mix(in srgb, var(--id-danger) 12%, var(--id-surface)); background-color: transparent; }

/* Authenticator app setup: numbered steps, the QR code on a white plate (scanners need the contrast) and the key. */
.id-setup-step { display: grid; gap: .5rem; }
.id-setup-step-title { display: flex; align-items: center; gap: .5rem; margin: 0; font-weight: 600; }
.id-setup-step-number { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--id-fill-accent); color: var(--id-link); font-size: var(--id-text-xs); font-weight: 700; }
.id-setup-step p { margin: 0; color: var(--id-text-2); }
.id-qr { display: grid; place-items: center; padding: .75rem; background: #fff; border-radius: var(--id-radius); }
.id-qr svg { display: block; width: 100%; max-width: 200px; height: auto; }
.id-setup-key summary { cursor: pointer; color: var(--id-link); font-weight: 500; }
.id-setup-key code { display: block; margin-top: .375rem; padding: .5rem .75rem; border-radius: var(--id-radius); background: var(--id-fill); color: var(--id-text); font-size: var(--id-text-md); word-break: break-all; user-select: all; }

/* Reset and set password: the result message the page shows after posting. */
.id-status { white-space: pre-line; }
.id-status:empty { display: none; }

/* Customer Portal self-registration introduction, as written by the administrator. */
.id-intro { margin: 0; color: var(--id-text-2); white-space: pre-line; }

.id-hero { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--id-fill-accent); color: var(--id-link); font-size: 1.5rem; }
.id-hero.is-success { background: color-mix(in srgb, var(--id-success) 14%, var(--id-surface)); color: var(--id-success); }
.id-hero.is-warning { background: color-mix(in srgb, var(--id-warning) 16%, var(--id-surface)); color: var(--id-warning); }
.id-hero.is-danger { background: color-mix(in srgb, var(--id-danger) 14%, var(--id-surface)); color: var(--id-danger); }
.id-hero.is-brand { color: #2f6fd1; }

.id-reference { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: .5rem .75rem; border-radius: var(--id-radius); background: var(--id-fill); font-size: var(--id-text-sm); }
.id-reference code { color: var(--id-text); user-select: all; }
.id-reference span { color: var(--id-muted); }

/* Footer under the card. */
.id-legal { width: 100%; padding: 0 1rem; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 16px; color: color-mix(in srgb, var(--id-on-bg) 85%, transparent); font-size: var(--id-text-sm); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }

/* ==========================================================================
   Layouts (pure CSS; the server renders data-layout and data-side on <html>)
   ========================================================================== */

/* ---- Classic (default): centred card on the configurable background. Nothing extra. ---- */

/* ---- Split: the background as a brand side (logo top-left, welcome in the middle, a quiet footer line), and the
        form on a plain panel on the other side. On small screens the brand side becomes a compact header band. ---- */
[data-layout="split"] .id-main { background: var(--id-surface); align-content: center; }
@media (min-width: 768px) {
    [data-layout="split"] .id-shell { grid-template-columns: 1fr minmax(24rem, 34%); }
    [data-layout="split"][data-side="start"] .id-shell { grid-template-columns: minmax(24rem, 34%) 1fr; }
    [data-layout="split"][data-side="start"] .id-main { order: -1; }
    [data-layout="split"] .id-main { box-shadow: -1px 0 0 var(--id-border), -12px 0 32px rgba(10, 16, 28, .12); }
    [data-layout="split"][data-side="start"] .id-main { box-shadow: 1px 0 0 var(--id-border), 12px 0 32px rgba(10, 16, 28, .12); }
    [data-layout="split"] .id-aside {
        display: grid;
        grid-template-rows: auto 1fr auto;
        gap: 2rem;
        padding: 2.5rem 3rem;
        /* A soft scrim from the outer edge keeps the welcome readable on any image or colour. */
        background: linear-gradient(90deg, rgba(8, 14, 24, .42), rgba(8, 14, 24, .08) 70%, transparent);
    }
    [data-layout="split"][data-side="start"] .id-aside { background: linear-gradient(270deg, rgba(8, 14, 24, .42), rgba(8, 14, 24, .08) 70%, transparent); }
    [data-layout="split"] .id-aside-logo { justify-self: start; padding: .5rem .75rem; box-shadow: none; }
    [data-layout="split"] .id-aside-logo img { max-height: 36px; max-width: 180px; }
    [data-layout="split"] .id-aside-body { align-self: center; max-width: 30rem; }
    [data-layout="split"] .id-aside-body::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        margin-bottom: 1.25rem;
        border-radius: var(--id-radius);
        background: currentColor;
        opacity: .85;
    }
    [data-layout="split"] .id-aside-title { margin: 0 0 .5rem; font-size: clamp(1.75rem, 2.6vw, 2.5rem); font-weight: 700; letter-spacing: -.01em; }
    [data-layout="split"] .id-aside-text { font-size: 1rem; line-height: 1.5; }
    [data-layout="split"] .id-aside-foot { display: flex; align-items: center; gap: .5rem; }
}
[data-layout="split"] .id-card { --bs-card-cap-bg: transparent; box-shadow: none; animation: none; }
[data-layout="split"] .id-card .card-footer { border-top: 0; padding-top: 0; }
[data-layout="split"] .id-brand,
[data-layout="spotlight"] .id-brand { display: none; }
[data-layout="split"] .id-legal { color: var(--id-muted); text-shadow: none; }
@media (max-width: 767.98px) {
    [data-layout="split"] .id-shell { grid-template-rows: auto 1fr; }
    [data-layout="split"] .id-aside {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: 1rem 1.25rem;
        background: linear-gradient(180deg, rgba(8, 14, 24, .1), rgba(8, 14, 24, .35));
    }
    [data-layout="split"] .id-aside-logo { flex: none; padding: .375rem .5rem; box-shadow: none; }
    [data-layout="split"] .id-aside-logo img { max-height: 28px; max-width: 120px; }
    [data-layout="split"] .id-aside-title { margin: 0; font-size: 1rem; }
    [data-layout="split"] .id-aside-text { display: none; }
    [data-layout="split"] .id-main { padding-top: .5rem; }
}

/* ---- Spotlight: a hero banner in the organisation's background with a large welcome, and the form card
        overlapping its lower edge on a plain page. ---- */
[data-layout="spotlight"] body { background: var(--id-page); }
[data-layout="spotlight"] .id-bg { position: absolute; inset: 0 0 auto 0; height: 22rem; }
[data-layout="spotlight"] .id-bg::after { background: linear-gradient(180deg, rgba(8, 14, 24, .15), rgba(8, 14, 24, .45)); }
[data-layout="spotlight"] .id-shell { grid-template-rows: 16rem auto; align-content: start; }
[data-layout="spotlight"] .id-aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 1.5rem 1rem 2rem;
    text-align: center;
}
[data-layout="spotlight"] .id-aside-logo { padding: .5rem .75rem; box-shadow: none; }
[data-layout="spotlight"] .id-aside-logo img { max-height: 40px; max-width: 200px; }
[data-layout="spotlight"] .id-aside-title { margin: 1rem 0 .25rem; font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -.01em; }
[data-layout="spotlight"] .id-aside-text { margin: 0 auto; max-width: 36rem; }
[data-layout="spotlight"] .id-aside-foot { display: none; }
[data-layout="spotlight"] .id-main { align-items: start; padding-top: 0; }
[data-layout="spotlight"] .id-card { width: min(24rem, 100%); }
[data-layout="spotlight"] .id-legal { color: var(--id-muted); text-shadow: none; }

/* Small screens: every layout becomes a full-width sheet so the form is never cramped. */
@media (max-width: 479.98px) {
    .id-main { padding: 0 0 .75rem; align-items: start; }
    .id-card { width: 100%; border-radius: 0; box-shadow: none; }
    [data-layout="classic"] .id-card { min-height: calc(100dvh - 3rem); }
    [data-layout="spotlight"] .id-bg { height: 15rem; }
    [data-layout="spotlight"] .id-shell { grid-template-rows: 12.5rem auto; }
    [data-layout="spotlight"] .id-aside { padding-bottom: 1.25rem; }
    [data-layout="spotlight"] .id-aside-text { display: none; }
    [data-layout="spotlight"] .id-card { width: calc(100% - 1.5rem); border-radius: var(--id-radius); box-shadow: var(--id-shadow-lg); }
}

@media (prefers-reduced-motion: reduce) {
    .id-card, .id-progress span { animation: none; }
}

/* Input groups whose reveal button is still hidden (no JavaScript) keep their rounded right edge. */
.input-group:has(> [hidden]:last-child) > .form-control { border-top-right-radius: var(--id-radius); border-bottom-right-radius: var(--id-radius); }

/* Links are never underlined, not even on hover: colour and weight carry them. */
a, a:hover, a:focus, .btn-link, .btn-link:hover { text-decoration: none; }
