/* OMB-10909 identity pages (Version A, mockup OMB-10853 boards A1–A8). Used only by Pages/Shared/_AuthLayout.cshtml. */

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url('../fonts/plus-jakarta-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --auth-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --auth-backdrop: #000A4A;
    --auth-glow-teal: rgba(0, 181, 168, 0.36);
    --auth-glow-mint: rgba(0, 232, 192, 0.20);
    --auth-glow-mint-mobile: rgba(0, 232, 192, 0.28);
    --auth-dot: rgba(255, 255, 255, 0.10);
    --auth-plan-line: rgba(255, 255, 255, 0.08);
    --auth-plan-fill: rgba(0, 232, 192, 0.22);
    --auth-card: #FFFFFF;
    --auth-text: #0B1530;
    --auth-heading: #000F6E;
    --auth-muted: #4A5568;
    --auth-placeholder: #6B7588;
    --auth-border: #DCE1EA;
    --auth-input-border: #8A94A6;
    --auth-divider: #EDF0F4;
    --auth-row-hover: #F6F8FA;
    --auth-row-open: #F0FAF9;
    --auth-chevron: #8A94A6;
    --auth-chevron-open: #00666F;
    --auth-focus: #00838F;
    --auth-focus-ring: rgba(0, 131, 143, 0.16);
    --auth-primary: #000F6E;
    --auth-primary-hover: #002B7A;
    --auth-link: #007480;
    --auth-link-hover: #005A63;
    --auth-chip: #F1F4F8;
    --auth-icon-tile: #E3F5F3;
    --auth-icon-tile-text: #00666F;
    --auth-help: #EAF6F5;
    --auth-help-hover: #D9F0EE;
    --auth-wait-text: #6B7587;
    --auth-footer-text: rgba(255, 255, 255, 0.72);
    --auth-footer-link: rgba(255, 255, 255, 0.88);
    --auth-legal-link: #3A4654;
    --auth-error-bg: #FDECEC;
    --auth-error-border: #F5C2C0;
    --auth-error-text: #9B1C1C;
    --auth-warn-tile: #FFF4E0;
    --auth-warn-accent: #B45309;
    --auth-warn-bg: #FFF8EB;
    --auth-warn-border: #F2D19B;
    --auth-warn-text: #7A3E00;
    --auth-warn-bar: #F59E0B;
    --auth-danger-tile: #FDECEC;
    --auth-danger-accent: #B91C1C;
    --auth-danger-bg: #FDF1F1;
    --auth-danger-border: #F1C0C0;
    --auth-danger-text: #8A1C1C;
    --auth-error-tile-text: #B42318;
    --auth-bar: #00B5A8;
    --auth-panel: #F8FAFC;
    --auth-panel-alt: #F4F6FA;
    --auth-secondary-border: #C9D1DD;
    --auth-card-shadow: 0 30px 80px rgba(0, 4, 40, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.auth-body {
    margin: 0;
    background-color: var(--auth-backdrop);
    color: #FFFFFF;
    font-family: var(--auth-font);
    font-size: 15px;
    /* The mockup boards use the browser default line height. */
    line-height: normal;
}

/* Page frame */

.auth-page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--auth-backdrop);
    background-image:
        radial-gradient(50% 55% at 50% 48%, var(--auth-glow-teal) 0%, rgba(0, 181, 168, 0) 72%),
        radial-gradient(45% 50% at 0% 0%, var(--auth-glow-mint) 0%, rgba(0, 232, 192, 0) 100%),
        radial-gradient(var(--auth-dot) 1px, rgba(255, 255, 255, 0) 1.5px);
    background-size: 100% 100%, 100% 100%, 24px 24px;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.auth-backdrop-lines {
    fill: none;
    stroke: var(--auth-plan-line);
    stroke-width: 2;
}

.auth-backdrop-desks {
    fill: var(--auth-plan-fill);
}

.auth-header,
.auth-main,
.auth-footer {
    position: relative;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 28px 40px;
}

.auth-wordmark {
    position: relative;
    flex: none;
    height: 44px;
}

.auth-wordmark img {
    display: block;
    width: auto;
    height: 100%;
}

.auth-wordmark-text {
    filter: brightness(0) invert(1);
}

/* Unfiltered copy clipped to the logo mark (top right of the image), so the mark keeps its colors. */
.auth-wordmark-mark {
    position: absolute;
    top: 0;
    left: 0;
    clip-path: inset(0 0 52% 86%);
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 20px;
    padding: 24px 40px 28px;
    color: var(--auth-footer-text);
    font-size: 13px;
}

.auth-footer a {
    color: var(--auth-footer-link);
}

.auth-footer a:hover {
    color: #FFFFFF;
}

.auth-version {
    font-size: 12px;
}

/* Card */

.auth-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 440px;
    padding: 40px 36px 32px;
    border-radius: 24px;
    background: var(--auth-card);
    color: var(--auth-text);
    box-shadow: var(--auth-card-shadow);
}

