/* ==========================================================================
   TERA KITE — AUTH SHARED STYLES  v11 (Single-scroll fix + video sticky)
   No :root overrides — uses style.css variables
   Tokens used from global stylesheet: --gold-accent, --gold-hover,
   --text-primary, --text-muted, --text-on-gold, --font-serif, --font-sans,
   --transition-smooth, --navbar-height
   ========================================================================== */

/* ── PAGE SHELL ──
   Changed from a fixed-height + overflow:hidden shell to a min-height shell
   with overflow:visible. This removes the *second* internal scroll
   container so error banners / taller forms simply grow the page and the
   BROWSER scrolls — only one scrollbar, ever. */
.auth-page {
    min-height: calc(100vh - var(--navbar-height));
    display: flex;
    overflow: visible;
    background: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
    .auth-page * { animation: none !important; transition: none !important; }
}

/* ══════════════════════════════════════════════════
   LEFT PANEL — VIDEO
   Fluid width via clamp so it scales smoothly instead of
   jumping at fixed breakpoints; always object-fit: cover
   so the frame is always fully filled, never letterboxed.

   Changed position:relative → position:sticky so the video
   visually stays put while the page scrolls, without needing
   its own overflow context (which was the double-scroll cause).
   ══════════════════════════════════════════════════ */
.auth-left {
    width: clamp(280px, 34vw, 520px);
    flex-shrink: 0;
    background-color: #111214;
    position: sticky;
    top: var(--navbar-height, 0);
    height: calc(100vh - var(--navbar-height));
    align-self: flex-start;
    overflow: hidden;
}

.auth-video-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Only one video renders at a time based on screen width */
.auth-video-mobile { display: none; }
.auth-video-desktop { display: block; }

/* soft edge vignette for polish — no text, no color scrim, just depth */
.auth-left::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 -40px 60px -40px rgba(0,0,0,0.35),
                inset 0 40px 60px -40px rgba(0,0,0,0.20);
}

/* ══════════════════════════════════════════════════
   RIGHT PANEL
   overflow changed auto → visible: the panel no longer scrolls
   internally, it just grows with its content and lets the page
   (window) handle scrolling instead.
   ══════════════════════════════════════════════════ */
.auth-right {
    flex: 1;
    background: #faf8f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem clamp(1.25rem, 4vw, 3rem);
    overflow: visible;
    position: relative;
}

.auth-form-box {
    width: 100%;
    max-width: 408px;
}

/* ── HEADINGS ── */
.auth-title {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 2.2vw, 1.9rem);
    font-weight: 700;
    color: var(--text-primary, #17181a);
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
    line-height: 1.2;
}
.auth-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted, #8a8a8a);
    margin-bottom: 0.1rem;
    line-height: 1.4;
}
.auth-accent-line {
    font-size: 0.76rem;
    color: var(--gold-accent);
    font-weight: 500;
    margin-bottom: 1.6rem;
}

/* ── GOOGLE BUTTON ── */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1.5px solid #e2ded6;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.79rem;
    font-weight: 500;
    color: #3d3d3d;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
    margin-bottom: 1.15rem;
    min-height: 46px;
}
.btn-google:hover {
    border-color: var(--gold-accent);
    background: #faf8f4;
    box-shadow: 0 2px 10px rgba(197,168,128,0.16);
}
.btn-google:focus-visible {
    outline: 2px solid var(--gold-accent);
    outline-offset: 2px;
}
.btn-google .google-svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── OR DIVIDER ── */
.auth-or {
    display: flex; align-items: center; gap: 0.65rem;
    margin-bottom: 1.15rem;
}
.auth-or::before, .auth-or::after {
    content: ''; flex: 1; height: 1px;
    background: #eee9e1;
}
.auth-or span {
    font-size: 0.6rem; color: #b7b2a9;
    letter-spacing: 0.09em; text-transform: uppercase;
    font-weight: 600;
}

/* ── FORM FIELDS ── */
.form-group   { margin-bottom: 1rem; }
.form-row-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }

.form-label {
    display: block;
    font-size: 0.6rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: #999; margin-bottom: 0.35rem;
}

.input-wrap { position: relative; }

