body {
    background-color: light-dark(color-mix(in srgb, var(--rev-oat) 30%, transparent),
            var(--bg-body));
}

.loginCard>*+* {
    margin-top: 1.5rem;
}

.auth-page__content>h3 {
    margin-bottom: 0.375rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: light-dark(var(--rev-denim), var(--rev-dawn));
}

.auth-page__content>p {
    color: light-dark(color-mix(in srgb, var(--on-surface) 70%, transparent), color-mix(in srgb, var(--on-surface) 60%, transparent)) !important;
}

.orBlock {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
}

.orBlock::before,
.orBlock::after {
    content: "";
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.1;
}

.spinner-2 {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background-color: hsl(0deg 0% 0% / 70%);
    z-index: 9991;
}

.spinner-2 span {
    width: 50px;
    display: block;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 8px solid #030d12;
    border-right-color: #07bafe;
    animation: s2 1s infinite linear;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -30px 0 0 -30px;
}


@keyframes s2 {
    to {
        transform: rotate(1turn);
    }
}

/* two-step indicator on the onboarding card: numbered dots joined by a line.
   The page script only adds .active-step to #tfa_setup once the password is saved, so the first step is shown
   as done (✓, green) via :has() at that point; no script change needed. */
.onboard-steps {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* space from the header above, and a hairline + space separating it from the form below */
    margin-top: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rev-border);
    counter-reset: onboard-step;
    font-size: 0.875rem;
}

.onboard-steps li {
    --dot-bg: color-mix(in srgb, var(--on-surface) 10%, transparent);
    --dot-color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    counter-increment: onboard-step;
    color: var(--muted);
    white-space: nowrap;
}

/* connector line between the two steps */
.onboard-steps li+li::before {
    content: "";
    width: 2.5rem;
    height: 2px;
    border-radius: 2px;
    background: var(--rev-border);
    margin-right: 0.25rem;
}

/* numbered dot */
.onboard-steps__dot {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--dot-bg);
    color: var(--dot-color);
}

.onboard-steps__dot::before {
    content: counter(onboard-step);
}

.onboard-steps li.active-step {
    --dot-bg: var(--rev-h2o);
    --dot-color: var(--white);
    color: var(--text-heading);
    font-weight: 600;
}

/* first step shown as done once the 2FA step is active */
.onboard-steps:has(#tfa_setup.active-step) #account_creation {
    --dot-bg: var(--rev-green-400);
    color: var(--muted);
    font-weight: 500;
}

.onboard-steps:has(#tfa_setup.active-step) #account_creation .onboard-steps__dot::before {
    content: "✓";
}

.onboard-steps:has(#tfa_setup.active-step) li+li::before {
    background: var(--rev-green-400);
}

/* password rules on the onboarding card: a soft panel instead of a bare list */
.password-rules {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--rev-border);
    background-color: light-dark(color-mix(in srgb, var(--on-surface) 3%, transparent),
            color-mix(in srgb, var(--rev-h2o) 8%, var(--surface)));
}

.password-rules__title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.password-rules p+p {
    margin-top: 0.25rem;
}

/* ---------- sign-up plan picker: a form-control trigger opening a floating list of plan cards ----------
   theme tokens only, so it matches the login fields in both light and dark */
/* each plan is a plain row (no box); rows are split by a hairline */
.subscription-card {
    padding: 1rem 0.25rem;
}

.subscription-card:first-child {
    padding-top: 0.25rem;
}

.subscription-card:last-child {
    padding-bottom: 0.25rem;
}

.subscription-card+.subscription-card {
    border-top: 1px solid var(--rev-border);
}

.subscription-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.subscription-card h6 {
    font-weight: 600;
}

/* "Save 16% yearly": computed from the plan's own prices, shown only when yearly is cheaper */
.subscription-save {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2em 0.6em;
    border-radius: 1000em;
    color: light-dark(var(--rev-green-400), oklch(from var(--rev-green-400) 0.82 c h));
    background-color: var(--rev-green-100);
}

