:root {
    --auth-primary: #1e3a8a;
    --auth-primary-dark: #172554;
    --auth-primary-soft: #eef2ff;
    --auth-ink: #0f172a;
    --auth-muted: #576375;
    --auth-canvas: #f8fafc;
    --auth-surface: #ffffff;
    --auth-border: #e2e8f0;
    --auth-success: #15803d;
    --auth-success-soft: #f0fdf4;
    --auth-danger: #b91c1c;
    --auth-danger-soft: #fef2f2;
    --auth-radius: 12px;
    --auth-radius-sm: 8px;
    --auth-ring: 0 0 0 4px rgba(30, 58, 138, 0.28);
    --auth-shadow: 0 30px 80px -42px rgba(15, 23, 42, 0.48);
}

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

html,
body {
    min-height: 100%;
}

body.auth-body {
    margin: 0;
    overflow-x: hidden;
    background: var(--auth-canvas);
    color: var(--auth-ink);
    font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    font-variant-numeric: tabular-nums lining-nums;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

.auth-page {
    display: grid;
    min-height: 100dvh;
    grid-template-columns: minmax(390px, 0.88fr) minmax(540px, 1.12fr);
}

/* Product story */
.auth-story {
    position: relative;
    display: flex;
    min-height: calc(100dvh - 28px);
    margin: 14px;
    padding: clamp(30px, 4vw, 64px);
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    background: var(--auth-ink);
    color: #fff;
}

.auth-story::before {
    position: absolute;
    right: -180px;
    bottom: -150px;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 44% 56% 63% 37%;
    box-shadow:
        0 0 0 42px rgba(255, 255, 255, 0.018),
        0 0 0 84px rgba(255, 255, 255, 0.014);
    content: "";
    transform: rotate(22deg);
}

.auth-story::after {
    position: absolute;
    top: 24%;
    right: 8%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fde68a;
    box-shadow:
        -92px -72px 0 2px rgba(253, 230, 138, 0.24),
        54px 118px 0 1px rgba(255, 255, 255, 0.24),
        -150px 196px 0 0 rgba(255, 255, 255, 0.18);
    content: "";
}

.auth-story-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 11px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.015em;
    text-decoration: none;
}

.auth-story-brand:hover {
    color: #fff;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.auth-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
}

.auth-story-content {
    position: relative;
    z-index: 1;
    width: min(100%, 550px);
    margin: auto 0;
    padding: 56px 0;
}

.auth-story-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    color: #fde68a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-story-eyebrow::before {
    width: 22px;
    height: 1px;
    background: currentColor;
    content: "";
}

.auth-story h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(38px, 4.4vw, 66px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.06;
}

.auth-story-content > p {
    max-width: 510px;
    margin: 26px 0 0;
    color: rgba(255, 255, 255, 0.67);
    font-size: clamp(14px, 1.3vw, 17px);
    line-height: 1.75;
}

.auth-benefits {
    display: grid;
    gap: 12px;
    margin-top: 36px;
}

.auth-benefit {
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgba(255, 255, 255, 0.83);
    font-size: 14px;
    font-weight: 600;
}

.auth-benefit i {
    display: inline-flex;
    width: 25px;
    height: 25px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(253, 230, 138, 0.25);
    border-radius: 50%;
    background: rgba(253, 230, 138, 0.1);
    color: #fde68a;
    font-size: 14px;
}

.auth-story-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 12px;
    font-weight: 600;
}

.auth-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fde68a;
    box-shadow: 0 0 0 4px rgba(253, 230, 138, 0.1);
}

/* Form panel */
.auth-panel {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
}

.auth-card-wrap {
    width: 100%;
    max-width: var(--card-width, 460px);
    animation: authEnter 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes authEnter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
    color: var(--auth-ink);
    text-decoration: none;
}

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

.auth-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 13px;
    background: var(--auth-ink);
    color: #fff;
    font-size: 18px;
}

.auth-wordmark,
.auth-tagline {
    display: block;
}