.form-control {
    width: 100%;
    padding: 0.75rem 0.9rem 0.75rem 2.25rem;
    border: 1.5px solid #e6e2da;
    border-radius: 7px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-primary, #1a1a1a);
    background: #fcfbf9;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    min-height: 46px;
}
.form-control::placeholder { color: #c4c0b8; font-size: 0.8rem; }
.form-control:focus {
    border-color: var(--gold-accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(197,168,128,0.14);
}

.input-icon {
    position: absolute; left: 0.78rem; top: 50%;
    transform: translateY(-50%);
    color: #c9c4ba; font-size: 0.72rem;
    pointer-events: none; transition: color 0.2s ease;
}
.input-wrap:focus-within .input-icon { color: var(--gold-accent); }

.pw-toggle {
    position: absolute; right: 0.65rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: #c4c0b8; font-size: 0.75rem;
    cursor: pointer; padding: 0.4rem;
    transition: color 0.2s ease;
}
.pw-toggle:hover { color: var(--gold-accent); }
.pw-toggle:focus-visible { outline: 2px solid var(--gold-accent); outline-offset: 1px; border-radius: 4px; }

/* ── FORGOT LINK ── */
.link-forgot {
    font-size: 0.7rem; color: var(--text-muted, #999);
    text-decoration: none; transition: color 0.2s ease;
    flex-shrink: 0; margin-left: 1rem;
}
.link-forgot:hover { color: var(--gold-accent); }

/* ── TNC ROW ── */
.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.terms-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--gold-accent);
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

.terms-check label {
    font-size: 0.71rem;
    color: #999;
    line-height: 1.5;
    cursor: pointer;
}

.terms-check label a {
    color: var(--gold-accent);
    font-weight: 600;
    text-decoration: none;
}
.terms-check label a:hover { text-decoration: underline; }

/* ── SUBMIT BUTTON ── */
.btn-submit {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--gold-accent);
    color: var(--text-on-gold, #fff);
    border: none;
    border-radius: 7px;
    font-family: var(--font-sans);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    margin-top: 1.85rem;
    margin-bottom: 1rem;
    min-height: 48px;
}
.btn-submit:hover:not(:disabled) {
    background: var(--gold-hover);
    box-shadow: 0 6px 18px rgba(197,168,128,0.32);
}
.btn-submit:active:not(:disabled) { transform: scale(0.99); }
.btn-submit:focus-visible { outline: 2px solid var(--gold-accent); outline-offset: 2px; }
.btn-submit:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── SWITCH LINK ── */
.auth-switch { text-align: center; font-size: 0.74rem; color: #a3a3a3; }
.auth-switch a {
    color: var(--gold-accent); font-weight: 700;
    text-decoration: none; transition: color 0.2s ease;
}
.auth-switch a:hover { color: var(--gold-hover); text-decoration: underline; }

/* ══════════════════════════════════════════════════
   MOBILE / TABLET — video on top at a compact fixed
   height so the sign-in form is fully visible without
   excess scrolling, form straight below it.
   ══════════════════════════════════════════════════ */
@media (max-width: 860px) {

    .auth-page {
        height: auto;
        min-height: calc(100vh - var(--navbar-height));
        flex-direction: column;
        overflow: visible;
        background: #111214;
        position: relative;
    }

    /* Video stays fixed in place — page scroll does not move it */
    .auth-left {
        position: fixed;
        top: var(--navbar-height, 0);
        left: 0;
        width: 100%;
        height: 300px;
        z-index: 0;
        align-self: unset;
    }

    .auth-video-desktop { display: none; }
    .auth-video-mobile  { display: block; }

    /* Form panel sits in normal flow and slides up over the fixed video as the user scrolls */
    .auth-right {
        position: relative;
        z-index: 1;
        flex: none;
        margin-top: 260px;
        min-height: calc(100vh - var(--navbar-height) - 260px + 40px);
        padding: 2rem 1.25rem 2.25rem;
        align-items: flex-start;
        justify-content: center;
        overflow: visible;
        background: #ffffff;
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -12px 32px rgba(0,0,0,0.14);
    }

    .auth-form-box {
        max-width: 480px;
    }

    .form-row-2 { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 480px) {
    .auth-left { height: 260px; }
    .auth-right { margin-top: 220px; padding: 1.75rem 1rem 2rem; }
}