/* ============================================================================
   Signup / login — full-viewport split view
   ============================================================================

   Two-panel layout. On viewports ≥ 900px, side-by-side; below that, the
   brand panel becomes a compact top hero and the form panel fills the rest
   of the screen. Full-viewport by design — no site header/footer here.

   BG image: /assets/img/signup-bg.jpg (user-supplied Unsplash).
   Placeholder: /assets/img/signup-bg.svg (ships with CP-2).
   Both stacked as background-image so the SVG shows through until the .jpg
   lands.
============================================================================ */

/* Reset the body — this is a bespoke page, no site chrome. */
.auth-body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
    min-height: 100dvh;
}


/* --------------------------------------------------------------------------
   Grid — the two panels
-------------------------------------------------------------------------- */
.auth-page {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
}
@media (min-width: 900px) {
    .auth-page {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
    }
}
@media (min-width: 1200px) {
    .auth-page {
        /* Slightly wider brand panel on very large screens keeps the form
           from stretching to something uncomfortable. */
        grid-template-columns: 1.15fr 1fr;
    }
}


/* --------------------------------------------------------------------------
   LEFT PANEL — brand + narrative
-------------------------------------------------------------------------- */
.auth-brand {
    position: relative;
    padding: 32px 24px 28px;
    overflow: hidden;
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 260px;

    /* Layered background: gradient overlay ON TOP of the image so the copy
       stays readable at any BG choice. */
    background:
        linear-gradient(135deg, rgba(13, 45, 78, 0.86), rgba(18, 58, 98, 0.78)),
        url('/assets/img/signup-bg.jpg') center / cover no-repeat,
        url('/assets/img/signup-bg.svg') center / cover no-repeat;
}
@media (min-width: 900px) {
    .auth-brand {
        padding: 56px 56px 40px;
        min-height: auto;
    }
}
@media (min-width: 1200px) {
    .auth-brand {
        padding: 72px 80px 56px;
    }
}

.auth-brand__logo {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: border-color 200ms ease;
}
.auth-brand__logo:hover {
    border-bottom-color: #FFFFFF;
}

.auth-brand__body {
    margin-top: auto;
    padding-top: 28px;
}
@media (min-width: 900px) {
    .auth-brand__body {
        padding-top: 48px;
        max-width: 42ch;
    }
}

.auth-brand__eyebrow {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #B06F2B;
    margin: 0 0 14px;
}

.auth-brand__title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 30px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: #FFFFFF;
    max-width: 16ch;
}
@media (min-width: 900px) {
    .auth-brand__title { font-size: 40px; }
}
@media (min-width: 1200px) {
    .auth-brand__title { font-size: 48px; }
}

.auth-brand__lede {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 32px;
    max-width: 52ch;
}

.auth-brand__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 20px;
}
.auth-brand__list li {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.auth-brand__list-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(176, 111, 43, 0.22);
    color: #E4A268;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.auth-brand__list-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: #FFFFFF;
    margin: 0 0 3px;
    letter-spacing: -0.01em;
}
.auth-brand__list-desc {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

.auth-brand__foot {
    margin: 32px 0 0;
    font-size: 13px;
}
@media (min-width: 900px) {
    .auth-brand__foot { margin-top: 48px; }
}
.auth-brand__foot a {
    color: rgba(255, 255, 255, 0.68);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.24);
    padding-bottom: 1px;
    transition: color 200ms ease, border-color 200ms ease;
}
.auth-brand__foot a:hover {
    color: #FFFFFF;
    border-bottom-color: #FFFFFF;
}


/* --------------------------------------------------------------------------
   RIGHT PANEL — form
-------------------------------------------------------------------------- */
.auth-panel {
    background: var(--bg-alt);
    padding: 32px 24px 48px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
@media (min-width: 900px) {
    .auth-panel {
        padding: 56px 56px;
        align-items: center;
    }
}

.auth-panel__inner {
    width: 100%;
    max-width: 440px;
}


/* --------------------------------------------------------------------------
   Tabs — signup ↔ login
-------------------------------------------------------------------------- */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: rgba(0, 0, 0, 0.28);
    padding: 4px;
    border-radius: var(--r-card);
    margin-bottom: 28px;
}
.auth-tab {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 10px 14px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
    min-height: 40px;
}
.auth-tab:hover { color: var(--text); }
.auth-tab[aria-selected="true"] {
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}