.auth-wordmark {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
}

.auth-tagline {
    margin-top: 2px;
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 600;
}

.auth-card {
    position: relative;
    padding: 34px;
    border: 1px solid var(--auth-border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--auth-shadow), inset 0 1px rgba(255, 255, 255, 0.8);
}

.auth-context-icon {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    border-radius: 13px;
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
    font-size: 18px;
}

.auth-title {
    margin: 0 0 7px;
    color: var(--auth-ink);
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
}

.auth-subtitle,
.auth-info {
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.65;
}

.auth-subtitle {
    margin: 0 0 26px;
}

.auth-info {
    margin: 0 0 24px;
    text-align: center;
}

.auth-info .highlight {
    color: var(--auth-primary-dark);
    font-weight: 700;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 7px;
    color: #38443b;
    font-size: 14px;
    font-weight: 700;
}

.form-label .req {
    margin-left: 2px;
    color: var(--auth-danger);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 2;
    color: #929b92;
    font-size: 15px;
    pointer-events: none;
    transform: translateY(-50%);
    transition: color 160ms ease;
}

.input-wrapper:focus-within .input-icon {
    color: var(--auth-primary);
}

.has-icon .form-control {
    padding-left: 42px;
}

.has-icon .form-control:has(+ .input-toggle),
.has-icon .form-control:has(~ .input-toggle) {
    padding-right: 44px;
}

.input-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #89938a;
    cursor: pointer;
    transform: translateY(-50%);
}

.input-toggle:hover {
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
}

.form-control,
.form-select {
    width: 100%;
    min-height: 45px;
    padding: 11px 13px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    background: #fff;
    color: var(--auth-ink);
    font-size: 15px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-control::placeholder {
    color: #a1aaa2;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--auth-primary);
    outline: 0;
    background: #ffffff;
    box-shadow: var(--auth-ring);
}

.form-control-lg {
    min-height: 49px;
    padding: 13px 14px;
    font-size: 14px;
}

textarea.form-control {
    min-height: 76px;
    resize: vertical;
}

.input-group-text {
    border-color: var(--auth-border);
    background: #f1f5f9;
    color: var(--auth-muted);
    font-size: 14px;
}

.field-validation-error {
    display: block;
    margin-top: 5px;
    color: var(--auth-danger);
    font-size: 12px;
    font-weight: 600;
}

.field-validation-valid,
.validation-summary-valid {
    display: none;
}

/* Actions */
.btn-auth,
.btn-outline {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--auth-radius-sm);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.btn-auth {
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--auth-primary);
    background: var(--auth-primary);
    color: #fff;
    box-shadow: 0 12px 24px -17px rgba(30, 58, 138, 0.95);
}

.btn-auth:hover {
    transform: translateY(-1px);
    border-color: var(--auth-primary-dark);
    background: var(--auth-primary-dark);
    color: #fff;
    box-shadow: 0 16px 30px -18px rgba(30, 58, 138, 0.95);
}

.btn-auth:active,
.btn-outline:active {
    transform: translateY(0);
}

.btn-auth:focus-visible,
.btn-outline:focus-visible,
.btn-link:focus-visible,
.link-muted:focus-visible {
    outline: 3px solid rgba(30, 58, 138, 0.2);
    outline-offset: 2px;
}

.btn-auth:disabled {
    transform: none;
    opacity: 0.65;
    cursor: wait;
    box-shadow: none;
}

.btn-outline {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--auth-border);
    background: #fff;
    color: var(--auth-primary-dark);
}

.btn-outline:hover {
    border-color: #bec8ec;
    background: var(--auth-primary-soft);
    color: var(--auth-primary-dark);
}

