/* ---------------------------------------------------------------
   auth.css  —  Auth pages (login / register / forgot / reset / 2fa)
   Scoped to .auth-wrap and .auth-card. Uses theme CSS variables only.
   Created by ESAGAMES HOSTING SHIELD SRL
   v4 — pixel-perfect visual polish pass
--------------------------------------------------------------- */

/* ============================================================
   WRAP & CARD
   ============================================================ */

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 16px;
    position: relative;
    overflow: hidden;
    /* Subtle grid background */
    background-image:
        linear-gradient(rgba(var(--primary-rgb),.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--primary-rgb),.05) 1px, transparent 1px);
    background-size: 46px 46px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    /* Top glow accent via inset box-shadow (works with border-radius) */
    box-shadow: var(--shadow), inset 0 3px 0 0 var(--primary, #7c5cff);
    padding: 36px 36px 32px;
    /* Subtle top gradient accent for visual depth */
    background-image: linear-gradient(
        to bottom,
        rgba(var(--primary-rgb),.04) 0%,
        transparent 120px
    );
    /* Entrance animation — respects prefers-reduced-motion via the class */
    animation: auth-slide-up 0.4s cubic-bezier(.2,.7,.2,1) both;
}

@keyframes auth-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes auth-slide-right {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Brand logo row */
.auth-card .brand {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 22px;
}

.auth-card .brand-logo {
    height: 36px;
    width: auto;
}

/* Page heading */
.auth-card h1 {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 6px;
    color: var(--text);
}

/* Sub-heading / descriptor */
.auth-card .sub {
    text-align: center;
    color: var(--text-mute);
    font-size: 14px;
    margin: 0 0 26px;
    line-height: 1.5;
}

/* Flash message spacing */
.auth-card .alert {
    margin-top: 16px;
    margin-bottom: 4px;
}

/* ============================================================
   FORM GROUPS & INPUTS
   ============================================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-group:last-of-type {
    margin-bottom: 0;
}

.form-group label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-dim);
}

/* ============================================================
   OAUTH BUTTONS — social login row below brand/header
   ============================================================ */

.oauth-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    transition: background 0.18s, border-color 0.18s, transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}
.oauth-btn:hover {
    background: var(--surface-3);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}

/* Provider-specific accent colours */
.oauth-btn.oauth-steam:hover  { border-color: #66c0f4; box-shadow: 0 4px 14px rgba(102,192,244,.18); }
.oauth-btn.oauth-discord:hover { border-color: #5865f2; box-shadow: 0 4px 14px rgba(88,101,242,.18); }
.oauth-btn.oauth-google:hover  { border-color: #4285f4; box-shadow: 0 4px 14px rgba(66,133,244,.18); }

/* Base input — larger tap target, comfortable on mobile */
.input {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    /* 16px minimum prevents iOS zoom-in on focus */
    font-size: 16px;
    padding: 12px 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
}

.input::placeholder {
    color: var(--text-mute);
    font-size: 14px;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
    background: var(--surface-3);
}

.input:invalid:not(:placeholder-shown) {
    border-color: var(--pink);
}

/* Number input — hide native spinners (captcha field) */
.input[type="number"]::-webkit-inner-spin-button,
.input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.input[type="number"] {
    -moz-appearance: textfield;
}

/* ============================================================
   DIVIDER SEPARATOR
   ============================================================ */

.oauth-sep {
    text-align: center;
    font-size: 12px;
    color: var(--text-mute);
    position: relative;
    margin: 4px 0 16px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.oauth-sep::before,
.oauth-sep::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 24px);
    height: 1px;
    background: var(--border);
}
.oauth-sep::before { left: 0; }
.oauth-sep::after  { right: 0; }

/* ============================================================
   REMEMBER ME + FORGOT PASSWORD ROW
   ============================================================ */

.auth-row-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-mute);
    user-select: none;
}

.auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-forgot {
    font-size: 14px;
    color: var(--primary-2);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.auth-forgot:hover {
    color: #fff;
}

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    letter-spacing: 0.01em;
}

/* ============================================================
   2FA CODE INPUT — big, centered, finger-friendly
   ============================================================ */

.input-2fa {
    text-align: center;
    font-size: clamp(24px, 8vw, 32px);
    font-weight: 800;
    letter-spacing: clamp(4px, 2vw, 10px);
    padding: 16px 14px;
    border-radius: 12px;
    font-variant-numeric: tabular-nums;
    background: var(--surface-3);
    /* Stronger focus ring for the critical 2FA input */
}
.input-2fa:focus {
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.28), var(--ring);
}

