:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #6d7890;
    --line: #e4e8f0;
    --surface: #ffffff;
    --background: #f4f7fb;
    --primary: #3157d5;
    --primary-dark: #2445b5;
    --danger: #b42318;
    --shadow: 0 24px 70px rgba(27, 43, 78, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 0;
    overflow-x: hidden;
    background: var(--background);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 12%, rgba(49, 87, 213, 0.13), transparent 32%),
        radial-gradient(circle at 88% 88%, rgba(24, 151, 137, 0.12), transparent 30%),
        var(--background);
}

.auth-shell {
    width: min(100%, 1020px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-intro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 610px;
    padding: 48px;
    color: #ffffff;
    background: linear-gradient(145deg, #1e3278 0%, #3157d5 55%, #2b9c94 140%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: inherit;
    text-decoration: none;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    font-size: 1.1rem;
}

.brand-name {
    font-size: 1.02rem;
}

.intro-copy {
    max-width: 380px;
    margin: auto 0;
}

.intro-copy h1 {
    max-width: 360px;
    margin: 0 0 18px;
    font-size: clamp(2.1rem, 4vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.055em;
}

.intro-copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.05rem;
    line-height: 1.7;
}

.intro-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
}

.intro-note::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #78e2c6;
    box-shadow: 0 0 0 5px rgba(120, 226, 198, 0.14);
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.auth-card h2 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.auth-subtitle {
    margin: 10px 0 30px;
    color: var(--muted);
    line-height: 1.6;
}

.auth-account-label {
    margin: -12px 0 22px;
    color: #4f5d78;
    font-size: 0.8rem;
    font-weight: 700;
}

.field-help {
    margin: -1px 0 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.auth-card .field-error {
    min-height: 14px;
    margin: 0;
    color: var(--danger);
    font-size: 0.7rem;
}

.form-field {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.form-field label {
    color: #38445a;
    font-size: 0.86rem;
    font-weight: 700;
}

.form-field input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: #fbfcfe;
    color: var(--ink);
    font: inherit;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.form-field input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.12);
}

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

.password-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.password-row a {
    color: var(--primary);
    font-size: 0.8rem;
    text-decoration: none;
}

.password-row a:hover {
    text-decoration: underline;
}

.form-error {
    margin: 0 0 18px;
    padding: 11px 13px;
    border: 1px solid #f4c7c3;
    border-radius: 10px;
    background: #fff5f4;
    color: var(--danger);
    font-size: 0.86rem;
    line-height: 1.45;
}

.primary-button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
    background: var(--primary-dark);
    box-shadow: 0 10px 22px rgba(49, 87, 213, 0.2);
    transform: translateY(-1px);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.68;
    transform: none;
}

.auth-secondary-button {
    display: block;
    min-height: 40px;
    padding: 9px 12px;
    margin: 17px auto 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
}

.help-modal {
    position: fixed;
    inset: 0;
    background: rgba(23, 32, 51, 0.6);
    display: grid;
    place-items: center;
    z-index: 1000;
    padding: 20px;
}

.help-modal-content {
    background: var(--surface);
    padding: 28px;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow);
}

.help-modal-content h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.25rem;
    color: var(--ink);
}

.help-modal-content p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

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

.auth-footnote {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.6;
    text-align: center;
}

.auth-footnote code {
    padding: 2px 5px;
    border-radius: 4px;
    background: #f0f3f9;
    color: #36415a;
    font-size: 0.76rem;
}

[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    .auth-page {
        padding: 0;
    }

    .auth-shell {
        min-height: 100vh;
        grid-template-columns: 1fr;
        border: 0;
        border-radius: 0;
    }

    .auth-intro {
        min-height: 260px;
        padding: 28px 24px;
    }

    .intro-copy {
        margin: 42px 0 24px;
    }

    .intro-copy h1 {
        margin-bottom: 10px;
        font-size: 2.2rem;
    }

    .intro-copy p {
        font-size: 0.92rem;
    }

    .auth-card {
        padding: 34px 24px 42px;
    }
}