.auth-card--otp {
    padding-top: 28px;
}

.auth-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.auth-logo-icon {
    display: block;
    width: 30px;
    height: auto;
}

.auth-title {
    margin: 0;
    color: var(--auth-heading);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 0;
    color: var(--auth-muted);
    font-size: 15px;
}

/* Method list */

.auth-methods {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    overflow: hidden;
}

.auth-method {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: 10px 16px 10px 18px;
    border: 0;
    border-bottom: 1px solid var(--auth-divider);
    background: var(--auth-card);
    color: var(--auth-text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.auth-method:hover {
    background: var(--auth-row-hover);
    color: var(--auth-text);
}

.auth-method-icon {
    flex: none;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.auth-email-icon {
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--auth-heading);
}

.auth-method-label {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.auth-method-chevron {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--auth-chevron);
}

.auth-email {
    display: flex;
    flex-direction: column;
}

.auth-email .auth-method {
    border-bottom: 0;
}

.auth-email.is-open {
    background: var(--auth-row-open);
}

.auth-email.is-open .auth-method,
.auth-email.is-open .auth-method:hover {
    background: transparent;
}

.auth-email.is-open .auth-method-chevron {
    color: var(--auth-chevron-open);
    transform: rotate(180deg);
}

.auth-email-panel {
    padding: 0 18px 18px;
}

.auth-email-panel:not([hidden]) {
    animation: auth-panel-in 160ms ease-out;
}

@keyframes auth-panel-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Forms */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 600;
}

.auth-helper {
    color: var(--auth-muted);
    font-size: 13px;
}

.auth-input {
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 14px;
    border: 1.5px solid var(--auth-input-border);
    border-radius: 12px;
    background: var(--auth-card);
    color: var(--auth-text);
    font-family: inherit;
    font-size: 16px;
    outline: none;
}

.auth-input::placeholder {
    color: var(--auth-placeholder);
    opacity: 1;
}

.auth-input:focus {
    border-color: var(--auth-focus);
    box-shadow: 0 0 0 4px var(--auth-focus-ring);
}

.auth-input--otp {
    height: 60px;
    padding: 0 16px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.45em;
    text-align: center;
}

.auth-input--otp::placeholder {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: normal;
}

.auth-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: var(--auth-primary);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.auth-primary:hover {
    background: var(--auth-primary-hover);
    color: #FFFFFF;
}

.auth-primary--tall {
    height: 52px;
}

.auth-primary svg {
    flex: none;
    width: 18px;
    height: 18px;
}

.auth-error {
    padding: 10px 14px;
    border: 1px solid var(--auth-error-border);
    border-radius: 12px;
    background: var(--auth-error-bg);
    color: var(--auth-error-text);
    font-size: 14px;
    line-height: 1.4;
}

.auth-error ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-error li + li {
    margin-top: 4px;
}

/* OTP step */

.auth-back {
    align-self: flex-start;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    color: var(--auth-text);
    text-decoration: none;
}

.auth-back:hover {
    background: var(--auth-row-hover);
    color: var(--auth-text);
}

.auth-back svg {
    width: 20px;
    height: 20px;
}

/* The Back button is a submit button in the OTP form (value "reset"). It comes after Log in in the DOM, so Enter
   presses Log in. "order: -1" shows it first in the form. The bottom margin plus the form gap (12px) equals the
   card gap (24px), so the spacing matches board A3. */
.auth-otp-form .auth-back {
    order: -1;
    margin: 0 0 12px;
    padding: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.auth-otp-form .auth-back:hover {
    background: var(--auth-row-hover);
}

.auth-otp-form .auth-heading {
    margin-bottom: 12px;
}

.auth-icon-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--auth-icon-tile);
    color: var(--auth-icon-tile-text);
}

