:root {
    --bg: #0b1326;
    --canvas: #0f172a;
    --panel: #182138;
    --panel-2: #131b2e;
    --input: #060e20;
    --text: #f8fafc;
    --secondary: #94a3b8;
    --muted: #64748b;
    --primary: #aeb0ff;
    --primary-strong: #6366f1;
    --green: #4edea3;
    --green-deep: #10b981;
    --border: rgba(255, 255, 255, .08);
    --danger: #ffb4ab;
    --shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

:root[data-theme="light"] {
    --bg: #f5f7fb;
    --canvas: #eef2f8;
    --panel: #fff;
    --panel-2: #f7f8fc;
    --input: #f2f5fa;
    --text: #111827;
    --secondary: #536179;
    --muted: #78869d;
    --primary: #4f46e5;
    --primary-strong: #4338ca;
    --green: #047857;
    --green-deep: #059669;
    --border: rgba(15, 23, 42, .11);
    --danger: #b91c1c;
    --shadow: 0 24px 60px rgba(39, 48, 72, .12);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, system-ui, sans-serif;
    background: var(--canvas);
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.auth-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-tools {
    position: fixed;
    top: 16px;
    right: 18px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    background: var(--panel);
}

.lang-switch a {
    padding: 6px 10px;
    font-size: 12px;
    color: var(--secondary);
    font-weight: 600;
}

.lang-switch a.active {
    color: #fff;
    background: var(--primary-strong);
}

.icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.auth-page {
    min-height: 100vh;
    padding: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 80% 15%, rgba(99, 102, 241, .08), transparent 34%), var(--canvas);
}

.auth-shell {
    width: min(1460px, 100%);
}

.split-shell {
    display: grid;
    grid-template-columns: 41% 1fr;
    gap: 52px;
}

.showcase-panel,
.form-panel,
.compact-card,
.reset-card,
.signup-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.showcase-panel {
    min-height: 780px;
    padding: 38px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0;
    color: var(--text);
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -.04em;
}

.brand:hover {
    text-decoration: none;
}

.auth-brand-logo {
    height: clamp(44px, 5.2vw, 76px);
    width: auto;
    max-width: min(56vw, 300px);
    display: block;
    object-fit: contain;
}

[data-theme="dark"] .auth-brand-logo {
    content: url('/images/dark.png');
}

.brand-mark {
    display: none;
}

.showcase-copy {
    margin-top: 48px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: max-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, .18);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
}

.eyebrow.success {
    background: rgba(16, 185, 129, .12);
    color: var(--green);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.showcase-copy h1 {
    font: 700 clamp(38px, 4vw, 58px)/1.05 "Plus Jakarta Sans", sans-serif;
    letter-spacing: -.04em;
    margin: 16px 0 12px;
    background: linear-gradient(90deg, var(--text) 0 45%, var(--primary) 70%, var(--green) 100%);
    -webkit-background-clip: text;
    color: transparent;
}

.showcase-copy p,
.form-heading p,
.compact-heading p {
    color: var(--secondary);
    line-height: 1.55;
    margin: 0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 36px;
}

.metric {
    background: var(--panel-2);
    padding: 20px 16px;
    border-radius: 8px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric .material-symbols-outlined {
    color: var(--green);
}

.metric strong {
    font: 600 20px "Plus Jakarta Sans";
}

.metric small {
    color: var(--muted);
    line-height: 1.4;
}

.velocity-card {
    margin-top: 28px;
    background: var(--panel-2);
    border-radius: 8px;
    padding: 18px;
}

.velocity-card > div {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
}

.velocity-card strong {
    color: var(--green);
}

.velocity-card svg {
    width: 100%;
    height: 70px;
    margin-top: 8px;
}

.velocity-card path {
    fill: none;
    stroke: var(--primary-strong);
    stroke-width: 3;
}

.proof {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 22px;
}

.stars {
    color: #f59e0b;
    letter-spacing: 5px;
}

.proof p {
    font-style: italic;
    line-height: 1.5;
}

.proof small {
    color: var(--muted);
}

.form-panel {
    min-height: 780px;
    padding: 58px 64px;
}

.form-panel-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.form-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.form-heading h2,
.compact-heading h1 {
    font: 700 clamp(28px, 3vw, 38px)/1.18 "Plus Jakarta Sans";
    letter-spacing: -.03em;
    margin: 0 0 6px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    background: var(--panel-2);
    color: var(--secondary);
    border-radius: 5px;
    white-space: nowrap;
    font-size: 12px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-group label,
.label-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.label-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    font-size: 13px;
    color: var(--secondary);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input);
    border: 1px solid transparent;
    border-radius: 7px;
    min-height: 46px;
    overflow: hidden;
}

.input-wrap:focus-within {
    border-color: var(--primary-strong);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.input-wrap > span:first-child {
    position: absolute;
    left: 14px;
    color: var(--muted);
    font-size: 20px;
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 46px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    padding: 0 54px 0 48px;
    font: 500 14px Inter;
    min-width: 0;
}

.input-action {
    position: absolute;
    right: 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.input-action .material-symbols-outlined {
    position: static !important;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--secondary);
    font-size: 13px;
    line-height: 1.45;
}

.check-row input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary-strong);
    margin-top: 1px;
}

.primary-button {
    min-height: 48px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(90deg, var(--primary-strong), #6d68f0);
    color: #fff !important;
    font: 600 15px "Plus Jakarta Sans";
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(99, 102, 241, .23);
    text-decoration: none;
    padding: 12px 18px;
}

.primary-button:hover {
    filter: brightness(1.07);
    text-decoration: none;
}

.field-error {
    color: var(--danger);
    font-size: 12px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    margin: 26px 0 18px;
}

.divider:before,
.divider:after {
    content: "";
    height: 1px;
    background: var(--border);
    flex: 1;
}

.sso-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.sso-grid button {
    height: 42px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--secondary);
    border-radius: 6px;
}

.future-note {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
}

.form-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 20px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width:1000px) {
    .split-shell,
    .signup-grid {
        grid-template-columns: 1fr;
    }

    .showcase-panel,
    .signup-showcase {
        display: none;
    }

    .form-panel {
        min-height: auto;
    }

    .signup-progress .step:not(.active),
    .progress-line {
        display: none;
    }

    .signup-progress {
        justify-content: center;
    }

    .signup-card {
        padding: 32px;
    }

    .requirements {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width:640px) {
    .auth-page {
        padding: 74px 14px 18px;
    }

    .form-panel,
    .compact-card,
    .reset-card,
    .signup-card {
        padding: 26px 18px;
    }

    .form-heading {
        flex-direction: column;
    }

    .field-grid,
    .sso-grid {
        grid-template-columns: 1fr;
    }

    .requirements,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .auth-tools {
        right: 14px;
    }

    .reset-top {
        align-items: flex-start;
        gap: 16px;
        flex-direction: column;
    }

    .security-badges {
        flex-wrap: wrap;
        justify-content: center;
    }

    .policy-card > div {
        grid-template-columns: 1fr;
    }

    .auth-brand-logo {
        height: clamp(40px, 12vw, 62px);
        max-width: 72vw;
    }
}

/* ── Global loading overlay ── */
#g-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

#g-loader.g-loader-visible {
    opacity: 1;
    pointer-events: all;
}

.g-loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 36px;
    box-shadow: var(--shadow);
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.g-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-strong);
    border-radius: 50%;
    animation: g-spin .7s linear infinite;
}

@keyframes g-spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-btn-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: g-spin .7s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.primary-button:disabled {
    opacity: .7;
    cursor: not-allowed;
    filter: none;
}