/* --------------------------------------------------------------------------
   Notices — success + failure
-------------------------------------------------------------------------- */
.auth-notice {
    padding: 12px 14px;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 20px;
}
.auth-notice--ok {
    background: rgba(108, 176, 43, 0.15);
    border-left: 3px solid #6CB02B;
    color: #DCF0C6;
}
.auth-notice--fail {
    background: rgba(232, 100, 100, 0.15);
    border-left: 3px solid #E86464;
    color: #F5D0D0;
}


/* --------------------------------------------------------------------------
   Forms — visibility controlled by parent mode class
-------------------------------------------------------------------------- */
.auth-form {
    display: none;
    animation: auth-fadeIn 300ms cubic-bezier(0.16, 0.84, 0.44, 1);
}
.auth-mode-signup #signup-form { display: block; }
.auth-mode-login  #login-form  { display: block; }

@keyframes auth-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0);   }
}


/* --------------------------------------------------------------------------
   Form structure
-------------------------------------------------------------------------- */
.auth-form__head {
    margin-bottom: 24px;
}
.auth-form__title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 6px;
}
.auth-form__lede {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

.auth-field {
    display: block;
    margin-bottom: 16px;
}
.auth-field label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.auth-field input {
    width: 100%;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--surface-border);
    border-radius: 3px;
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.35;
    min-height: 44px;
    box-sizing: border-box;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.auth-field input:focus {
    outline: none;
    border-color: #75A0CC;
    box-shadow: 0 0 0 3px rgba(117, 160, 204, 0.18);
}
.auth-field input:invalid:not(:placeholder-shown) {
    border-color: rgba(232, 100, 100, 0.5);
}
.auth-field__hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 6px 0 0;
    line-height: 1.5;
}


/* --------------------------------------------------------------------------
   Gates — legal toggles
-------------------------------------------------------------------------- */
.auth-gates {
    margin: 20px 0 24px;
    padding: 16px 18px;
    background: rgba(0, 0, 0, 0.20);
    border-radius: 3px;
    border: 1px solid var(--surface-border);
    display: grid;
    gap: 14px;
}

.auth-gate {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 14px;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
}
.auth-gate__label { color: var(--text); }
.auth-gate__label a {
    color: #75A0CC;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.auth-gate__label a:hover {
    text-decoration-thickness: 2px;
}

/* Signalling state added by signup.js when the user tries to submit
   without ticking a required gate. Subtle — the browser also blocks
   the submit, this is just to guide the eye. */
.auth-gate--needs-tick {
    background: rgba(232, 100, 100, 0.10);
    border-left: 2px solid rgba(232, 100, 100, 0.6);
    padding: 8px 12px;
    margin: 0 -12px;
    border-radius: 3px;
    animation: auth-gate-flash 400ms ease;
}
@keyframes auth-gate-flash {
    from { background: rgba(232, 100, 100, 0.24); }
    to   { background: rgba(232, 100, 100, 0.10); }
}
@media (prefers-reduced-motion: reduce) {
    .auth-gate--needs-tick { animation: none; }
}


/* --------------------------------------------------------------------------
   Submit
-------------------------------------------------------------------------- */
.auth-submit {
    width: 100%;
    margin-top: 8px;
    min-height: 48px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
}


/* --------------------------------------------------------------------------
   Swap link — bottom of form
-------------------------------------------------------------------------- */
.auth-form__swap {
    margin: 20px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.auth-form__swap-link {
    background: transparent;
    border: 0;
    padding: 0;
    color: #75A0CC;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    margin-left: 4px;
}
.auth-form__swap-link:hover {
    text-decoration-thickness: 2px;
    color: var(--text);
}


/* --------------------------------------------------------------------------
   Reduced motion
-------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .auth-form { animation: none; }
}