.auth-icon-tile svg {
    width: 26px;
    height: 26px;
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 6px 6px 6px 14px;
    border-radius: 999px;
    background: var(--auth-chip);
}

/* Chip without a button (board A3). */
.auth-chip--plain {
    padding: 8px 16px;
}

.auth-chip-email {
    min-width: 0;
    overflow: hidden;
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-chip-button {
    position: relative;
    flex: none;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid var(--auth-border);
    border-radius: 999px;
    background: var(--auth-card);
    color: var(--auth-link);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.auth-chip-button:hover {
    color: var(--auth-link-hover);
}

/* Extends the touch target to 44px without changing the look. */
.auth-chip-button::after {
    content: '';
    position: absolute;
    inset: -7px -4px;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--auth-link);
    font-size: 14px;
    font-weight: 600;
}

.auth-link:hover {
    color: var(--auth-link-hover);
}

/* The negative margin keeps the mockup spacing (a text box of about 18px) while the touch target stays 44px high. */
.auth-link--center {
    align-self: center;
    margin: -13px 0;
}

/* Resend row (boards A3.01 and A3.02). wwwroot/js/login.js counts down and then shows the Resend button. */

.auth-resend {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    color: var(--auth-muted);
    font-size: 14px;
    text-align: center;
}

.auth-resend-text {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 6px;
}

.auth-resend-text--available {
    gap: 2px 4px;
}

.auth-resend-wait {
    color: var(--auth-wait-text);
}

.auth-resend-wait strong {
    color: var(--auth-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.auth-resend-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin: 0;
    padding: 0 6px;
    border: 0;
    background: none;
    color: var(--auth-link);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.auth-resend-button:hover {
    color: var(--auth-link-hover);
}

.auth-resend-button svg {
    flex: none;
    width: 16px;
    height: 16px;
}

/* On desktop the wrapper is not a box, so the link and the help pill are card items (board A3).
   On mobile it becomes the bottom row of the sheet. */
.auth-otp-foot {
    display: contents;
}

/* "Can't log in?" pill (Pages/Shared/_AuthHelp.cshtml), below a divider at the bottom of the card. */

.auth-help {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--auth-divider);
}

.auth-help-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--auth-help);
    color: var(--auth-icon-tile-text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.auth-help-link:hover {
    background: var(--auth-help-hover);
    color: var(--auth-icon-tile-text);
}

/* Extends the touch target to 44px without changing the look. */
.auth-help-link::after {
    content: '';
    position: absolute;
    inset: -4px 0;
}

.auth-help-link svg {
    flex: none;
    width: 18px;
    height: 18px;
}

/* Focus */

:where(.auth-page) :is(a, button):focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--auth-focus-ring);
}

.auth-footer a:focus-visible {
    outline-color: #FFFFFF;
}

/* Rows sit inside a list with overflow: hidden, so their focus style is drawn inside. */
.auth-method:focus-visible {
    outline-offset: -2px;
    box-shadow: inset 0 0 0 4px var(--auth-focus-ring);
}

/* Short desktop screens (spec 7.4) */

@media (min-width: 600px) and (max-height: 759.98px) {
    .auth-header {
        padding: 16px 40px;
    }

    .auth-main {
        padding: 12px;
    }

    .auth-card {
        padding: 28px 36px 24px;
    }

    .auth-logo-icon {
        display: none;
    }

    .auth-footer {
        padding: 12px 40px 16px;
    }
}

/* Mobile (boards A1–A3 mobile). The card and the footer form one white sheet below the header.
   The sheet fills the screen, and the help pill and the legal links sit at its bottom. */

