/* ================= ROOT / DESIGN TOKENS ================= */
:root {
    --bg: #e9efe8;
    --shadow-dark: #c6d2c4;
    --shadow-light: #ffffff;
    --ink: #1f2a1c;
    --muted: #566253;
    --accent: #4a9a50;
    --accent-soft: #7ebb80;
    --line: rgba(31, 70, 37, 0.14);

    --green-900: #0f2413;
    --green-800: #16331b;
    --green-700: #1f4625;
    --green-600: #25572c;
    --green-500: #2e6d36;
    --green-400: #4a9a50;
    --green-300: #7ebb80;
    --green-100: #dcede0;
    --green-50: #f1f7f1;
    --paper: #fbfdfb;

    --cream: #fcfcf7;
    --error: #a33b32;

    --elev-1: 0 1px 2px rgba(31, 70, 37, 0.06), 0 2px 6px rgba(31, 70, 37, 0.05);
    --elev-2: 0 2px 4px rgba(31, 70, 37, 0.06), 0 6px 16px rgba(31, 70, 37, 0.08);
    --elev-3: 0 4px 10px rgba(31, 70, 37, 0.08), 0 12px 28px rgba(31, 70, 37, 0.1);
    --elev-4: 0 8px 18px rgba(31, 70, 37, 0.1), 0 20px 40px rgba(31, 70, 37, 0.14);
}

/* ================= BASE ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    max-width: 100%;
}

body.auth-site-page {
    min-height: 100vh;
    font-family: "Surt", "Cabinet Grotesk", sans-serif;
    color: var(--ink);
    background: linear-gradient(160deg, #f3f7f2 0%, var(--green-50) 55%, #e4ece2 100%);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--green-300);
    color: var(--green-900);
}

/* ================= SCROLLBAR ================= */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--green-50); }
::-webkit-scrollbar-thumb {
    background: var(--accent-soft);
    border-radius: 999px;
    border: 2px solid var(--green-50);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-soft) var(--green-50);
}

/* ================= ICON SIZES ================= */
[data-lucide] { color: currentColor; vertical-align: middle; }
.icon-xs { width: 14px; height: 14px; stroke-width: 2px; }
.icon-sm { width: 18px; height: 18px; stroke-width: 2.2px; }
.icon-md { width: 28px; height: 28px; stroke-width: 1.8px; color: var(--accent); }

a, button {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

a:focus-visible, button:focus-visible, .input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ================= AUTH LAYOUT ================= */
.auth-page,
.auth-page * {
    box-sizing: border-box;
}

.auth-page {
    display: flex;
    min-height: 100vh;
}

/* ================= INTRO PANEL ================= */
.auth-page .intro-panel {
    display: flex;
    width: 42%;
    min-height: 100vh;
    padding: 42px 8%;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(155deg, var(--green-900) 0%, var(--green-800) 100%);
    color: var(--cream);
    border-right: 1px solid rgba(126, 187, 128, 0.22);
    position: relative;
    overflow: hidden;
}

.auth-page .intro-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(126, 187, 128, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 85% 85%, rgba(74, 154, 80, 0.08) 0%, transparent 55%);
    pointer-events: none;
}

.auth-page .intro-panel > * { position: relative; z-index: 1; }

.auth-page .brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 14px;
    color: var(--cream);
    text-decoration: none;
    line-height: 1;
}

.auth-page .brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.auth-page .brand-name {
    font-family: "SurtBold", sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--cream);
}

.auth-page .intro-copy {
    width: 100%;
    max-width: 560px;
    margin: 40px auto;
}

.auth-page .eyebrow {
    margin: 0 0 14px;
    color: var(--green-300);
    font-family: "Surt", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.auth-page .intro-copy h1 {
    margin: 0 0 18px;
    color: var(--cream);
    font-family: "SurtBold", sans-serif;
    font-size: clamp(1.9em, 2.8vw, 2.6em);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.auth-page .intro-copy p {
    max-width: 470px;
    color: rgba(252, 252, 247, 0.75);
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 1.02em;
    line-height: 1.65;
}

.auth-page .art-preview {
    display: flex;
    min-height: 230px;
    margin: 30px 0 0;
    padding: 12px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--green-700);
    border: 1px solid rgba(126, 187, 128, 0.22);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    color: var(--cream);
    text-align: center;
}

.auth-page .art-preview img {
    width: 100%;
    height: 230px;
    object-fit: contain;
    background: var(--paper);
    border-radius: 8px;
    display: block;
}

.auth-page .art-preview-caption {
    font-family: "Pinsans", sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green-300);
}

