:root {
    --brand: #2e3192;
    --brand-dark: #1e205f;
    --brand-light: #f3f3f9;
    --accent: #f40064;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f6f7fb;
    --card: #ffffff;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
}

html, body {
    font-family: 'Aptos', 'Aptos Display', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: 'Aptos Display', 'Aptos', 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
    color: var(--ink);
    letter-spacing: -0.01em;
}

a, .btn-link { color: var(--brand); }
a:hover { color: var(--brand-dark); }

.btn-primary {
    color: #fff;
    background-color: var(--brand);
    border-color: var(--brand);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
}
.btn-outline-primary {
    color: var(--brand);
    border-color: var(--brand);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(46, 49, 146, 0.20);
    border-color: var(--brand);
}

.form-control, .form-select {
    border-color: var(--line);
    border-radius: 8px;
}
.form-label { font-weight: 500; color: #374151; margin-bottom: .25rem; }
.form-text { color: var(--muted); }

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header {
    background: var(--brand-light);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.table {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
}
.table > :not(caption) > * > * { padding: .65rem .75rem; }
.table > thead { background: var(--brand-light); }
.table > thead th { font-weight: 600; border-bottom: 1px solid var(--line); }

.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; border-radius: var(--radius); }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; border-radius: var(--radius); }
.alert-info    { background: var(--brand-light); color: var(--brand-dark); border-color: #bcbddc; border-radius: var(--radius); }

.content { padding-top: 1.1rem; }

h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #b91c1c; font-size: .875rem; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: var(--radius);
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ============================================================
   AUTH SCENE — shared by every signed-out page
   (Login, SignUp, Welcome, resets, payment outcomes)
   Deep RSA blue with drifting pink/yellow glows; the card
   reveals with a soft rise. No markup changes needed per page.
   ============================================================ */

.login-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 28'%3E%3Cpath d='M0 14 Q15 4 30 14 T60 14 T90 14 T120 14 V28 H0 Z' fill='rgba(255,255,255,.06)'/%3E%3C/svg%3E") left bottom / 300px 34px repeat-x,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 28'%3E%3Cpath d='M0 16 Q15 7 30 16 T60 16 T90 16 T120 16 V28 H0 Z' fill='rgba(255,255,255,.04)'/%3E%3C/svg%3E") left bottom / 520px 52px repeat-x,
        radial-gradient(ellipse 70% 55% at 85% 10%, rgba(244, 0, 100, .28) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 10% 95%, rgba(248, 184, 0, .18) 0%, transparent 55%),
        radial-gradient(ellipse 55% 55% at 50% 50%, rgba(21, 22, 66, .7) 0%, transparent 75%),
        linear-gradient(160deg, #151642 0%, #1e205f 40%, #2e3192 75%, #151642 100%);
    padding: 2rem 1rem;
}

/* faint grid, masked to the middle — same trick as the Montego login */
.login-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 62% 62% at 50% 50%, black 15%, transparent 72%);
    mask-image: radial-gradient(ellipse 62% 62% at 50% 50%, black 15%, transparent 72%);
    pointer-events: none;
}

/* drifting glow */
.login-shell::after {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(244, 0, 100, .16);
    filter: blur(90px);
    top: -12%;
    right: -6%;
    animation: rsa-orb 22s ease-in-out infinite;
    pointer-events: none;
    will-change: transform;
}
@keyframes rsa-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(-40px, 30px) scale(1.06); }
    66%      { transform: translate(25px, -20px) scale(.96); }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 20px;
    box-shadow:
        0 30px 60px -18px rgba(10, 2, 30, .55),
        0 0 0 1px rgba(255, 255, 255, .06);
    padding: 2.25rem 2rem;
    animation: rsa-card-reveal .6s cubic-bezier(.16, 1, .3, 1) both;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2e3192 0%, #f40064 60%, #f8b800 100%);
}
@keyframes rsa-card-reveal {
    from { opacity: 0; transform: translateY(22px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* wide variant for the multi-step sign-up */
.login-card--wide { max-width: 860px; }

.login-brand { text-align: center; margin-bottom: 1rem; }
.login-brand img { height: 76px; width: auto; max-width: 100%; }
.login-title {
    text-align: center;
    margin: .25rem 0 0;
    color: #2e3192;
    font-weight: 700;
    letter-spacing: -.02em;
    font-size: 1.6rem;
}
.login-sub {
    text-align: center;
    color: #6f6c81;
    margin-bottom: 1.5rem;
    font-size: .9375rem;
}
.login-foot {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid #f1f0f6;
    font-size: .875rem;
    color: #6f6c81;
}

/* password requirements checklist (Welcome, resets) */
.req-list {
    list-style: none;
    margin: .75rem 0 0;
    padding: .85rem 1rem;
    border-radius: 10px;
    background: #f8f8fb;
    border: 1px solid #e5e3ed;
    display: grid;
    gap: .35rem;
}
.req-list li {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8125rem;
    color: #6f6c81;
}
.req-list li::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid #d3d0de;
    background: #fff;
    transition: background 140ms ease, border-color 140ms ease;
}
.req-list li.met { color: #12855f; }
.req-list li.met::before {
    border-color: #12855f;
    background: #12855f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M12.7 5.3a1 1 0 0 0-1.4-1.4L7 8.2 5.2 6.4a1 1 0 1 0-1.4 1.4l2.5 2.5a1 1 0 0 0 1.4 0l5-5z'/%3E%3C/svg%3E") center/11px no-repeat;
}

/* compact step indicator (sign-up wizard) */
.auth-steps {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.75rem;
}
.auth-steps__step {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8125rem;
    font-weight: 600;
    color: #a3a0b3;
    white-space: nowrap;
}
.auth-steps__dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .75rem;
    font-weight: 700;
    background: #f1f0f6;
    color: #a3a0b3;
    border: 1.5px solid #e5e3ed;
    transition: all 200ms ease;
}
.auth-steps__step--active { color: #2e3192; }
.auth-steps__step--active .auth-steps__dot {
    background: #2e3192;
    border-color: #2e3192;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(46, 49, 146, .15);
}
.auth-steps__step--done { color: #12855f; }
.auth-steps__step--done .auth-steps__dot {
    background: #12855f;
    border-color: #12855f;
    color: #fff;
}
.auth-steps__bar {
    flex: 1;
    height: 2px;
    min-width: 18px;
    background: #e5e3ed;
    border-radius: 2px;
}
.auth-steps__bar--done { background: #12855f; }

@media (max-width: 560px) {
    .auth-steps__step span:last-child { display: none; }
    .auth-steps__step--active span:last-child { display: inline; }
    .login-card { padding: 1.75rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    .login-shell::after { animation: none; }
    .login-card { animation-duration: .001ms; }
}

/* Blazor reconnect modal */
#components-reconnect-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}
#components-reconnect-modal.components-reconnect-hidden {
    display: none;
}
.components-reconnect-inner {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    max-width: 320px;
    width: 90%;
}
.components-reconnect-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0ef;
    border-top-color: #2e3192;
    border-radius: 50%;
    animation: components-reconnect-spin 1s linear infinite;
    margin: 0 auto .75rem;
}
.components-reconnect-text strong { color: #2e3192; }
#components-reconnect-modal.components-reconnect-failed .components-reconnect-spinner,
#components-reconnect-modal.components-reconnect-rejected .components-reconnect-spinner {
    border-top-color: #b91c1c;
}
@keyframes components-reconnect-spin {
    to { transform: rotate(360deg); }
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.darker-border-checkbox.form-check-input { border-color: #929292; }

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--muted);
    text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder { text-align: start; }
