/* =========================================================
   Nexum Living — Login
   Design tokens, layout & components.
   ========================================================= */

/* ----- 1. Design tokens ---------------------------------- */
:root {
    /* Brand colors */
    --ink: #000000;
    --night: #131B2E;
    --deep-green: #006B5F;
    --mint: #62FAE3;
    --white: #FFFFFF;
    --bg-light: #F8F9FF;
    --surface: #E6EEFF;
    --error: #BA1A1A;

    /* Derived */
    --night-90: rgba(19, 27, 46, 0.9);
    --night-60: rgba(19, 27, 46, 0.6);
    --night-30: rgba(19, 27, 46, 0.3);
    --ink-80: rgba(0, 0, 0, 0.8);
    --ink-60: rgba(0, 0, 0, 0.6);
    --ink-45: rgba(0, 0, 0, 0.45);
    --ink-12: rgba(0, 0, 0, 0.12);
    --ink-06: rgba(0, 0, 0, 0.06);
    --mint-15: rgba(98, 250, 227, 0.15);
    --mint-30: rgba(98, 250, 227, 0.3);
    --mint-glow: rgba(98, 250, 227, 0.45);
    --white-80: rgba(255, 255, 255, 0.8);
    --white-60: rgba(255, 255, 255, 0.6);
    --white-15: rgba(255, 255, 255, 0.15);
    --white-08: rgba(255, 255, 255, 0.08);

    /* Typography */
    --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Radii */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-2xl: 32px;
    --r-pill: 999px;

    /* Shadows */
    --shadow-card: 0 1px 2px rgba(19, 27, 46, 0.04),
                   0 8px 24px rgba(19, 27, 46, 0.06),
                   0 32px 64px rgba(19, 27, 46, 0.08);
    --shadow-card-hover: 0 1px 2px rgba(19, 27, 46, 0.06),
                         0 12px 32px rgba(19, 27, 46, 0.1),
                         0 40px 80px rgba(19, 27, 46, 0.12);
    --shadow-btn: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-btn-hover: 0 10px 28px rgba(0, 0, 0, 0.35), 0 0 0 4px var(--mint-15);

    /* Transitions */
    --ease: cubic-bezier(0.32, 0.72, 0.24, 1);
    --t-fast: 160ms var(--ease);
    --t-med: 280ms var(--ease);
    --t-slow: 560ms var(--ease);
}

/* ----- 2. Reset / base ---------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--night);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ----- 3. Layout shell ---------------------------------- */
.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--bg-light);
}

/* =========================================================
   4. BRAND PANEL (left)
   ========================================================= */
.brand-panel {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: clamp(32px, 5vw, 72px);
    color: var(--white);
    background:
        radial-gradient(120% 80% at 0% 0%, #1d2a4d 0%, transparent 55%),
        radial-gradient(80% 90% at 100% 100%, #00574e 0%, transparent 50%),
        linear-gradient(135deg, var(--night) 0%, #0c1426 50%, #001f1c 100%);
}

/* Floating orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}
.orb--mint {
    width: 480px;
    height: 480px;
    top: -120px;
    right: -120px;
    background: radial-gradient(circle, var(--mint) 0%, transparent 70%);
    opacity: 0.35;
    animation: float-a 18s var(--ease) infinite alternate;
}
.orb--green {
    width: 520px;
    height: 520px;
    bottom: -160px;
    left: -160px;
    background: radial-gradient(circle, var(--deep-green) 0%, transparent 70%);
    opacity: 0.55;
    animation: float-b 22s var(--ease) infinite alternate;
}
.orb--accent {
    width: 260px;
    height: 260px;
    top: 40%;
    left: 35%;
    background: radial-gradient(circle, var(--mint) 0%, transparent 70%);
    opacity: 0.18;
    animation: float-c 14s var(--ease) infinite alternate;
}
@keyframes float-a {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-40px, 60px) scale(1.1); }
}
@keyframes float-b {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(60px, -40px) scale(1.15); }
}
@keyframes float-c {
    from { transform: translate(0, 0); }
    to   { transform: translate(40px, -50px); }
}

/* Fine grid texture overlay */
.grid-texture {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--white-08) 1px, transparent 1px),
        linear-gradient(to bottom, var(--white-08) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    opacity: 0.4;
}

/* Brand inner content */
.brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: calc(100vh - 144px);
    gap: 48px;
}

/* Brand mark */
.brand-head { padding-top: 8px; }
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    transition: opacity var(--t-fast);
}
.brand-mark:hover { opacity: 0.82; }
.brand-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}
.brand-wordmark {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.18em;
}
.brand-dot {
    display: inline-block;
    color: var(--mint);
    margin: 0 4px;
    transform: translateY(-2px);
}