.btn-link,
.link-muted {
    border: 0;
    background: transparent;
    color: var(--auth-primary-dark);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

.btn-link:hover,
.link-muted:hover {
    color: var(--auth-primary);
    text-decoration: underline;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

/* Messages */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 18px;
    padding: 11px 13px;
    border-radius: var(--auth-radius-sm);
    font-size: 13px;
    line-height: 1.55;
}

.alert i {
    margin-top: 1px;
    flex-shrink: 0;
    font-size: 14px;
}

.alert-danger {
    border: 1px solid #fecaca;
    background: var(--auth-danger-soft);
    color: #8f3038;
}

.alert-success {
    border: 1px solid #bbf7d0;
    background: var(--auth-success-soft);
    color: #116450;
}

.alert-info {
    border: 1px solid #c7d2fe;
    background: var(--auth-primary-soft);
    color: var(--auth-primary-dark);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 21px 0;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    flex: 1;
    background: var(--auth-border);
    content: "";
}

.new-client-link {
    margin: 18px 0 0;
    color: var(--auth-muted);
    font-size: 11.5px;
    text-align: center;
}

.new-client-link a {
    color: var(--auth-primary-dark);
    font-weight: 800;
    text-decoration: none;
}

.new-client-link a:hover {
    color: var(--auth-primary);
    text-decoration: underline;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 18px;
    color: #7c867d;
    font-size: 9.5px;
    line-height: 1.5;
    text-align: center;
}

.auth-footer a {
    color: #566158;
    font-weight: 700;
    text-decoration: none;
}

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

/* Verification and password tools */
.otp-boxes {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.otp-box {
    width: 46px;
    height: 52px;
    padding: 0;
    border: 1px solid var(--auth-border);
    border-radius: 11px;
    background: #fff;
    color: var(--auth-ink);
    font-size: 19px;
    font-weight: 800;
    text-align: center;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.otp-box:focus {
    transform: translateY(-2px);
    border-color: var(--auth-primary);
    outline: 0;
    box-shadow: var(--auth-ring);
}

.otp-box.filled {
    border-color: #bfc9ee;
    background: var(--auth-primary-soft);
    color: var(--auth-primary-dark);
}

.resend-row {
    margin-top: 14px;
    color: var(--auth-muted);
    font-size: 10.5px;
    text-align: center;
}

.resend-row button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--auth-primary-dark);
    font-size: inherit;
    font-weight: 800;
    cursor: pointer;
}

.resend-row button:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.strength-track {
    height: 5px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--auth-border);
}

.strength-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width 200ms ease, background 200ms ease;
}

.strength-label {
    margin-top: 5px;
    color: var(--auth-muted);
    font-size: 10px;
}

.pw-rules {
    display: grid;
    gap: 4px;
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
}

.pw-rules li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-muted);
    font-size: 10px;
}

.pw-rules li i {
    color: #bbc3bb;
    font-size: 11px;
}

.pw-rules li.met,
.pw-rules li.met i {
    color: var(--auth-success);
}

/* Onboarding and terms */
.section-header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 20px 0 13px;
}

.section-header .step {
    display: flex;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--auth-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.section-header h5 {
    margin: 0;
    color: var(--auth-ink);
    font-size: 13px;
    font-weight: 800;
}

.section-header .step-line {
    height: 1px;
    flex: 1;
    background: var(--auth-border);
}

.info-panel {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 17px;
    padding: 13px 14px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    background: #f8fafc;
}

.info-panel i {
    flex-shrink: 0;
    color: var(--auth-primary);
    font-size: 18px;
}

.info-panel h6 {
    margin: 0 0 3px;
    color: var(--auth-ink);
    font-size: 11.5px;
    font-weight: 800;
}

.info-panel p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 10.5px;
    line-height: 1.55;
}

.welcome-notice {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #bbf7d0;
    border-radius: var(--auth-radius-sm);
    background: var(--auth-success-soft);
    text-align: center;
}

.welcome-notice h3 {
    margin: 0 0 5px;
    color: var(--auth-ink);
    font-size: 13px;
    font-weight: 800;
}

.welcome-notice p {
    margin: 0 0 9px;
    color: #38665a;
    font-size: 10.5px;
    line-height: 1.55;
}

.welcome-notice .actions {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 7px;
}

