/* ============================================================
   LOGIN PAGE
   Reuses the same chrome as the checkout page (shared navbar,
   full-page SVG background, no footer). The login modal sits
   centered in the viewport — content-driven height, fixed
   ~573px width on desktop, fluid on smaller viewports.
   ============================================================ */

/* Lock scrolling on the login page at desktop sizes. The modal is
 * short and the design is one-viewport — there's no content below
 * the fold to scroll to. Below 768px the modal can grow taller than
 * the viewport (full-width buttons, options form fields, on-screen
 * keyboard, address-bar overlay) so scroll MUST be re-enabled there
 * or content is trapped off-screen. login.css is the only stylesheet
 * on this page, so targeting html/body here doesn't leak elsewhere. */
@media (min-width: 768px) {
    html,
    body {
        height: 100vh;
        overflow: hidden;
    }
}

/* ──────────── FULL-PAGE BACKGROUND ──────────── */
/* Same recipe as checkout.css: a fixed full-bleed GTA image, dimmed
 * by a top-down navy veil so the centered modal stays readable.
 * (login.css is the only stylesheet this page loads, so we redeclare
 * the bg rules here rather than depending on checkout.css.) */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.login-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
.login-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #0F121B 0%, rgba(3, 8, 21, 0.82) 40%, rgba(15, 18, 27, 0.85) 100%);
    pointer-events: none;
}

/* ──────────── PAGE CONTAINER ──────────── */
/* Fills the viewport and centers the modal both axes. Top padding
 * accounts for the fixed navbar. */
.login-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    box-sizing: border-box;
    padding: 25px clamp(20px, 6vw, 96px) 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ──────────── MODAL ──────────── */
.login-modal {
    width: 100%;
    max-width: 573px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 56px;
    color: #fff;
}

/* ─── Intro: decorative dots + title + subtitle ─── */
.login-modal__intro {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    isolation: isolate;
}

/* Soft white glow behind the title (Figma: 296×26 blurred ellipse) */
.login-modal__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 296px;
    height: 26px;
    transform: translate(-50%, -30%);
    background: rgba(255, 255, 255, 0.85);
    border-radius: 9999px;
    filter: blur(75px);
    pointer-events: none;
    z-index: -1;
}

.login-modal__dots {
    display: inline-flex;
    align-items: flex-end;
    gap: 8px;
}
.login-modal__dot {
    border-radius: 5px;
    background: rgba(250, 64, 57, 0.5);
}
.login-modal__dot--small {
    width: 20px;
    height: 20px;
}
.login-modal__dot--large {
    width: 25px;
    height: 25px;
    background: #FA4039;
}

.login-modal__intro-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.login-modal__title {
    margin: 0;
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 500;
    font-size: 48px;
    line-height: 1.1;
    color: #fff;
}

.login-modal__subtitle {
    margin: 0;
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.45);
    max-width: 50ch;
}

/* ─── Dashed divider (Figma: 1.915px stroke, white-15%) ─── */
.login-modal__divider {
    align-self: stretch;
    height: 0;
    border-top: 1.9px dashed rgba(255, 255, 255, 0.15);
}

/* ─── Provider section (header + two buttons) ─── */
.login-modal__providers {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-modal__provider-header {
    display: flex;
    align-items: flex-start;
    gap: 19px;
}

.login-modal__provider-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #FA4039;
}
.login-modal__provider-icon img,
.login-modal__provider-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.login-modal__provider-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.login-modal__provider-title {
    margin: 0;
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 500;
    font-size: 26.81px;
    line-height: 1.1;
    color: #fff;
}

.login-modal__provider-subtitle {
    margin: 0;
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 400;
    font-size: 13.4px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.45);
}

/* ─── IGN form fallback (only when external is false) ─── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 4px;
}
.login-form__label {
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}
.login-form__input {
    height: 52px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(197, 211, 254, 0.15);
    background: rgba(15, 18, 27, 0.4);
    color: #fff;
    font-family: "GTA Art Deco", sans-serif;
    font-size: 16px;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.login-form__input::placeholder { color: rgba(255, 255, 255, 0.30); }
.login-form__input:focus {
    border-color: rgba(250, 64, 57, 0.5);
    background: rgba(15, 18, 27, 0.6);
}
.login-btn--full { flex: none; width: 100%; }

/* <input type="submit"> doesn't honor display:inline-flex, resets
 * its own font, and uses content-box sizing — without these
 * overrides the Continue button on the options page renders
 * smaller and narrower than the surrounding .login-btn anchors.
 * The display:block + explicit min-height keeps the input the
 * same 52px tall as its sibling anchors regardless of UA padding. */
input.login-btn {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 52px;
    min-height: 52px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 52px;
    text-align: center;
    cursor: pointer;
}
input.login-btn--fivem {
    color: rgba(0, 0, 0, 0.75);
}

/* ─── Package options form (rendered by options.html) ───
 * Reuses .login-form__input styling for text inputs; selects
 * inherit the same look. Fields stack vertically with consistent
 * spacing; the submit button at the end uses .login-btn--fivem
 * (white primary). */