@media (max-width: 599.98px) {
    .auth-page {
        background-image:
            radial-gradient(70% 90% at 0% 0%, var(--auth-glow-mint-mobile) 0%, rgba(0, 232, 192, 0) 100%),
            radial-gradient(var(--auth-dot) 1px, rgba(255, 255, 255, 0) 1.5px);
        background-size: 100% 100%, 20px 20px;
    }

    .auth-backdrop {
        display: none;
    }

    .auth-header {
        flex: none;
        height: 84px;
        gap: 12px;
        padding: 0 20px 8px;
    }

    .auth-wordmark {
        height: 30px;
    }

    .auth-main {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0;
    }

    .auth-card {
        flex: 1;
        max-width: none;
        gap: 20px;
        padding: 24px 20px 0;
        border-radius: 24px 24px 0 0;
        box-shadow: none;
    }

    .auth-help {
        margin-top: auto;
        padding-top: 0;
        border-top: 0;
    }

    /* Board A2 mobile: tighter spacing while the email section is open. */
    .auth-card--methods:has(.auth-email.is-open) {
        gap: 16px;
    }

    .auth-card--methods .auth-heading {
        align-items: flex-start;
        gap: 4px;
        text-align: left;
    }

    .auth-logo-icon {
        display: none;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-method {
        gap: 12px;
        min-height: 52px;
        padding: 8px 14px 8px 16px;
    }

    .auth-method-icon,
    .auth-email-icon {
        width: 20px;
        height: 20px;
    }

    .auth-email-panel {
        padding: 0 14px 16px;
    }

    .auth-email-panel .auth-form {
        gap: 10px;
    }

    .auth-input {
        height: 48px;
    }

    /* All primary buttons on the mobile boards are 48px high. */
    .auth-primary,
    .auth-primary--tall {
        height: 48px;
    }

    /* Board A3 mobile (One-Time Password step). */
    .auth-page--otp .auth-card {
        gap: 16px;
        padding: 20px;
    }

    .auth-otp-form .auth-heading {
        gap: 10px;
        margin-bottom: 4px;
    }

    /* 4px plus the form gap (12px) equals the mobile card gap (16px). */
    .auth-otp-form .auth-back {
        margin-bottom: 4px;
    }

    .auth-card--otp .auth-icon-tile {
        width: 52px;
        height: 52px;
    }

    .auth-card--otp .auth-icon-tile svg {
        width: 24px;
        height: 24px;
    }

    .auth-card--otp .auth-subtitle {
        font-size: 14px;
    }

    .auth-input--otp {
        height: 56px;
        padding: 0 14px;
        font-size: 24px;
    }

    .auth-resend,
    .auth-resend-button {
        min-height: 40px;
    }

    .auth-otp-foot {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-top: auto;
        padding-top: 8px;
        border-top: 1px solid var(--auth-divider);
    }

    .auth-otp-foot .auth-link--center {
        align-self: auto;
        margin: 0;
        font-size: 13px;
    }

    .auth-otp-foot .auth-help {
        flex: none;
        align-self: center;
        margin-top: 0;
    }

    .auth-otp-foot .auth-help-link {
        gap: 6px;
        padding: 0 12px;
        font-size: 13px;
    }

    /* The footer is the bottom of the sheet: the legal links in a row, and the version below them. */
    .auth-footer {
        flex: none;
        display: grid;
        grid-template-columns: repeat(2, auto);
        justify-content: center;
        gap: 6px 16px;
        padding: 12px 20px 24px;
        background: var(--auth-card);
        color: var(--auth-muted);
    }

    .auth-footer a {
        color: var(--auth-legal-link);
    }

    .auth-footer a:hover {
        color: var(--auth-text);
    }

    .auth-footer a:focus-visible {
        outline-color: var(--auth-focus);
    }

    .auth-version {
        grid-column: 1 / -1;
        justify-self: center;
    }

    /* Board A2 mobile: no version while the email section is open. */
    .auth-page:has(.auth-email.is-open) .auth-footer {
        padding-top: 8px;
    }

    .auth-page:has(.auth-email.is-open) .auth-version {
        display: none;
    }

    /* Board A3 mobile: the sheet has no legal links. */
    .auth-page--otp .auth-footer {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-email-panel:not([hidden]) {
        animation: none;
    }
}

/* Subscription warning page (board A4). It comes after the login rules so .auth-card--wide wins. */

.auth-card--wide {
    max-width: 520px;
    gap: 20px;
    padding: 32px 36px 28px;
}

.sub-tone-none {
    --sub-tile: var(--auth-icon-tile);
    --sub-accent: var(--auth-icon-tile-text);
}

.sub-tone-warn {
    --sub-tile: var(--auth-warn-tile);
    --sub-accent: var(--auth-warn-accent);
    --sub-alert-bg: var(--auth-warn-bg);
    --sub-alert-border: var(--auth-warn-border);
    --sub-alert-text: var(--auth-warn-text);
}

.sub-tone-danger {
    --sub-tile: var(--auth-danger-tile);
    --sub-accent: var(--auth-danger-accent);
    --sub-alert-bg: var(--auth-danger-bg);
    --sub-alert-border: var(--auth-danger-border);
    --sub-alert-text: var(--auth-danger-text);
}

.sub-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sub-tile {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--sub-tile);
    color: var(--sub-accent);
}

.sub-tile svg {
    width: 24px;
    height: 24px;
}

.sub-heading-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sub-title {
    margin: 0;
    color: var(--auth-heading);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.sub-user {
    margin: 0;
    overflow: hidden;
    color: var(--auth-muted);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-user strong {
    color: var(--auth-text);
    font-weight: 700;
}

.sub-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sub-item + .sub-item {
    padding-top: 20px;
    border-top: 1px solid var(--auth-divider);
}

.sub-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--sub-alert-border);
    border-radius: 12px;
    background: var(--sub-alert-bg);
    color: var(--sub-alert-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.sub-alert svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.sub-details {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    overflow: hidden;
}

.sub-details-title {
    padding: 12px 16px;
    border-bottom: 1px solid var(--auth-divider);
    background: var(--auth-panel);
    color: var(--auth-text);
    font-size: 15px;
    font-weight: 700;
}

.sub-rows {
    display: flex;
    flex-direction: column;
    margin: 0;
    font-size: 14px;
}

.sub-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 9px 16px;
    border-bottom: 1px solid var(--auth-divider);
}

.sub-row:last-child {
    padding: 10px 16px 12px;
    border-bottom: 0;
}

.sub-row dt {
    color: var(--auth-muted);
}

.sub-row dd {
    margin: 0;
    color: var(--auth-text);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.sub-row .sub-hi-warn {
    color: var(--auth-warn-accent);
    font-weight: 800;
}

.sub-row .sub-hi-danger {
    color: var(--auth-danger-accent);
    font-weight: 800;
}

.sub-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.sub-pill::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.sub-pill-active {
    background: #E7F6EC;
    color: #166534;
}

.sub-pill-trial {
    background: #E8EEFB;
    color: #1E3A8A;
}

.sub-pill-danger {
    background: var(--auth-danger-tile);
    color: var(--auth-error-text);
}

.sub-pill-neutral {
    background: var(--auth-divider);
    color: var(--auth-muted);
}

.sub-users {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sub-bar {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: var(--auth-divider);
    overflow: hidden;
}

.sub-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--auth-bar);
}

.sub-row .sub-bar-fill.sub-hi-warn {
    background: var(--auth-warn-bar);
}

.sub-row .sub-bar-fill.sub-hi-danger {
    background: var(--auth-danger-accent);
}

.sub-contact {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 14px 14px 16px;
    border-radius: 16px;
    background: var(--auth-panel-alt);
}

.sub-avatar {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--auth-icon-tile);
    color: var(--auth-icon-tile-text);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.sub-contact-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sub-contact-label {
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 600;
}

.sub-contact-name {
    color: var(--auth-text);
    font-size: 15px;
    font-weight: 700;
}

.sub-contact-email {
    overflow: hidden;
    color: var(--auth-muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The mockup sets 40px plus a 1px border (content box), so the outer height is 42px. */
.sub-contact-button {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--auth-secondary-border);
    border-radius: 12px;
    background: var(--auth-card);
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.sub-contact-button:hover {
    background: var(--auth-row-hover);
    color: var(--auth-text);
}

.sub-contact-button svg {
    flex: none;
    width: 16px;
    height: 16px;
}

.sub-actions {
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Shared by the subscription warning (A4) and select instance (A5) pages. */

/* The mockup sets 52px (48px on mobile) plus a 1px border (content box), so the outer height is 54px (50px). */
.auth-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    padding: 0 16px;
    border: 1px solid var(--auth-secondary-border);
    border-radius: 12px;
    background: var(--auth-card);
    color: var(--auth-text);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.auth-secondary:hover {
    background: var(--auth-row-hover);
    color: var(--auth-text);
}

.auth-support {
    margin: 0;
    color: var(--auth-muted);
    font-size: 13px;
    text-align: center;
}

.auth-card--wide .auth-support {
    line-height: 1.5;
}

.auth-support a {
    color: var(--auth-link);
    font-weight: 600;
}

.auth-support a:hover {
    color: var(--auth-link-hover);
}

/* Mobile (board A4 mobile): the card fills the screen below the header, and the page has no footer. */

@media (max-width: 599.98px) {
    .auth-page--subscription .auth-main {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .auth-page--subscription .auth-card {
        flex: 1;
        max-width: none;
        gap: 14px;
        padding: 20px 20px 16px;
    }

    .auth-page--subscription .auth-footer {
        display: none;
    }

    .auth-page--subscription .auth-primary--tall {
        height: 48px;
    }

    .sub-heading {
        gap: 12px;
    }

    .sub-tile {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .sub-tile svg {
        width: 20px;
        height: 20px;
    }

    .sub-heading-text {
        gap: 1px;
    }

    .sub-title {
        font-size: 20px;
    }

    .sub-user {
        font-size: 13px;
    }

    .sub-item {
        gap: 14px;
    }

    .sub-item + .sub-item {
        padding-top: 14px;
    }

    .sub-alert {
        gap: 8px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .sub-alert svg {
        width: 16px;
        height: 16px;
        margin-top: 2px;
    }

    .sub-details {
        border-radius: 14px;
    }

    .sub-details-title {
        padding: 9px 14px;
        font-size: 14px;
    }

    .sub-rows {
        font-size: 13px;
    }

    .sub-row {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        padding: 7px 14px;
    }

    .sub-row--status {
        padding: 6px 14px;
    }

    .sub-row:last-child {
        padding: 8px 14px 10px;
    }

    .sub-pill {
        padding: 2px 9px;
    }

    .sub-users {
        gap: 5px;
    }

    .sub-bar {
        height: 5px;
    }

    .sub-contact {
        gap: 12px;
        padding: 10px 10px 10px 12px;
        border-radius: 14px;
    }

    .sub-avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .sub-contact-text {
        gap: 0;
    }

    .sub-contact-label {
        font-size: 11px;
    }

    .sub-contact-name {
        font-size: 14px;
    }

    .sub-contact-email {
        font-size: 12px;
    }

    /* Icon only. The accessible name comes from aria-label ("Email {name}"). */
    .sub-contact-button {
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
    }

    .sub-contact-button span {
        display: none;
    }

    .sub-contact-button svg {
        width: 18px;
        height: 18px;
    }

    .auth-page--subscription .auth-secondary {
        flex: none;
        height: 50px;
    }

    .auth-page--subscription .auth-support {
        font-size: 12px;
        line-height: normal;
    }
}

/* Error alert with an icon (boards A5 and A8). Pages/Shared/_AuthAlert.cshtml renders the page errors with it. */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--auth-danger-border);
    border-radius: 12px;
    background: var(--auth-danger-bg);
    color: var(--auth-danger-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.auth-alert svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

/* Select instance page (board A5). */

.auth-card--instances {
    max-width: 460px;
    gap: 22px;
}

.inst-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    overflow: hidden;
}

.inst-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--auth-divider);
    background: var(--auth-card);
    color: var(--auth-text);
    text-decoration: none;
}

.inst-row:last-child {
    border-bottom: 0;
}

.inst-row:hover {
    background: var(--auth-row-hover);
    color: var(--auth-text);
}

/* Rows sit inside a list with overflow: hidden, so their focus style is drawn inside. */
.inst-row:focus-visible {
    outline-offset: -2px;
    box-shadow: inset 0 0 0 4px var(--auth-focus-ring);
}

.inst-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.inst-company {
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.inst-code {
    overflow: hidden;
    color: var(--auth-muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inst-empty {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Logged out (A6), address not found (A7) and external login error (A8) pages. */

.auth-card--status {
    max-width: 460px;
    padding: 44px 36px 32px;
}

.auth-card--status .auth-heading {
    gap: 14px;
}

/* Board A6: the whole card is centered. */
.auth-card--centered {
    max-width: 440px;
    align-items: center;
    padding-bottom: 36px;
    text-align: center;
}

.auth-status-tile {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--auth-icon-tile);
    color: var(--auth-icon-tile-text);
}

.auth-status-tile svg {
    width: 28px;
    height: 28px;
}

.auth-status-tile--warn {
    background: var(--auth-warn-tile);
    color: var(--auth-warn-accent);
}

.auth-status-tile--error {
    background: var(--auth-danger-tile);
    color: var(--auth-error-tile-text);
}

.auth-title--status {
    font-size: 26px;
    line-height: 1.25;
}

.auth-status-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-status-message {
    margin: 0;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.5;
}

.auth-causes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--auth-panel-alt);
}

.auth-causes-title {
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-causes ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    color: var(--auth-text);
    font-size: 14px;
    line-height: 1.45;
    list-style: none;
}

.auth-causes li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.auth-causes li svg {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    color: var(--auth-warn-accent);
}

/* Error page (board A9): error code, description and request ID. */

.err-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Board A9 keeps a 10px icon gap on mobile too (the mobile .auth-alert rule uses 8px for A5 and A8). */
.err-details .auth-alert {
    gap: 10px;
}

.err-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.err-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.err-description {
    font-weight: 500;
}

.err-request {
    margin: 0;
    color: var(--auth-muted);
    font-size: 13px;
    text-align: center;
}

.err-request code {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--auth-chip);
    color: var(--auth-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
}

/* The hidden sign-out iframe still loads, so the other clients sign out too. */
.auth-signout-frame {
    position: absolute;
    width: 0;
    height: 0;
    border: 0;
    visibility: hidden;
}

/* Short desktop screens (spec 7.4) for the pages above. */

@media (min-width: 600px) and (max-height: 759.98px) {
    .auth-card--instances,
    .auth-card--status {
        padding: 28px 36px 24px;
    }
}

/* Mobile (boards A5–A8 mobile). These rules repeat some values of the first mobile block,
   because the desktop rules for these cards come later in the file. */

@media (max-width: 599.98px) {
    .auth-alert {
        gap: 8px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .auth-alert svg {
        width: 16px;
        height: 16px;
        margin-top: 2px;
    }

    .auth-secondary {
        height: 50px;
    }

    .auth-card--instances {
        max-width: none;
        gap: 16px;
    }

    .auth-card--instances .auth-heading {
        align-items: flex-start;
        gap: 10px;
        text-align: left;
    }

    .auth-card--instances .auth-chip {
        align-self: flex-start;
        padding: 5px 5px 5px 12px;
    }

    .auth-card--instances .auth-chip-email {
        font-size: 13px;
    }

    .auth-card--instances .auth-chip-button {
        font-size: 12px;
    }

    .inst-row {
        gap: 12px;
        min-height: 62px;
        padding: 10px 14px;
    }

    .inst-text {
        gap: 1px;
    }

    .inst-code {
        font-size: 12px;
    }

    .inst-empty {
        gap: 12px;
    }

    .auth-page--instances .auth-footer {
        padding: 16px 20px 20px;
    }

    .auth-card--status {
        max-width: none;
        gap: 20px;
        padding: 36px 20px 0;
    }

    .auth-card--status .auth-heading {
        gap: 12px;
    }

    .auth-card--centered {
        padding-top: 48px;
    }

    .auth-status-tile {
        width: 60px;
        height: 60px;
    }

    .auth-status-tile svg {
        width: 26px;
        height: 26px;
    }

    .auth-title--status {
        font-size: 22px;
    }

    .auth-status-text {
        gap: 6px;
    }

    .auth-causes {
        padding: 14px 16px;
        border-radius: 14px;
    }

    .auth-causes-title {
        font-size: 11px;
    }
}