.terms-body {
    max-height: 48vh;
    padding: 4px 12px 4px 0;
    overflow-y: auto;
    color: #465047;
    font-size: 11px;
    line-height: 1.7;
    scrollbar-color: #c8cec8 transparent;
    scrollbar-width: thin;
}

.terms-body h4 {
    margin: 17px 0 5px;
    color: var(--auth-ink);
    font-size: 12px;
    font-weight: 800;
}

.terms-body h4:first-child {
    margin-top: 0;
}

.terms-body ul {
    padding-left: 18px;
}

.terms-body li {
    margin: 3px 0;
}

.terms-body em {
    color: var(--auth-primary-dark);
}

.onboard-progress {
    margin-bottom: 18px;
}

.onboard-progress-bar {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--auth-border);
}

.onboard-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--auth-primary);
    transition: width 250ms ease;
}

.onboard-progress-label {
    margin-top: 6px;
    color: var(--auth-muted);
    font-size: 9.5px;
    font-weight: 700;
    text-align: center;
}

.onboard-step[hidden] {
    display: none;
}

.onboard-step-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--auth-ink);
    font-size: 12px;
    font-weight: 800;
}

.onboard-step-title i {
    color: var(--auth-primary);
    font-size: 14px;
}

.onboard-switch {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #475569;
    font-size: 11px;
    cursor: pointer;
}

.onboard-switch input {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-primary);
}

.onboard-nav {
    display: flex;
    gap: 9px;
    margin-top: 19px;
}

.onboard-nav .btn-outline {
    width: auto;
    flex: 0 0 auto;
    padding-right: 18px;
    padding-left: 18px;
}

.onboard-nav .btn-auth {
    flex: 1;
}

.onboard-nav [hidden] {
    display: none !important;
}

@media (max-width: 1199.98px) {
    .auth-page {
        grid-template-columns: minmax(360px, 0.78fr) minmax(500px, 1.22fr);
    }

    .auth-story {
        padding: 40px;
    }

    .auth-story h1 {
        font-size: clamp(36px, 4vw, 50px);
    }
}

@media (max-width: 991.98px) {
    .auth-page {
        display: block;
    }

    .auth-story {
        display: none;
    }

    .auth-panel {
        min-height: 100dvh;
        padding: 42px 22px;
        background:
            radial-gradient(circle at 100% 0, rgba(30, 58, 138, 0.09), transparent 22rem),
            radial-gradient(circle at 0 100%, rgba(253, 230, 138, 0.12), transparent 20rem),
            var(--auth-canvas);
    }

    .auth-brand {
        display: inline-flex;
    }
}

@media (max-width: 575.98px) {
    .auth-panel {
        align-items: flex-start;
        padding: 26px 14px;
    }

    .auth-brand {
        margin: 0 4px 20px;
    }

    .auth-card {
        padding: 25px 20px;
        border-radius: 18px;
    }

    .auth-context-icon {
        width: 39px;
        height: 39px;
        margin-bottom: 15px;
        font-size: 16px;
    }

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

    .auth-footer {
        flex-wrap: wrap;
        padding: 0 10px;
    }
}

@media (max-width: 419.98px) {
    .otp-boxes {
        gap: 6px;
    }

    .otp-box {
        width: 40px;
        height: 48px;
        font-size: 17px;
    }

    .auth-footer-separator {
        display: none;
    }

    .auth-footer span,
    .auth-footer a {
        flex-basis: 100%;
    }
}