.auth-page .panel-note {
    margin: 0;
    text-align: center;
    color: rgba(252, 252, 247, 0.55);
    font-family: "Pinsans", sans-serif;
    font-size: 10.5px;
    letter-spacing: 0.14em;
    line-height: 1.8;
    text-transform: uppercase;
}

/* ================= FORM PANEL ================= */
.auth-page .form-panel {
    display: flex;
    width: 58%;
    min-height: 100vh;
    padding: 56px 8%;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    position: relative;
}

.auth-page .back-btn-wrapper {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 2;
}

.auth-page .back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 24px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    background: var(--bg);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    color: var(--accent);
    font-family: "Surt", sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.auth-page .back-btn:empty::before { content: "\2190  Back"; }

.auth-page .back-btn:hover {
    transform: translateY(-3px);
    background: var(--green-700);
    border-color: var(--green-700);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(15, 36, 19, 0.28), -4px -4px 10px var(--shadow-light);
}

.auth-page .back-btn:active {
    transform: translateY(1px);
    box-shadow: inset 4px 4px 9px rgba(0, 0, 0, 0.35), inset -3px -3px 6px rgba(255, 255, 255, 0.08);
}

.auth-page .back-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.auth-page .form-content {
    width: 100%;
    max-width: 540px;
}

.local-demo-note {
    margin-top: 24px;
    color: var(--muted);
    font-family: "Pinsans", sans-serif;
    font-size: 12px;
    line-height: 1.5;
}

.auth-page .form-content h2 {
    margin: 0 0 6px;
    font-family: "SurtBold", sans-serif;
    font-size: clamp(1.9em, 2.6vw, 2.4em);
    font-weight: 800;
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.auth-page .form-intro {
    margin: 0 0 28px;
    color: var(--muted);
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 1.02em;
    line-height: 1.6;
}

.auth-page .form-label {
    display: block;
    margin: 16px 0 8px;
    font-family: "Surt", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--green-700);
}

/* ================= INPUTS ================= */
.auth-page .input {
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 14px;
    outline: none;
    box-shadow: var(--elev-1);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-page .input::placeholder {
    color: #9aa899;
    font-family: "Cabinet Grotesk", sans-serif;
}

.auth-page .input:hover {
    border-color: rgba(74, 154, 80, 0.4);
}

.auth-page .input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 154, 80, 0.18);
}

.auth-page .input[type="password"]::-ms-reveal {
    display: none;
}

/* ================= PASSWORD ROW ================= */
.auth-page .password-row {
    position: relative;
    display: block;
}

.auth-page .password-row .input {
    padding-right: 84px;
}

.auth-page .password-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 14px;
    background: var(--green-50);
    color: var(--green-600);
    border: 1px solid rgba(74, 154, 80, 0.25);
    border-radius: 8px;
    font-family: "Surt", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.auth-page .password-button:hover {
    background: var(--green-600);
    color: #fff;
    border-color: var(--green-600);
}

/* ================= FORM OPTIONS ================= */
.auth-page .form-options {
    display: flex;
    margin: 18px 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 13.5px;
}

.auth-page .form-options a {
    color: var(--green-600);
    text-decoration: none;
    font-weight: 600;
}

.auth-page .form-options a:hover {
    color: var(--green-800);
    text-decoration: underline;
}

.auth-page .form-options .text-button {
    font-size: 13.5px;
    font-family: "Surt", sans-serif;
    font-weight: 700;
    color: var(--green-600);
    text-decoration: none;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

.auth-page .form-options .text-button:hover {
    color: var(--green-800);
    text-decoration: underline;
}

.auth-page .check-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--muted);
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
}

.auth-page .check-label input {
    margin-top: 4px;
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ================= SUBMIT BUTTON ================= */
.auth-page .submit-button {
    width: 100%;
    min-height: 54px;
    margin-top: 14px;
    padding: 14px 20px;
    background: var(--green-500);
    border: 1px solid var(--green-500);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-family: "Surt", sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(46, 109, 54, 0.25);
}

.auth-page .submit-button:hover {
    background: var(--green-600);
    border-color: var(--green-600);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(46, 109, 54, 0.32);
}

.auth-page .submit-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(46, 109, 54, 0.25);
}

