/* ═══════════════════════════════════════════════
   VAGALUME TOTEM v2 — Login
   Noite no sertão: fundo profundo, vagalumes acesos
   ═══════════════════════════════════════════════ */
:root {
    --bg: #0A0D15;
    --panel: #11161F;
    --panel-2: #171E2B;
    --line: rgba(150, 168, 200, .14);
    --text: #ECEFF6;
    --mut: #8E9AAF;
    --fire: #FFC247;
    --fire-soft: rgba(255, 194, 71, .12);
    --err: #FF6B6B;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background:
        radial-gradient(900px 480px at 50% -10%, rgba(255, 194, 71, .05), transparent 60%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ============ Vagalumes pelo fundo ============ */
.night { position: fixed; inset: 0; pointer-events: none; }
.ff {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--fire);
    box-shadow: 0 0 10px 3px rgba(255, 194, 71, .4);
    opacity: 0;
    animation: blink 4.6s ease-in-out infinite;
    animation-delay: var(--d);
}
@keyframes blink {
    0%, 100% { opacity: 0; transform: translateY(0); }
    35% { opacity: .9; transform: translateY(-7px); }
    60% { opacity: .25; transform: translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) {
    .ff { animation: none; opacity: .4; }
    .firefly-dot { animation: none !important; }
}

/* ============ Card ============ */
.login-wrap { width: 100%; padding: 24px 16px; display: flex; justify-content: center; }
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 38px 28px 32px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
}
.firefly-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--fire);
    box-shadow: 0 0 12px 4px rgba(255, 194, 71, .5);
    animation: firefly 3.2s ease-in-out infinite;
}
@keyframes firefly {
    0%, 100% { box-shadow: 0 0 12px 4px rgba(255, 194, 71, .5); }
    50% { box-shadow: 0 0 20px 7px rgba(255, 194, 71, .25); opacity: .8; }
}
.login-logo h1 {
    font-family: 'Sora', sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: .18em;
    color: var(--fire);
}
.logo-sub {
    font-size: 11px;
    letter-spacing: .55em;
    color: var(--mut);
    font-weight: 600;
    margin-left: .55em;
}

/* ============ Form ============ */
.form-group { margin-bottom: 16px; display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--mut); }
.form-group input {
    width: 100%;
    background: var(--panel-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 14px 16px;
    min-height: 50px;
    border-radius: 13px;
    font-size: 16px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus {
    border-color: var(--fire);
    box-shadow: 0 0 0 3px var(--fire-soft);
}
.form-group input::placeholder { color: #4A5468; }

.error-msg {
    background: rgba(255, 107, 107, .1);
    border: 1px solid rgba(255, 107, 107, .35);
    color: var(--err);
    font-size: 13px;
    font-weight: 500;
    padding: 11px 14px;
    border-radius: 11px;
    margin-bottom: 14px;
}

#loginBtn {
    width: 100%;
    min-height: 52px;
    background: var(--fire);
    color: #1A1405;
    border: none;
    border-radius: 13px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter .15s, transform .06s;
    margin-top: 6px;
}
#loginBtn:active { transform: scale(.985); filter: brightness(.92); }
#loginBtn:disabled { opacity: .7; cursor: wait; }

.btn-loader {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(26, 20, 5, .3);
    border-top-color: #1A1405;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

:focus-visible { outline: 2px solid var(--fire); outline-offset: 2px; }