@media (max-width: 339.98px) {
    .auth-card {
        padding-right: 16px;
        padding-left: 16px;
    }

    .otp-boxes {
        gap: 4px;
    }

    .otp-box {
        width: 36px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------------------------------------------------------------------------------------------------------
   Onboarding: the four-stage path on the sign-up form, and the SACCO's application tracker.
   Same rules as app.css (.stepper, .status-pill, .kv); the auth layout does not load app.css.
   --------------------------------------------------------------------------------------------------------- */
.onboard-path { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; }
.onboard-path li { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--auth-muted); font-size: 0.8125rem; font-weight: 600; text-align: center; }
.onboard-path span { display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--auth-border); border-radius: 50%; background: var(--auth-surface); font-size: 0.8125rem; }
.onboard-path li.is-current { color: var(--auth-ink); }
.onboard-path li.is-current span { border-color: var(--auth-primary); background: var(--auth-primary); color: var(--auth-surface); }
.onboard-step-title { margin: 0 0 14px; font-size: 1rem; font-weight: 600; }
.info-panel h3 { margin: 0 0 4px; font-size: 0.9375rem; font-weight: 600; }
.auth-meta { margin: 18px 0 0; color: var(--auth-muted); font-size: 0.875rem; }
.app-kicker { margin: 0 0 2px; color: var(--auth-muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.btn-compact { width: auto; min-height: 40px; margin-top: 8px; padding: 8px 16px; }

.stepper { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: step; }
.stepper > li { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 0 14px; padding-bottom: 24px; counter-increment: step; }
.stepper > li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--auth-border); border-radius: 50%; background: var(--auth-surface); color: var(--auth-muted); font-size: 0.875rem; font-weight: 700; }
.stepper > li::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px; background: var(--auth-border); }
.stepper > li:last-child { padding-bottom: 0; }
.stepper > li:last-child::after { display: none; }
.stepper > li.is-done::before { content: "\2713"; border-color: var(--auth-success); background: var(--auth-success); color: var(--auth-surface); }
.stepper > li.is-current::before { border-color: var(--auth-primary); background: var(--auth-primary); color: var(--auth-surface); box-shadow: 0 0 0 4px var(--auth-primary-soft); }
.stepper > li.is-blocked::before { content: "!"; border-color: var(--auth-danger); background: var(--auth-danger-soft); color: var(--auth-danger); }
.stepper-title { margin: 4px 0 2px; color: var(--auth-ink); font-weight: 600; }
.stepper > li.is-todo .stepper-title { color: var(--auth-muted); }
.stepper-body { color: var(--auth-muted); font-size: 0.9375rem; }
.stepper-body p { margin-bottom: 8px; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--auth-canvas); color: var(--auth-muted); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill.is-ok { background: var(--auth-success-soft); color: var(--auth-success); }
.status-pill.is-info { background: var(--auth-primary-soft); color: var(--auth-primary); }

.paper-list { display: grid; gap: 10px; margin: 12px 0; }
.paper { padding: 14px; border: 1px solid var(--auth-border); border-radius: var(--auth-radius-sm); background: var(--auth-surface); }
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.paper-name { color: var(--auth-ink); font-weight: 600; }
.paper-hint, .paper-file { color: var(--auth-muted); font-size: 0.8125rem; }
.paper-file { margin-top: 4px; }
.paper-form { margin-top: 10px; }
.send-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--auth-border); }
.fee-preview { margin: 14px 0; padding: 10px 12px; border-radius: var(--auth-radius-sm); background: var(--auth-primary-soft); color: var(--auth-primary); font-weight: 600; font-size: 0.9375rem; }
.fee-box { margin-top: 8px; padding: 16px; border: 1px solid var(--auth-border); border-radius: var(--auth-radius-sm); background: var(--auth-surface); color: var(--auth-ink); }
.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--auth-border); }
.kv dt { color: var(--auth-muted); font-weight: 400; }
.kv dd { font-weight: 600; text-align: right; }
.kv > :nth-last-child(-n + 2) { border-bottom: 0; }

@media (max-width: 575.98px) {
    .onboard-path li { font-size: 0.75rem; }
    .kv { grid-template-columns: 1fr; }
    .kv dt { padding-bottom: 0; border-bottom: 0; }
    .kv dd { text-align: left; }
}

/* --------------------------------------------------------------------------
   Sign-in and account recovery
   -------------------------------------------------------------------------- */