.auth-page .submit-button svg {
    transition: transform 0.25s ease;
}

.auth-page .submit-button:hover svg {
    transform: translateX(4px);
}

/* ================= MESSAGES / LINKS / DIVIDER ================= */
.auth-page .message {
    min-height: 24px;
    margin: 10px 0;
    color: var(--green-600);
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 13.5px;
}

.auth-page .message[data-state="error"] {
    color: var(--error);
}

.auth-page hr {
    margin: 26px 0 16px;
    border: 0;
    border-top: 1px solid var(--line);
}

.auth-page .account-link {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 14px;
}

.auth-page .text-button {
    padding: 0;
    background: none;
    border: 0;
    color: var(--accent);
    cursor: pointer;
    font-family: "Surt", sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
}

.auth-page .text-button:hover {
    color: var(--green-800);
    text-decoration-color: currentColor;
}

/* ================= HIDE NON-ACTIVE VIEWS ================= */
.auth-page #signupContent,
.auth-page #forgotPasswordContent {
    display: none;
}

/* ================= FIELD HINT ================= */
.auth-page .field-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-family: "Pinsans", sans-serif;
    font-size: 11.5px;
    letter-spacing: 0.02em;
}

.auth-page .field-hint strong {
    color: var(--green-700);
    font-weight: 700;
}

/* ================= FIELD ERRORS ================= */
.auth-page .field-error {
    display: block;
    margin-top: 4px;
    min-height: 0;
    text-align: right;
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--error);
    line-height: 1.4;
}

.auth-page .field-error:empty {
    display: none;
}

.auth-page .input.has-error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(163, 59, 50, 0.12);
}

.auth-page .input.has-error:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(163, 59, 50, 0.2);
}

/* ================= TERMS CHECK ================= */
.auth-page .terms-check {
    margin-top: 18px;
}

.auth-page .terms-check a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-underline-offset: 2px;
}

.auth-page .terms-check a:hover {
    color: var(--green-800);
}

/* ================= POLICY DIALOGS ================= */
.policy-dialog {
    position: fixed;
    width: min(560px, calc(100% - 32px));
    max-height: min(80vh, 600px);
    margin: auto;
    padding: 32px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    font-family: "Cabinet Grotesk", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    box-shadow: 0 20px 50px rgba(15, 36, 19, 0.25);
}

.policy-dialog::backdrop {
    background: rgba(15, 36, 19, 0.55);
    backdrop-filter: blur(4px);
}

.policy-dialog h2 {
    margin: 0 40px 18px 0;
    font-family: "SurtBold", sans-serif;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--green-800);
    letter-spacing: -0.01em;
}

.policy-dialog p {
    margin: 0 0 14px;
    color: var(--ink);
}

.policy-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--green-600);
    cursor: pointer;
    font-family: inherit;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--elev-1);
}

.policy-close:hover {
    background: var(--green-600);
    border-color: var(--green-600);
    color: #fff;
    box-shadow: var(--elev-2);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
    .auth-page .intro-panel,
    .auth-page .form-panel {
        padding: 40px 6%;
    }

    .auth-page .intro-copy h1 {
        font-size: 2em;
    }
}

@media (max-width: 760px) {
    .auth-page {
        flex-direction: column;
    }

    .auth-page .intro-panel {
        width: 100%;
        min-height: auto;
        padding: 32px 7%;
        border-right: 0;
        border-bottom: 1px solid rgba(126, 187, 128, 0.22);
    }

    .auth-page .intro-copy {
        margin: 30px auto 24px;
    }

    .auth-page .intro-copy h1 {
        font-size: 1.9em;
    }

    .auth-page .art-preview {
        min-height: 170px;
    }

    .auth-page .art-preview img {
        height: 170px;
    }

    .auth-page .form-panel {
        width: 100%;
        min-height: auto;
        padding: 40px 7%;
    }

    .auth-page .form-content {
        padding-top: 40px;
    }
}

@media (max-width: 420px) {
    .auth-page .form-options {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-page .form-content h2 {
        font-size: 1.8em;
    }

    .policy-dialog {
        padding: 24px;
    }

    .policy-dialog h2 {
        font-size: 20px;
    }
}

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