/* monthly / yearly: two separate soft-blue tiles (a shared grey track read as one card);
   --plan-blue is h2o lifted in OKLCH (as .bg-neutral-secondary does) so the tint isn't greyish */
.subscription-price {
    --plan-blue: oklch(from var(--rev-h2o) calc(l + 0.08) calc(c * 1.35) h);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
}

.subscription-price label {
    position: relative;
    display: grid;
    gap: 0.1rem;
    margin: 0;
    padding: 0.625rem 0.875rem;
    border-radius: 0.625rem;
    cursor: pointer;
    background-color: light-dark(color-mix(in srgb, var(--plan-blue) 7%, var(--surface)),
            color-mix(in srgb, var(--rev-h2o) 10%, var(--surface)));
    transition:
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}

.subscription-price label:hover {
    background-color: light-dark(color-mix(in srgb, var(--plan-blue) 12%, var(--surface)),
            color-mix(in srgb, var(--rev-h2o) 16%, var(--surface)));
}

/* picked tile: clearly blue, with a blue ring */
.subscription-price label:has(input:checked) {
    background-color: light-dark(color-mix(in srgb, var(--plan-blue) 16%, var(--surface)),
            color-mix(in srgb, var(--rev-h2o) 26%, var(--surface)));
    box-shadow: inset 0 0 0 1.5px light-dark(color-mix(in srgb, var(--plan-blue) 80%, var(--surface)),
            var(--rev-h2o));
}

.subscription-price label:has(input:focus-visible) {
    outline: 2px solid color-mix(in srgb, var(--rev-h2o) 60%, transparent);
    outline-offset: 2px;
}

/* the real radio stays in the form and keyboard order, just not drawn */
.subscription-price input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.subscription-price__period {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.subscription-price label:has(input:checked) .subscription-price__period {
    color: light-dark(var(--rev-h2o), oklch(from var(--rev-h2o) 0.82 c h));
}

.subscription-price strong {
    font-size: 1.125rem;
    line-height: 1.2;
    color: var(--on-surface);
    font-variant-numeric: tabular-nums;
}

.subscription-price small {
    font-size: 0.75rem;
    color: var(--muted);
}

/* trigger: a normal form-control with the theme's select arrow (--select-arrow follows light/dark) */
.custom-dropdown .form-control {
    display: flex;
    align-items: center;
    padding-right: 2.75rem;
    cursor: pointer;
    background: var(--control-bg) var(--select-arrow) no-repeat right 0.75rem center / 20px;
}

.subscription-grid {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--rev-border);
    display: none;
    z-index: 1000;
    padding: 1rem 1.25rem;
    box-shadow: 0 12px 40px color-mix(in srgb, var(--dark) 14%, transparent);
    border-radius: 1rem;
    overflow: auto;
}

/* bottom */
.subscription-grid.bottom {
    top: 100%;
}

/* top */
.subscription-grid.top {
    bottom: 100%;
}

.otp-input {
    display: flex;
    gap: 1rem;
}

.otp-input input {
    width: 50px;
    aspect-ratio: 1/1;
    height: auto;
    text-align: center;
}

/* ---------- payment success / failed pages ---------- */
/* status badge: soft tinted ring with the icon in the status colour (theme tokens, lifted in dark) */
.payment-status {
    --status-color: var(--rev-green-400);
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-inline: auto;
    border-radius: 50%;
    /* solid status fill with a white mark, plus a soft halo; a tinted fill read dim on the dark page */
    color: var(--white);
    background-color: var(--status-color);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--status-color) 18%, transparent);
}

.payment-status--failed {
    --status-color: var(--rev-red);
}

/* amount / transaction / date: label-value rows on a soft panel, hairlines between rows */
.payment-summary {
    padding: 0.25rem 1rem;
    border-radius: 0.75rem;
    text-align: left;
    /* dark: the app cards' soft h2o 8% tint (12% read too blue) with a quiet light edge */
    background-color: light-dark(color-mix(in srgb, var(--on-surface) 4%, transparent),
            color-mix(in srgb, var(--rev-h2o) 8%, var(--surface)));
    border: 1px solid light-dark(var(--rev-border),
            color-mix(in srgb, var(--on-surface) 14%, transparent));
}