/* Brand mark variant for mobile (dark text) */
.brand-mark--dark { color: var(--night); }
.brand-mark--dark .brand-dot { color: var(--deep-green); }

/* Hero typography */
.brand-hero { max-width: 540px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--mint);
    padding: 8px 14px;
    border: 1px solid var(--white-15);
    border-radius: var(--r-pill);
    background: var(--white-08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-bottom: 28px;
}
.eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 12px var(--mint);
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.85); }
}

.display-headline {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.4rem, 4.4vw, 3.8rem);
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin: 0 0 20px;
    color: var(--white);
}
.display-headline em {
    font-style: italic;
    color: var(--mint);
    position: relative;
}

.lede {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--white-80);
    max-width: 480px;
    margin: 0;
    font-weight: 400;
}

/* Feature list */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 18px;
    max-width: 480px;
}
.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.feature-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--r-md);
    background: var(--white-08);
    border: 1px solid var(--white-15);
    color: var(--mint);
    font-size: 18px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.feature-list strong {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--white);
    margin-bottom: 2px;
}
.feature-list p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--white-60);
}

/* Stats footer */
.brand-foot { padding-bottom: 8px; }
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-top: 28px;
    border-top: 1px solid var(--white-15);
}
.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
    color: var(--white);
    font-weight: 400;
    letter-spacing: -0.02em;
}
.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--white-60);
    font-weight: 500;
}

/* =========================================================
   5. FORM PANEL (right)
   ========================================================= */
.form-panel {
    position: relative;
    background-color: var(--bg-light);
    background-image:
        radial-gradient(70% 50% at 80% 0%, var(--surface) 0%, transparent 60%),
        radial-gradient(60% 40% at 20% 100%, rgba(98, 250, 227, 0.08) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
}

/* Mobile-only topbar */
.mobile-topbar {
    padding: 20px 24px;
    border-bottom: 1px solid var(--ink-06);
    background-color: var(--white);
}

.form-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 56px);
    gap: 32px;
}

/* Login card */
.form-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    background-color: var(--white);
    border: 1px solid var(--ink-06);
    border-radius: var(--r-2xl);
    padding: clamp(32px, 4vw, 48px);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--t-med), transform var(--t-med);
    overflow: hidden;
}
.form-card:hover { box-shadow: var(--shadow-card-hover); }

/* Top accent ribbon (mint→green gradient) */
.form-card__accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--night) 0%, var(--deep-green) 50%, var(--mint) 100%);
}

/* Logo medallion */
.form-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}
.logo-circle {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--surface) 0%, var(--white) 100%);
    border: 1px solid var(--ink-06);
    display: grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(0, 107, 95, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    position: relative;
}
.logo-circle::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    background: linear-gradient(135deg, var(--mint), transparent 60%);
    opacity: 0.4;
    z-index: -1;
}
.logo-circle svg {
    width: 36px;
    height: 36px;
}

/* Form header */
.form-head { text-align: center; margin-bottom: 32px; }
.form-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 2.25rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--night);
    margin: 0 0 8px;
}
.form-sub {
    font-size: 0.9375rem;
    color: var(--ink-60);
    margin: 0;
    line-height: 1.5;
}

/* Form */
.login-form {
    display: grid;
    gap: 20px;
}

.field { display: grid; gap: 8px; }

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--night);
    letter-spacing: 0.01em;
    margin: 0;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--ink-45);
    font-size: 16px;
    pointer-events: none;
    transition: color var(--t-fast);
    z-index: 1;
}

.field-input.form-control {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 46px;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    color: var(--night);
    background-color: var(--surface);
    border: 1.5px solid transparent;
    border-radius: var(--r-md);
    outline: none;
    box-shadow: none;
    transition:
        background-color var(--t-fast),
        border-color var(--t-fast),
        box-shadow var(--t-fast),
        transform var(--t-fast);
}
.field-input::placeholder { color: var(--ink-45); font-weight: 400; }
.field-input:hover { background-color: #DDE6FA; }
.field-input:focus {
    background-color: var(--white);
    border-color: var(--deep-green);
    box-shadow: 0 0 0 4px var(--mint-15);
}
.field-input:focus ~ .toggle-pass,
.input-wrap:focus-within .input-icon { color: var(--deep-green); }

/* Password field (has toggle button → extra right padding) */
#password.field-input { padding-right: 52px; }

.toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    border-radius: var(--r-sm);
    color: var(--ink-45);
    cursor: pointer;
    transition: color var(--t-fast), background-color var(--t-fast);
}
.toggle-pass:hover {
    color: var(--deep-green);
    background-color: var(--mint-15);
}
.toggle-pass:focus-visible {
    outline: 2px solid var(--deep-green);
    outline-offset: 2px;
}