body.auth-page-login .auth-story,
body.auth-page-recover .auth-story,
body.auth-page-sandbox .auth-story {
    background:
        radial-gradient(circle at 12% 4%, rgba(59, 89, 178, 0.32), transparent 29rem),
        linear-gradient(150deg, #0b1224 0%, #111e3d 54%, #0b1224 100%);
}

body.auth-page-login .auth-story::before,
body.auth-page-recover .auth-story::before,
body.auth-page-sandbox .auth-story::before {
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 38px 38px;
    box-shadow: none;
    opacity: 0.7;
    transform: none;
}

body.auth-page-login .auth-story::after,
body.auth-page-recover .auth-story::after,
body.auth-page-sandbox .auth-story::after {
    top: 13%;
    right: 13%;
    width: 172px;
    height: 172px;
    border: 1px solid rgba(253, 230, 138, 0.18);
    border-radius: 50%;
    background: transparent;
    box-shadow:
        0 0 0 34px rgba(253, 230, 138, 0.035),
        0 0 0 70px rgba(255, 255, 255, 0.02);
}

body.auth-page-login .auth-card,
body.auth-page-recover .auth-card,
body.auth-page-sandbox .auth-card {
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
    background: var(--auth-surface);
}

body.auth-page-login .auth-context-icon,
body.auth-page-recover .auth-context-icon,
body.auth-page-sandbox .auth-context-icon {
    display: none;
}

.authx {
    position: relative;
    padding: 32px;
}

.authx::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #fde68a 0%, #1e3a8a 58%, #172554 100%);
    content: "";
}

.authx-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.authx-header-copy {
    min-width: 0;
}

.authx-eyebrow {
    margin: 0 0 8px;
    color: var(--auth-primary);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.authx-title {
    margin: 0 0 7px;
    color: var(--auth-ink);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.authx-lead {
    max-width: 38ch;
    margin: 0;
    color: var(--auth-muted);
    font-size: 13.5px;
    line-height: 1.6;
}

.authx-header-badge {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border: 1px solid #dbe4ff;
    border-radius: 14px;
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
    font-size: 21px;
}

.authx-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 24px 0 22px;
    padding: 0;
    list-style: none;
}

.authx-steps li {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    color: #8a95a6;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.authx-steps li::after {
    height: 1px;
    flex: 1;
    background: var(--auth-border);
    content: "";
}

.authx-steps li:last-child::after {
    display: none;
}

.authx-steps li.is-current {
    color: var(--auth-primary-dark);
}

.authx-steps li.is-current span {
    border-color: var(--auth-primary);
    background: var(--auth-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--auth-primary-soft);
}

.authx-steps span {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    border: 1px solid var(--auth-border);
    border-radius: 50%;
    background: var(--auth-surface);
    color: var(--auth-muted);
    font-size: 10px;
    font-weight: 800;
}

.authx-notice,
.authx-summary {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 18px;
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.5;
}

.authx-notice {
    border: 1px solid #bbf7d0;
    background: var(--auth-success-soft);
    color: #166534;
}

.authx-notice i,
.authx-summary i {
    margin-top: 1px;
    flex-shrink: 0;
}

.authx-summary {
    flex-direction: column;
    gap: 4px;
    border: 1px solid #fecaca;
    background: var(--auth-danger-soft);
    color: #991b1b;
}

.authx-summary strong {
    display: block;
}

.authx-summary ul {
    margin: 0;
    padding-left: 17px;
}

.authx-summary a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.authx-error.field-validation-valid {
    display: none;
}

.authx-form {
    margin: 0;
}

.authx-field {
    margin-bottom: 15px;
}

.authx-label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.authx-input-wrap {
    position: relative;
}

.authx-input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 1;
    color: #8d99ac;
    font-size: 16px;
    pointer-events: none;
    transform: translateY(-50%);
    transition: color 160ms ease;
}

.authx-input-wrap:focus-within .authx-input-icon {
    color: var(--auth-primary);
}