.options-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.options-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.options-field__label {
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
}
.options-field__select.login-form__input {
    /* Keep the height/border/bg from .login-form__input but layout
     * the native select's caret a bit better. */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.55) 50%),
                      linear-gradient(-45deg, transparent 50%, rgba(255,255,255,0.55) 50%);
    background-position: right 18px center, right 13px center;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    background-color: rgba(15, 18, 27, 0.4);
}
.options-field__select option {
    background: #0F121B;
    color: #fff;
}
.options-field__input--readonly {
    cursor: default;
    color: rgba(255, 255, 255, 0.7);
}

/* Subtle hint shown after Discord auth has been captured. */
.options-form__hint {
    margin: 8px 0 0;
    text-align: center;
    font-family: "GTA Art Deco", sans-serif;
    font-size: 13px;
    color: rgba(45, 255, 122, 0.85);
}
.options-form__hint strong { color: #2DFF7B; font-weight: 500; }

/* Vertical rhythm inside the options form — leaves a breathable
 * gap between the Discord login button group and the Continue
 * submit underneath. */
.login-modal__providers form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ─── Provider buttons row ─── */
.login-modal__buttons {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.login-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 52px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-radius: 12px;
    text-decoration: none;
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: filter 0.18s ease, background 0.18s ease;
}

.login-btn__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.login-btn__icon svg { display: block; }

/* FiveM mark rendered as a real <img>. The earlier CSS-mask approach
 * (background + mask: var(--asset-fivem-mask)) was unreliable through
 * Tebex's CDN — the mask URL would resolve, but Firefox's strict
 * cross-origin handling sometimes failed to apply it. A direct img
 * always renders. */
.login-btn__icon--fivem {
    width: 21px;
    height: 28px;
    margin-right: 5px;
}
.login-btn__icon--fivem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* White solid (FiveM) — same recipe as .checkout-cta so the primary
 * action looks consistent across the storefront. The FiveM PNG has
 * a bit of internal transparent padding, so we pull the label
 * closer with a tighter gap override. */
.login-btn--fivem {
    background: radial-gradient(ellipse 77.46% 320.85% at 50% 50%, #E1E1E1 0%, #FFFFFF 100%);
    color: rgba(0, 0, 0, 0.75);
    gap: 2px;
}
.login-btn--fivem .login-btn__icon { color: rgba(0, 0, 0, 0.75); }
.login-btn--fivem:hover { filter: brightness(0.97); }

/* Outlined transparent (Discord) */
.login-btn--discord {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(197, 211, 254, 0.15);
}
.login-btn--discord .login-btn__icon { color: #fff; }
.login-btn--discord:hover { background: rgba(255, 255, 255, 0.05); }

/* ──────────── RESPONSIVE ──────────── */
/* Tablet + small laptop (768–991px). Buttons stay side-by-side but
 * the row's allowed to wrap when labels + icons would otherwise be
 * squeezed below their natural width. Eliminates the "shrinked"
 * look at intermediate widths. */
@media (max-width: 991px) {
    .login-page {
        padding: 32px clamp(20px, 5vw, 64px) 48px;
    }
    .login-modal { gap: 40px; }
    .login-modal__buttons { flex-wrap: wrap; }
    /* Make each button take a full row whenever the row is forced to
     * wrap, so they stack as full-width pills instead of half-width
     * stubs. min-content so a single button still occupies the row. */
    .login-btn { flex: 1 1 240px; }
}

/* Phone (≤767px). Modal content fits the viewport at typical phone
 * heights (intro + divider + provider header + 1–2 buttons), so we
 * keep `align-items: center` for vertical centering — but with extra
 * top padding to clear the floating mobile hamburger + announce bar
 * underneath, and reduced type/gaps so it actually fits. */
@media (max-width: 767px) {
    .login-page {
        padding: 0 16px 32px;
    }
    .login-modal { gap: 28px; }
    .login-modal__intro { gap: 16px; }
    .login-modal__title { font-size: 32px; }
    .login-modal__subtitle { font-size: 15px; line-height: 1.4; }
    .login-modal__provider-header { gap: 14px; align-items: center; }
    .login-modal__provider-title { font-size: 22px; }
    .login-modal__provider-subtitle { font-size: 13px; }
    .login-modal__providers { gap: 16px; }
    /* Drop flex on the button row at phone widths: a single button
     * inside a flex container ends up sized by flex-basis math, which
     * can come out a hairline narrower than a sibling Continue input
     * that's a direct flex child of the form (column-stretch). Plain
     * block layout makes the wrapper transparent to width — the inner
     * .login-btn just inherits the form column's full stretch width,
     * matching the Continue button exactly. */
    .login-modal__buttons {
        display: block;
        align-self: stretch;
    }
    .login-modal__buttons > .login-btn + .login-btn {
        margin-top: 10px;
    }
    .login-btn {
        box-sizing: border-box;
        width: 100%;
        flex: 0 0 auto;
        font-size: 16px;
    }
    input.login-btn { font-size: 16px; }
}

/* Very small phones (≤380px). Keep title from overflowing the
 * 16px gutters; long words like "Production-ready" get hyphenated
 * if they'd otherwise blow out the modal. */
@media (max-width: 380px) {
    .login-modal__title { font-size: 28px; }
    .login-modal__provider-title { font-size: 20px; }
    .login-modal__subtitle,
    .login-modal__provider-subtitle {
        overflow-wrap: anywhere;
    }
}