/* Invalid state */
.field-input.is-invalid {
    background-color: rgba(186, 26, 26, 0.04);
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(186, 26, 26, 0.1);
}
.field-error {
    font-size: 0.8125rem;
    color: var(--error);
    min-height: 1.2em;
    display: block;
    line-height: 1.2;
}

/* Secondary link (forgot pwd) */
.link-secondary {
    font-size: 0.8125rem;
    color: var(--deep-green);
    font-weight: 600;
    transition: color var(--t-fast);
    position: relative;
}
.link-secondary::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1.5px;
    background: var(--deep-green);
    transition: width var(--t-med);
}
.link-secondary:hover { color: var(--night); }
.link-secondary:hover::after { width: 100%; background: var(--night); }

/* Form row */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 4px;
}

/* Custom checkbox */
.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.check input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    opacity: 0;
}
.check-box {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--ink-12);
    background: var(--white);
    color: transparent;
    transition: all var(--t-fast);
    font-size: 13px;
}
.check input:focus-visible + .check-box {
    box-shadow: 0 0 0 4px var(--mint-15);
    border-color: var(--deep-green);
}
.check input:checked + .check-box {
    background: var(--night);
    border-color: var(--night);
    color: var(--mint);
}
.check-label {
    font-size: 0.875rem;
    color: var(--ink-80);
    font-weight: 500;
}

/* Primary button */
.btn-primary {
    position: relative;
    width: 100%;
    height: 54px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--white);
    background: var(--ink);
    border: none;
    border-radius: var(--r-md);
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--t-fast), box-shadow var(--t-med), background-color var(--t-med);
    box-shadow: var(--shadow-btn);
    isolation: isolate;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--deep-green) 0%, var(--night) 100%);
    opacity: 0;
    transition: opacity var(--t-med);
    z-index: -1;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-btn-hover);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--mint-glow), var(--shadow-btn);
}
.btn-icon {
    display: inline-grid;
    place-items: center;
    transition: transform var(--t-fast);
    font-size: 18px;
}
.btn-primary:hover .btn-icon { transform: translateX(4px); }

/* Spinner (loading state) */
.btn-spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--white-15);
    border-top-color: var(--mint);
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary.is-loading .btn-label,
.btn-primary.is-loading .btn-icon { opacity: 0; }
.btn-primary.is-loading .btn-spinner { opacity: 1; }
.btn-primary[disabled] { cursor: wait; opacity: 0.9; }

/* Success flash */
.btn-primary.is-success {
    background: var(--deep-green);
    animation: success-pulse 1.6s var(--ease);
}
@keyframes success-pulse {
    0%   { box-shadow: 0 0 0 0 var(--mint-glow); }
    50%  { box-shadow: 0 0 0 16px transparent; }
    100% { box-shadow: var(--shadow-btn); }
}

/* Trust row */
.trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 0;
    font-size: 0.8125rem;
    color: var(--ink-45);
}
.trust-row i { color: var(--deep-green); font-size: 14px; }

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 20px;
    color: var(--ink-45);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ink-06);
}

/* Signup prompt */
.signup-prompt {
    text-align: center;
    font-size: 0.9375rem;
    color: var(--ink-60);
    margin: 0;
}
.link-primary {
    color: var(--deep-green);
    font-weight: 700;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color var(--t-fast), gap var(--t-fast);
}
.link-primary:hover { color: var(--night); gap: 8px; }

/* Page footer */
.page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 460px;
    font-size: 0.75rem;
    color: var(--ink-45);
    gap: 12px;
}
.page-footer nav { display: flex; gap: 18px; }
.page-footer a {
    color: var(--ink-60);
    transition: color var(--t-fast);
}
.page-footer a:hover { color: var(--night); }

/* =========================================================
   6. Animations: entrance reveals
   ========================================================= */