.authx-input {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px 12px 43px;
    border: 1px solid #d7dfeb;
    border-radius: 10px;
    background: #fff;
    color: var(--auth-ink);
    font-size: 14.5px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.authx-input.has-toggle,
.authx-input-wrap.has-toggle .authx-input {
    padding-right: 54px;
}

.authx-input::placeholder {
    color: #a4adbb;
}

.authx-input:hover {
    border-color: #bcc9dd;
}

.authx-input:focus {
    border-color: var(--auth-primary);
    outline: 0;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.16);
}

.authx-input[aria-invalid="true"] {
    border-color: #ef8a8a;
    background: #fffafa;
}

.authx-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12);
}

.authx-toggle {
    position: absolute;
    top: 50%;
    right: 4px;
    z-index: 2;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #7e8a9c;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 160ms ease, color 160ms ease;
}

.authx-toggle:hover,
.authx-toggle[aria-pressed="true"] {
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
}

.authx-error {
    display: block;
    min-height: 16px;
    margin-top: 5px;
    color: var(--auth-danger);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
}

.authx-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    margin: 2px 0 20px;
}

.authx-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #475569;
    font-size: 12.5px;
    cursor: pointer;
    user-select: none;
}

.authx-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.authx-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    color: var(--auth-primary-dark);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
}

.authx-link:hover {
    color: var(--auth-primary);
    text-decoration: underline;
}

.authx-primary {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border: 1px solid var(--auth-primary);
    border-radius: 10px;
    background: linear-gradient(135deg, #1e3a8a, #172554);
    color: #fff;
    box-shadow: 0 16px 28px -20px rgba(30, 58, 138, 0.95);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.authx-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 20px 32px -20px rgba(30, 58, 138, 0.95);
}

.authx-primary:active {
    transform: translateY(0);
}

.authx-primary:disabled {
    transform: none;
    opacity: 0.7;
    cursor: wait;
    box-shadow: none;
}

.authx-btn-label,
.authx-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.authx-btn-label i {
    font-size: 15px;
}

.authx-primary:focus-visible,
.authx-toggle:focus-visible,
.authx-link:focus-visible,
.authx-return-link:focus-visible,
.authx-pill:focus-visible {
    outline: 3px solid rgba(253, 230, 138, 0.9);
    outline-offset: 3px;
}

.authx-footnote,
.authx-next {
    margin-top: 20px;
    padding: 14px 15px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: #f8fafc;
}

.authx-footnote {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #58657a;
    font-size: 12px;
    line-height: 1.55;
}

.authx-footnote i {
    color: var(--auth-primary);
    font-size: 15px;
}

.authx-next-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--auth-ink);
    font-size: 12.5px;
    font-weight: 800;
}

.authx-next-title i {
    color: var(--auth-primary);
    font-size: 15px;
}

.authx-next-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.authx-next-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #58657a;
    font-size: 12px;
    line-height: 1.5;
}

.authx-next-list span {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    place-items: center;
    border-radius: 50%;
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
    font-size: 10px;
    font-weight: 800;
}

.authx-next-expiry {
    margin: 11px 0 0;
    color: #7a8699;
    font-size: 11px;
}

.authx-return {
    margin-top: 18px;
    text-align: center;
}

.authx-return-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 12px;
    color: var(--auth-primary-dark);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
}

.authx-return-link:hover {
    color: var(--auth-primary);
    text-decoration: underline;
}

.authx-invite {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 24px -32px -32px;
    padding: 18px 32px;
    border-top: 1px solid var(--auth-border);
    background: #f8fafc;
}

.authx-invite-copy {
    display: grid;
    gap: 2px;
}

.authx-invite-copy strong {
    color: var(--auth-ink);
    font-size: 12.5px;
    font-weight: 800;
}

.authx-invite-copy span {
    color: var(--auth-muted);
    font-size: 11.5px;
}

.authx-invite-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.authx-pill {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    background: var(--auth-primary-soft);
    color: var(--auth-primary-dark);
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
}

.authx-pill:hover {
    border-color: var(--auth-primary);
    background: #e0e7ff;
    text-decoration: none;
}

