/* ============================================================
   auth.css - shared styles for the member sign-in pages
   (login.php, forgotpassword.php, reset-password.php, register.php)
   Every colour is a CSS variable. The values are set from
   Admin > Login Page Design (authpages.php prints them in <head>).
   The defaults below are the VideoOSAI design.
   ============================================================ */
:root {
    --bg: #05070f;
    --card: rgba(12, 17, 34, 0.78);
    --field: #0a0f20;
    --field-focus: #0c1328;
    --line: rgba(148, 163, 255, 0.14);
    --line-hover: var(--line-hover);
    --text: #f1f5ff;
    --soft: var(--soft);
    --muted: #8b97b8;
    --faint: var(--faint);
    --hover-bg: var(--hover-bg);
    --grid: rgba(255, 255, 255, 0.035);
    --ok-text: #a7f3d0;
    --err-text: #fecdd3;
    --accent: #00e5ff;
    --accent-rgb: 0, 229, 255;
    --c1-rgb: 168, 85, 247;
    --c2-rgb: 14, 165, 233;
    --mid-rgb: 109, 107, 255;
    --glow1: #7c3aed;
    --glow2: #0284c7;
    --glow3: #00b8d9;
    --glow-opacity: 0.55;
    --brand: linear-gradient(120deg, #a855f7 0%, #6d6bff 45%, #0ea5e9 100%);
    --font: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --logo-width: 270px;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

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

html, body { min-height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Background: soft brand glows + faint film grid ---------- */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: var(--glow-opacity);
    animation: drift 18s ease-in-out infinite alternate;
}
.glow-1 { width: 560px; height: 560px; background: var(--glow1); top: -180px; left: -160px; }
.glow-2 { width: 520px; height: 520px; background: var(--glow2); bottom: -200px; right: -140px; animation-delay: -6s; }
.glow-3 { width: 300px; height: 300px; background: var(--glow3); top: 55%; left: 60%; opacity: 0.22; animation-delay: -12s; }
@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(40px, 30px) scale(1.08); }
}
.grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
            mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}

/* ---------- Layout ---------- */
.shell {
    width: 100%;
    max-width: 430px;
    animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.brand {
    display: flex;
    justify-content: center;
    margin-bottom: 26px;
}
.brand img {
    width: var(--logo-width);
    max-width: 78%;
    height: auto;
    filter: drop-shadow(0 6px 24px rgba(var(--accent-rgb), 0.18));
}

.card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 34px 32px 28px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow:
        var(--shadow),
        inset 0 1px 0 var(--hover-bg);
}
/* thin brand-gradient edge along the top of the card */
.card::before {
    content: '';
    position: absolute;
    top: -1px; left: 28px; right: 28px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand);
    box-shadow: 0 0 18px rgba(var(--mid-rgb), 0.7);
}

.card h1 {
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}
.card .lead {
    color: var(--muted);
    font-size: 0.98rem;
    margin-bottom: 26px;
}

/* ---------- Messages ---------- */
.msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.92rem;
    line-height: 1.5;
    border: 1px solid;
}
.msg svg { flex-shrink: 0; margin-top: 2px; }
.msg strong { display: block; font-weight: 600; }
.msg-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.35);
    color: var(--ok-text);
    animation: fadeIn 0.4s ease both;
}
.msg-error {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.4);
    color: var(--err-text);
    animation: shake 0.45s ease both;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ---------- Fields ---------- */
.field { margin-bottom: 18px; }
.field-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.field label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--soft);
}
.field-top a {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    opacity: 0.9;
}
.field-top a:hover { opacity: 1; text-decoration: underline; }

.input-wrap { position: relative; }
.input-wrap .icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--faint);
    pointer-events: none;
    transition: color 0.2s ease;
}
.input-wrap input {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 46px;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.input-wrap input::placeholder { color: var(--faint); }
.input-wrap input:hover { border-color: var(--line-hover); }
.input-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--field-focus);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}
.input-wrap:focus-within .icon { color: var(--accent); }
/* keep browser autofill on-theme */
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--field-focus) inset;
    caret-color: var(--text);
    transition: background-color 9999s ease 0s;
}

.toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--faint);
    cursor: pointer;
}
.toggle-pass:hover { color: var(--text); background: var(--hover-bg); }
.toggle-pass:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Button ---------- */
.login-btn {
    position: relative;
    width: 100%;
    height: 54px;
    margin-top: 8px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    background-size: 160% 100%;
    background-position: 0% 50%;
    color: #fff;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 12px 30px rgba(var(--mid-rgb), 0.35);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-position 0.4s ease;
}
.login-btn:hover {
    transform: translateY(-1px);
    background-position: 100% 50%;
    box-shadow: 0 16px 36px rgba(var(--c2-rgb), 0.4);
}
.login-btn:active { transform: translateY(0); }
.login-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.login-btn .play {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
}
.login-btn.loading { pointer-events: none; opacity: 0.85; }
.login-btn.loading .play { display: none; }
.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.login-btn.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer note ---------- */
.note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}
.note .badge {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.copyright {
    text-align: center;
    margin-top: 22px;
    font-size: 0.8rem;
    color: var(--faint);
}

@media (max-width: 480px) {
    body { padding: 24px 14px; align-items: flex-start; }
    .brand { margin: 12px 0 22px; }
    .brand img { width: 230px; }
    .card { padding: 28px 20px 22px; border-radius: 18px; }
    .card h1 { font-size: 1.45rem; }
}


/* ============================================================
   Shared extras for the other auth pages
   ============================================================ */
.hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 10px 26px rgba(var(--mid-rgb), 0.35);
}

/* Secondary (outline) button / link button */
.btn-ghost {
    width: 100%;
    height: 50px;
    margin-top: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--hover-bg);
    color: var(--text);
    font: inherit;
    font-size: 0.98rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.btn-ghost:hover { border-color: rgba(var(--accent-rgb), 0.45); background: rgba(var(--accent-rgb), 0.06); }
.btn-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a.login-btn { text-decoration: none; }

/* Numbered help steps */
.steps {
    list-style: none;
    counter-reset: step;
    margin: 4px 0 24px;
    display: grid;
    gap: 14px;
}
.steps li {
    counter-increment: step;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    color: var(--soft);
    font-size: 0.95rem;
    line-height: 1.5;
}
.steps li::before {
    content: counter(step);
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    margin-top: 1px;
}
.steps li strong { color: var(--text); font-weight: 600; }

/* Support ticket box */
.support {
    margin-top: 22px;
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(var(--c1-rgb), 0.10), rgba(var(--c2-rgb), 0.10));
    border: 1px solid var(--line-hover);
}
.support p {
    color: var(--soft);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 12px;
}
.support p strong { color: var(--text); font-weight: 600; }
.support a.support-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(var(--accent-rgb), 0.12);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}
.support a.support-btn:hover { background: rgba(var(--accent-rgb), 0.2); transform: translateY(-1px); }
.support a.support-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.note a, .back-link a { color: var(--accent); text-decoration: none; font-weight: 500; }
.note a:hover, .back-link a:hover { text-decoration: underline; }

.back-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.92rem;
    color: var(--muted);
}
.field-hint { color: var(--muted); font-size: 0.82rem; margin-top: 7px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- Additions for the design settings ---------- */
.brand-text { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; text-decoration: none; }
body.has-bg-image { background-size: cover; background-position: center; background-attachment: fixed; }
.preview-flag { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 50; background: rgba(0,0,0,.72); color: #fff; font-size: 12px; padding: 5px 12px; border-radius: 999px; font-family: system-ui, sans-serif; pointer-events: none; }
body.light .card::before { box-shadow: none; }
body.light .login-btn .play { background: rgba(255,255,255,.25); }