[data-anim="fade-in"] {
    opacity: 0;
    transform: translateY(8px);
    animation: anim-fade-in 720ms var(--ease) forwards;
    animation-delay: var(--delay, 0ms);
}
[data-anim="fade-up"] {
    opacity: 0;
    transform: translateY(20px);
    animation: anim-fade-up 760ms var(--ease) forwards;
    animation-delay: var(--delay, 0ms);
}
@keyframes anim-fade-in {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes anim-fade-up {
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   7. Responsive
   ========================================================= */
@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }
    .brand-panel { display: none; }
    .form-shell {
        padding: 32px 20px 28px;
    }
    .form-card {
        max-width: 480px;
        padding: 36px 28px;
    }
    .form-title { font-size: 1.875rem; }
    .page-footer { flex-direction: column; gap: 10px; }
}

@media (max-width: 575.98px) {
    .form-card { padding: 28px 22px; border-radius: var(--r-xl); }
    .form-title { font-size: 1.75rem; }
    .form-head { margin-bottom: 24px; }
    .field-input.form-control { height: 50px; }
    .btn-primary { height: 52px; }
    .mobile-topbar { padding: 16px 20px; }
    .brand-wordmark { font-size: 15px; }
}

/* =========================================================
   8. Accessibility — motion + focus
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .orb { animation: none; }
}

/* Stronger focus for keyboard users */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--deep-green);
    outline-offset: 2px;
    border-radius: 4px;
}

/* High-contrast tweak */
@media (prefers-contrast: more) {
    .field-input.form-control { border-color: var(--night); }
    .lede, .form-sub { color: var(--night); }
}

/* =========================================================
   9. REGISTER PAGE — additional components
   ========================================================= */

/* Make form panel scrollable independently of brand panel */
.form-panel--scrollable {
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ink-12) transparent;
}
.form-panel--scrollable::-webkit-scrollbar { width: 8px; }
.form-panel--scrollable::-webkit-scrollbar-thumb {
    background: var(--ink-12);
    border-radius: 4px;
}
.form-panel--scrollable::-webkit-scrollbar-thumb:hover { background: var(--ink-45); }

/* Sticky brand panel for register */
.auth-shell--register .brand-panel {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
}

/* Wider, top-aligned form-shell for register */
.form-shell--register {
    justify-content: flex-start;
    align-items: center;
    padding-top: clamp(40px, 5vw, 64px);
    padding-bottom: clamp(40px, 5vw, 64px);
}
.form-card--register { max-width: 580px; }

/* ----- Referral banner ----------------------------------- */
.referral-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--mint-15), var(--surface));
    border: 1px solid var(--mint-30);
    border-radius: var(--r-md);
    margin-bottom: 32px;
}
.referral-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    color: var(--deep-green);
    display: grid;
    place-items: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 107, 95, 0.15);
}
.referral-banner .ref-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.referral-banner .ref-label {
    font-size: 0.7rem;
    color: var(--ink-60);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}
.referral-banner .ref-name {
    color: var(--night);
    font-size: 0.95rem;
    font-weight: 700;
}

/* ----- Form sections (numbered) --------------------------- */
.form-section { margin-bottom: 28px; }
.form-section:last-of-type { margin-bottom: 0; }

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ink-06);
}
.section-num {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    background: var(--night);
    color: var(--mint);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 8px;
    font-family: var(--font-body);
    flex-shrink: 0;
}
.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--night);
    margin: 0;
    letter-spacing: -0.005em;
}
.section-sub {
    margin: 0 0 0 auto;
    font-size: 0.75rem;
    color: var(--ink-45);
}

/* ----- 2-column field grid ------------------------------- */
.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.field-grid > .field { margin: 0; }
.field-stack { display: grid; gap: 16px; }