.authx-pill-quiet {
    border-color: var(--auth-border);
    background: var(--auth-surface);
    color: var(--auth-muted);
}

.authx-pill-quiet:hover {
    border-color: #c7d2fe;
    background: var(--auth-primary-soft);
    color: var(--auth-primary-dark);
}

@media (max-width: 575.98px) {
    .authx {
        padding: 26px 20px;
    }

    .authx-header-badge {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 12px;
        font-size: 18px;
    }

    .authx-title {
        font-size: 22px;
    }

    .authx-steps {
        gap: 5px;
        margin: 20px 0 18px;
    }

    .authx-steps li {
        gap: 5px;
        font-size: 10px;
    }

    .authx-invite {
        margin: 22px -20px -26px;
        padding: 16px 20px;
    }
}

@media (max-width: 359.98px) {
    .authx-steps span {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }

    .authx-form-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* --------------------------------------------------------------------------
   Sandbox: guided demo launch
   -------------------------------------------------------------------------- */
.authx-notice-warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.authx-notice-error {
    border-color: #fecaca;
    background: var(--auth-danger-soft);
    color: #991b1b;
}

.sandbox-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0 24px;
}

.sandbox-feature {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: var(--auth-surface);
}

.sandbox-feature-wide {
    grid-column: 1 / -1;
    background: #f8fafc;
}

.sandbox-feature-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 9px;
    background: var(--auth-primary-soft);
    color: var(--auth-primary);
    font-size: 15px;
}

.sandbox-feature strong {
    display: block;
    color: var(--auth-ink);
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.35;
}

.sandbox-feature-text {
    display: block;
    margin-top: 3px;
    color: var(--auth-muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.sandbox-launch {
    padding-top: 20px;
    border-top: 1px solid var(--auth-border);
}

.sandbox-section-title {
    margin: 0 0 14px;
    color: var(--auth-ink);
    font-size: 14px;
    font-weight: 800;
}

.authx-select-wrap {
    position: relative;
}

.authx-select {
    appearance: none;
    padding-right: 42px;
    cursor: pointer;
}

.authx-select-chevron {
    position: absolute;
    top: 50%;
    right: 15px;
    color: #8d99ac;
    font-size: 13px;
    pointer-events: none;
    transform: translateY(-50%);
    transition: color 160ms ease;
}

.authx-select-wrap:focus-within .authx-select-chevron {
    color: var(--auth-primary);
}

.authx-hint {
    margin: 6px 0 0;
    color: var(--auth-muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.authx-outline {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: var(--auth-surface);
    color: var(--auth-primary-dark);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.authx-outline:hover {
    border-color: var(--auth-primary);
    background: var(--auth-primary-soft);
    color: var(--auth-primary-dark);
    text-decoration: none;
}

.authx-outline:focus-visible,
.sandbox-text-link:focus-visible,
.sandbox-signin a:focus-visible {
    outline: 3px solid rgba(253, 230, 138, 0.9);
    outline-offset: 3px;
}

.sandbox-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    color: #8a95a6;
    font-size: 11px;
    font-weight: 700;
}

.sandbox-divider::before,
.sandbox-divider::after {
    height: 1px;
    flex: 1;
    background: var(--auth-border);
    content: "";
}

.sandbox-secondary {
    display: grid;
    gap: 9px;
    text-align: center;
}

.sandbox-text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--auth-primary-dark);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
}

.sandbox-text-link:hover {
    color: var(--auth-primary);
    text-decoration: underline;
}

.sandbox-text-link i {
    color: #128c7e;
    font-size: 15px;
}

.sandbox-signin {
    margin: 4px 0 0;
    color: var(--auth-muted);
    font-size: 12px;
}

.sandbox-signin a {
    color: var(--auth-primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.sandbox-signin a:hover {
    color: var(--auth-primary);
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .sandbox-features {
        grid-template-columns: 1fr;
    }

    .sandbox-feature-wide {
        grid-column: auto;
    }
}