/* Timer hint below the code input */
.twofa-hint {
    display: block;
    text-align: center;
    color: var(--text-mute);
    font-size: 12.5px;
    margin-top: 8px;
}

/* ============================================================
   HELP TEXT (small hints below inputs)
   ============================================================ */

.input-help {
    font-size: 12px;
    color: var(--text-mute);
    line-height: 1.45;
    display: block;
    margin-top: 4px;
}

/* ============================================================
   FOOTER LINK ROW
   ============================================================ */

.auth-foot {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-mute);
    line-height: 1.55;
}

.auth-foot a {
    color: var(--primary-2);
    font-weight: 600;
    text-decoration: none;
}

.auth-foot a:hover {
    color: #fff;
}

/* Terms line at very bottom of register */
.auth-terms {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-mute);
    margin-top: 20px;
    line-height: 1.55;
}

/* ============================================================
   OAUTH DIVIDER (already in partials/oauth.php)
   ============================================================ */

/* Make sure the oauth block has breathing room */
.oauth-wrap {
    margin-bottom: 22px;
}

/* ============================================================
   DESKTOP ENHANCEMENT — 1024 px and above
   ============================================================ */

@media (min-width: 1024px) {
    /* Single centered card (no left/right split) — big & centered on screen */
    .auth-wrap {
        padding: 48px 20px;
        /* Soft accent glow from the top + subtle grid, full-width behind the card */
        background-image:
            radial-gradient(1000px 520px at 50% -200px, rgba(var(--primary-rgb),.10), transparent 70%),
            linear-gradient(rgba(var(--primary-rgb),.04) 1px, transparent 1px),
            linear-gradient(90deg, rgba(var(--primary-rgb),.04) 1px, transparent 1px);
        background-size: auto, 46px 46px, 46px 46px;
    }

    /* No decorative left panel */
    .auth-wrap::before { content: none; display: none; }

    .auth-card {
        max-width: 480px;
        margin: 0 auto;
        /* Slightly more generous padding on desktop */
        padding: 44px 44px 40px;
    }

    .auth-card h1 {
        font-size: 28px;
    }

    .auth-card .sub {
        font-size: 15px;
        margin-bottom: 28px;
    }

    /* Inputs: slightly taller on desktop for better ergonomics */
    .input {
        padding: 13px 16px;
        border-radius: 11px;
    }

    .btn-block {
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 11px;
        /* Lift effect on hover for desktop (pointer:fine only) */
        transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.18s ease, border-color 0.18s ease;
    }

    .btn-block:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(var(--primary-rgb),.35);
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        font-size: 14px;
    }

    /* Larger 2FA input on desktop */
    .input-2fa {
        font-size: clamp(28px, 5vw, 36px);
    }
}

/* ============================================================
   RESPONSIVE — 480 px (small phones)
   ============================================================ */

@media (max-width: 480px) {
    .auth-wrap {
        /* Single padding shorthand — no conflicting padding-top */
        padding: 36px 12px 24px;
        /* Remove grid-pattern on tiny screens to save paint */
        background-image: none;
        background-color: var(--bg-0);
        align-items: flex-start;
    }

    .auth-card {
        padding: 28px 20px 24px;
        border-radius: 16px;
        /* Full width on narrow phones */
        max-width: 100%;
    }

    .auth-card h1 {
        font-size: 21px;
    }

    .auth-card .sub {
        font-size: 13.5px;
        margin-bottom: 20px;
    }

    .input {
        padding: 13px 12px;
    }

    .btn-block {
        padding: 14px 16px;
        font-size: 15px;
    }

    .auth-row-split {
        flex-direction: column;
        align-items: flex-start;
    }

    /* OAuth buttons: ensure they never overflow card */
    .oauth-btn {
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* ============================================================
   RESPONSIVE — 360 px (very small phones)
   ============================================================ */

@media (max-width: 360px) {
    .auth-wrap {
        padding: 20px 8px 20px;
    }

    .auth-card {
        padding: 20px 14px 18px;
    }

    .auth-card h1 {
        font-size: 19px;
    }

    .auth-card .sub {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .input-2fa {
        letter-spacing: 4px;
        font-size: 24px;
    }

    .oauth-btn {
        font-size: 12px;
        padding: 9px 10px;
    }

    .oauth-sep {
        font-size: 11px;
    }
}

/* ============================================================
   PREFERS-REDUCED-MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none;
    }

    .input,
    .auth-forgot,
    .btn-block {
        transition: none !important;
    }
}