/* ----- Select field (custom-styled native) --------------- */
.field-select.form-select {
    width: 100%;
    height: 52px;
    padding: 0 44px 0 46px;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    color: var(--night);
    background-color: var(--surface);
    border: 1.5px solid transparent;
    border-radius: var(--r-md);
    box-shadow: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23131B2E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 12px 8px;
    transition:
        background-color var(--t-fast),
        border-color var(--t-fast),
        box-shadow var(--t-fast);
    appearance: none;
    -webkit-appearance: none;
}
.field-select:hover { background-color: #DDE6FA; }
.field-select:focus {
    background-color: var(--white);
    border-color: var(--deep-green);
    box-shadow: 0 0 0 4px var(--mint-15);
    outline: none;
}
.field-select.is-invalid {
    background-color: rgba(186, 26, 26, 0.04);
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(186, 26, 26, 0.1);
}

/* Date input shares look with text input */
input[type="date"].field-input.form-control { padding-right: 16px; }
input[type="date"].field-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--t-fast);
}
input[type="date"].field-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* ----- Phone with country code prefix --------------------- */
.phone-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    background-color: var(--surface);
    border: 1.5px solid transparent;
    border-radius: var(--r-md);
    transition:
        background-color var(--t-fast),
        border-color var(--t-fast),
        box-shadow var(--t-fast);
}
.phone-wrap:hover { background-color: #DDE6FA; }
.phone-wrap:focus-within {
    background-color: var(--white);
    border-color: var(--deep-green);
    box-shadow: 0 0 0 4px var(--mint-15);
}
.phone-prefix {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px 0 16px;
    font-weight: 600;
    color: var(--night);
    font-size: 0.9375rem;
    border-right: 1px solid var(--ink-12);
    user-select: none;
}
.phone-prefix i { color: var(--ink-45); font-size: 14px; }
.phone-input.field-input.form-control {
    background-color: transparent;
    border: none;
    height: 50px;
    padding-left: 14px;
    padding-right: 16px;
    border-radius: 0 var(--r-md) var(--r-md) 0;
    flex: 1;
    min-width: 0;
}
.phone-input.field-input:focus { box-shadow: none; background: transparent; }

/* ----- Password strength indicator ----------------------- */
.pass-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--ink-45);
    min-height: 18px;
}
.pass-strength-bar {
    flex: 1;
    height: 4px;
    background: var(--ink-06);
    border-radius: 999px;
    overflow: hidden;
}
.pass-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--error);
    transition: width var(--t-med), background-color var(--t-med);
}
.pass-strength-fill[data-level="1"] { width: 25%; background: var(--error); }
.pass-strength-fill[data-level="2"] { width: 50%; background: #d97706; }
.pass-strength-fill[data-level="3"] { width: 75%; background: var(--deep-green); }
.pass-strength-fill[data-level="4"] { width: 100%; background: var(--deep-green); }
.pass-strength-label { font-weight: 600; min-width: 70px; text-align: right; }
.pass-strength-label[data-level="1"] { color: var(--error); }
.pass-strength-label[data-level="2"] { color: #d97706; }
.pass-strength-label[data-level="3"],
.pass-strength-label[data-level="4"] { color: var(--deep-green); }

/* ----- Side selection (binary: D / I) -------------------- */
.side-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.side-option {
    position: relative;
    cursor: pointer;
}
.side-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.side-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1.5px solid transparent;
    border-radius: var(--r-md);
    transition: all var(--t-fast);
}
.side-card i {
    color: var(--ink-45);
    font-size: 18px;
    transition: color var(--t-fast);
}
.side-card-text { display: flex; flex-direction: column; line-height: 1.2; }
.side-card-text strong { font-size: 0.875rem; color: var(--night); font-weight: 600; }
.side-card-text small { font-size: 0.75rem; color: var(--ink-60); }
.side-option:hover .side-card { background: #DDE6FA; }
.side-option input:checked + .side-card {
    background: var(--white);
    border-color: var(--deep-green);
    box-shadow: 0 0 0 4px var(--mint-15);
}
.side-option input:checked + .side-card i { color: var(--deep-green); }
.side-option input:focus-visible + .side-card {
    border-color: var(--deep-green);
    box-shadow: 0 0 0 4px var(--mint-15);
}

/* ----- Terms checkbox card ------------------------------- */
.terms-card {
    margin: 24px 0 4px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--ink-06);
    border-radius: var(--r-md);
}
.terms-card .check { align-items: flex-start; gap: 12px; }
.terms-card .check-box { margin-top: 1px; }
.terms-card .check-label { line-height: 1.5; font-size: 0.875rem; color: var(--ink-80); }
.terms-card a.terms-link {
    color: var(--deep-green);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.terms-card a.terms-link:hover { color: var(--night); }
.terms-download {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    margin-left: 30px;
    font-size: 0.8125rem;
    color: var(--deep-green);
    font-weight: 600;
}
.terms-download:hover { color: var(--night); }

/* ----- Responsive ---------------------------------------- */
@media (max-width: 575.98px) {
    .field-grid { grid-template-columns: 1fr; gap: 12px; }
    .side-group { grid-template-columns: 1fr; }
    .referral-banner { padding: 12px 14px; }
    .form-card--register { padding: 28px 22px; }
}