.payment-summary>div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.75rem 0;
}

.payment-summary>div+div {
    border-top: 1px solid var(--rev-border);
}

/* labels a step brighter and medium weight; values in the heading colour (brightest in dark) */
.payment-summary dt {
    font-weight: 500;
    font-size: 0.875rem;
    color: color-mix(in srgb, var(--on-surface) 85%, transparent);
    flex-shrink: 0;
}

/* "Payment made through Stripe" line */
.payment-note {
    font-size: 0.875rem;
    font-weight: 500;
    color: color-mix(in srgb, var(--on-surface) 90%, transparent);
}


.payment-summary dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
    color: var(--text-heading);
    min-width: 0;
}

/* long Stripe session id: its own full-width row, label above, small monospace, so it wraps cleanly */
.payment-summary>.payment-summary__stacked {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
}

.payment-summary__stacked dd {
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.5;
    word-break: break-all;
    color: var(--text-heading);
}

.payment-summary__amount {
    font-size: 1.25rem;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;
}

.toast {
    opacity: 1 !important;
}

/* ---------- auth shell (layouts/auth): denim brand panel + form area, login handoff v1.1 ----------
   Both columns are 100dvh; when the viewport is too short only the form area scrolls. */
.auth-shell {
    --auth-brand-width: 600px;
    display: grid;
    grid-template-columns: var(--auth-brand-width) minmax(0, 1fr);
    height: 100dvh;
}


/* brand panel is denim in both themes; the light focus ring is denim too, so use mist (as dark mode does) for the logo link */
.auth-brand {
    --focus-ring: var(--rev-mist);
}

.auth-brand__content h1 {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--rev-dawn);
}

.auth-brand__content p {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.45;
}

.auth-main {
    --surface: light-dark(var(--rev-dawn), var(--rev-plate));
    --on-surface: light-dark(var(--rev-plate), var(--rev-dawn));
    /* button fill and links (via --primary on .auth-main__container); the focus ring is the global --focus-ring */
    --auth-accent: light-dark(var(--rev-denim), var(--rev-h2o-lifted));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    overflow-y: auto;
    background-color: var(--surface);
    color: var(--on-surface);
}

.auth-main__theme {
    order: -1;
    align-self: flex-end;
}

.auth-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

/* handoff 6: footer links stay muted at rest (the global text-link colour shows on hover / focus) */
.auth-footer a {
    color: inherit;
}

/* invisible reCAPTCHA: the footer carries the required attribution instead of the badge */
.grecaptcha-badge {
    visibility: hidden;
}

@media (max-width: 1279.98px) {
    .auth-shell {
        --auth-brand-width: 400px;
    }
}


.auth-main__container {
    --primary: var(--auth-accent);
    width: 100%;
    max-width: 480px;
    margin-inline: auto;
    --control-padding-y: 0.6875rem;
    --control-padding-x: 0.875rem;
    --control-height: 3rem;
    --control-bg: light-dark(var(--rev-white), color-mix(in srgb, var(--rev-mist) 8%, var(--rev-plate)));
    --control-border: light-dark(var(--rev-linen), color-mix(in srgb, var(--rev-mist) 22%, var(--rev-plate)));
}

/* handoff: dawn text on the denim fill (light), plate text on the mist fill (dark; white on mist is 2.4:1).
   Set on the button itself: .btn-primary defines --btn-text there, so a parent value would not reach it */


.auth-form .form-control[aria-invalid="true"] {
    border-color: var(--danger);
}


/* submitting: label stays, button dims, a small ring shows on the left */
.auth-form .btn-primary .spinner-border {
    display: none;
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.auth-form.is-submitting .btn-primary {
    opacity: 0.75;
}

.auth-form.is-submitting .btn-primary .spinner-border {
    display: inline-block;
}

/* failed login / lockout block under the Log in button */
.auth-alert {
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.auth-alert svg {
    flex-shrink: 0;
}