/* ═══════════════════════════════════════════════════════
   CORRERIA — Sistema de autenticação
   Compartilhado por login, cadastro, esqueci_senha, resetar_senha
   ═══════════════════════════════════════════════════════ */

:root {
    --auth-bg: #050505;
    --auth-bg-2: #0a0c14;
    --auth-surface: #0f1119;
    --auth-surface-2: #1a1d28;
    --auth-border: rgba(255,255,255,0.07);
    --auth-border-strong: rgba(255,255,255,0.14);
    --auth-gold: #FACC15;
    --auth-gold-dim: rgba(250,204,21,0.12);
    --auth-gold-border: rgba(250,204,21,0.28);
    --auth-text: #f0f2f8;
    --auth-text-2: rgba(240,242,248,0.62);
    --auth-text-3: rgba(240,242,248,0.4);
    --auth-text-4: rgba(240,242,248,0.28);
    --auth-green: #34c759;
    --auth-danger: #ff453a;
    --r-md: 10px;
    --r-lg: 16px;
    --r-xl: 22px;
    --r-2xl: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    min-height: 100%;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ─── Split screen ─── */
.auth-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    position: relative;
}
@media (min-width: 920px) {
    .auth-shell { grid-template-columns: minmax(0, 1.05fr) minmax(420px, 1fr); }
}

/* Top accent line (brand) */
.auth-shell::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--auth-gold) 0%, rgba(250,204,21,0.2) 60%, transparent 100%);
    z-index: 100;
}

/* ─── BRAND PANEL (left, desktop) ─── */
.auth-brand-panel {
    display: none;
    position: relative;
    background: var(--auth-bg-2);
    overflow: hidden;
    padding: 56px 56px 48px;
    border-right: 1px solid var(--auth-border);
}
@media (min-width: 920px) {
    .auth-brand-panel { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
}

/* Background depth */
.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: 20%; left: -10%;
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(250,204,21,0.08) 0%, transparent 65%);
    filter: blur(70px);
    pointer-events: none;
    z-index: 1;
}
.auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -10%; right: -15%;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(255,255,255,0.025) 0%, transparent 60%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 1;
}

.auth-brand-panel > * { position: relative; z-index: 2; }

/* Logo (image) */
.auth-brand-logo {
    display: inline-block;
    height: auto;
    width: clamp(180px, 24vw, 240px);
    filter: drop-shadow(0 0 28px rgba(250,204,21,0.22));
    user-select: none;
    -webkit-user-drag: none;
}

.auth-brand-tagline {
    margin-top: 14px;
    font-size: 1.02rem;
    color: var(--auth-text-2);
    max-width: 38ch;
    line-height: 1.55;
    font-weight: 500;
}

/* Preview painel: small dashboard widget */
.auth-preview {
    background: linear-gradient(180deg, var(--auth-surface) 0%, var(--auth-bg) 100%);
    border: 1px solid var(--auth-border);
    border-top-color: var(--auth-border-strong);
    border-radius: var(--r-xl);
    padding: 24px;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
    max-width: 380px;
}

.auth-preview-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}
.auth-preview-live {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--auth-green);
    box-shadow: 0 0 10px var(--auth-green);
    animation: authPulse 1.6s ease-in-out infinite;
}
@keyframes authPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}
.auth-preview-kicker {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--auth-text-3);
    text-transform: uppercase;
}

.auth-preview-value {
    font-family: 'Permanent Marker', cursive;
    font-size: 3.2rem;
    color: var(--auth-gold);
    line-height: 1;
    margin-bottom: 4px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.4);
}
.auth-preview-label {
    font-size: 0.78rem;
    color: var(--auth-text-3);
    font-weight: 600;
    margin-bottom: 20px;
}

.auth-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-border);
}
.auth-preview-cell { display: grid; gap: 4px; }
.auth-preview-cell-lbl {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 800;
    color: var(--auth-text-4);
}
.auth-preview-cell-val {
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--auth-text);
}
.auth-preview-cell-val.positive { color: var(--auth-gold); }

/* Value props list */
.auth-bullets {
    list-style: none;
    display: grid;
    gap: 12px;
}
.auth-bullets li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    color: var(--auth-text-2);
    font-weight: 500;
}
.auth-bullets li i {
    color: var(--auth-gold);
    font-size: 0.86rem;
    width: 22px;
    height: 22px;
    background: var(--auth-gold-dim);
    border: 1px solid var(--auth-gold-border);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ─── FORM PANEL (right, also mobile) ─── */
.auth-form-panel {
    position: relative;
    background: var(--auth-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    min-height: 100dvh;
}
.auth-form-panel::before {
    content: '';
    position: absolute;
    bottom: 10%; right: 10%;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(250,204,21,0.04) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    background: rgba(15,17,25,0.72);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--auth-border);
    border-top-color: var(--auth-border-strong);
    border-radius: var(--r-2xl);
    padding: 38px 32px 32px;
    box-shadow:
        0 30px 60px -15px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Mobile-only brand (when brand panel is hidden) */
.auth-mobile-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 28px;
    text-decoration: none;
}
.auth-mobile-brand .auth-brand-logo { width: 150px; filter: drop-shadow(0 0 18px rgba(250,204,21,0.2)); }
.auth-mobile-brand .auth-mobile-tag {
    font-size: 0.78rem;
    color: var(--auth-text-3);
    font-weight: 500;
}
@media (min-width: 920px) {
    .auth-mobile-brand { display: none; }
}

/* Card header */
.auth-head { margin-bottom: 24px; }
.auth-eyebrow {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--auth-gold);
    margin-bottom: 8px;
}
.auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--auth-text);
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.auth-subtitle {
    margin-top: 8px;
    color: var(--auth-text-3);
    font-size: 0.88rem;
    line-height: 1.55;
}

/* Alerts */
.auth-alert {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.auth-alert.is-error {
    background: rgba(255,69,58,0.08);
    border: 1px solid rgba(255,69,58,0.25);
    color: var(--auth-danger);
}
.auth-alert.is-success {
    background: rgba(52,199,89,0.08);
    border: 1px solid rgba(52,199,89,0.25);
    color: var(--auth-green);
}
.auth-alert.is-info {
    background: var(--auth-gold-dim);
    border: 1px solid var(--auth-gold-border);
    color: var(--auth-gold);
}
.auth-alert i { flex-shrink: 0; margin-top: 2px; }

/* Logout success banner (login) */
.auth-logout-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(52,199,89,0.08);
    border: 1px solid rgba(52,199,89,0.22);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
    animation: authSlideDown 0.4s ease-out;
}
.auth-logout-banner i.banner-icon {
    color: var(--auth-green);
    font-size: 1.4rem;
    flex-shrink: 0;
}
.auth-logout-banner-text { flex: 1; line-height: 1.35; }
.auth-logout-banner-text strong { display: block; color: #fff; font-size: 0.86rem; font-weight: 800; }
.auth-logout-banner-text span { color: var(--auth-text-3); font-size: 0.76rem; }
.auth-logout-banner button {
    background: none;
    border: none;
    color: var(--auth-text-4);
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s;
}
.auth-logout-banner button:hover { color: var(--auth-text); }
@keyframes authSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Floating label field */
.auth-field {
    position: relative;
    margin-bottom: 14px;
}
.auth-field-input {
    width: 100%;
    height: 56px;
    padding: 22px 16px 8px 46px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--auth-border);
    border-radius: var(--r-md);
    color: var(--auth-text);
    font-size: 0.95rem;
    font-weight: 500;
    transition: border-color 0.18s, background 0.18s;
    outline: none;
}
.auth-field-input::placeholder { color: transparent; }
.auth-field-input:hover { border-color: var(--auth-border-strong); }
.auth-field-input:focus { border-color: var(--auth-gold); background: rgba(255,255,255,0.04); }
.auth-field-input:autofill,
.auth-field-input:-webkit-autofill {
    -webkit-text-fill-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 1000px rgba(15,17,25,1) inset;
    caret-color: var(--auth-text);
    border-color: var(--auth-border-strong);
}

.auth-field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-3);
    font-size: 0.92rem;
    transition: color 0.18s;
    pointer-events: none;
}
.auth-field-input:focus ~ .auth-field-icon { color: var(--auth-gold); }

.auth-field-label {
    position: absolute;
    top: 50%;
    left: 46px;
    transform: translateY(-50%);
    color: var(--auth-text-3);
    font-size: 0.92rem;
    pointer-events: none;
    transition: top 0.18s, font-size 0.18s, color 0.18s;
    padding: 0 4px;
    background: transparent;
}
.auth-field-input:focus ~ .auth-field-label,
.auth-field-input:not(:placeholder-shown) ~ .auth-field-label {
    top: 11px;
    transform: translateY(0);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--auth-text-3);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.auth-field-input:focus ~ .auth-field-label { color: var(--auth-gold); }

.auth-field-action {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-3);
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}
.auth-field-action:hover { color: var(--auth-text); background: rgba(255,255,255,0.05); }

/* Helper text under field */
.auth-field-help {
    font-size: 0.74rem;
    color: var(--auth-text-3);
    margin-top: -8px;
    margin-bottom: 14px;
    padding-left: 4px;
    line-height: 1.45;
}

/* Forgot link */
.auth-forgot {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--auth-text-3);
    font-weight: 600;
    margin: -6px 0 18px;
    transition: color 0.15s;
}
.auth-forgot:hover { color: var(--auth-gold); }

/* Submit */
.auth-submit {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: var(--r-md);
    background: var(--auth-gold);
    color: #111;
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.1s, box-shadow 0.18s, opacity 0.15s;
    box-shadow: 0 12px 32px -10px rgba(250,204,21,0.5);
}
.auth-submit:hover { box-shadow: 0 16px 40px -8px rgba(250,204,21,0.55); }
.auth-submit:active { transform: scale(0.985); }
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.auth-submit .auth-submit-icon { font-size: 0.86rem; transition: transform 0.15s; }
.auth-submit:hover .auth-submit-icon { transform: translateX(3px); }

/* Divider "ou" */
.auth-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
}
.auth-or::before, .auth-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}
.auth-or span {
    font-size: 0.74rem;
    color: var(--auth-text-3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Google button wrap */
.auth-google {
    display: flex;
    justify-content: center;
    min-height: 44px;
    width: 100%;
    overflow: hidden;
}
.auth-google iframe { color-scheme: light; }

/* Footer (switch between login/cadastro) */
.auth-foot {
    margin-top: 24px;
    text-align: center;
    font-size: 0.84rem;
    color: var(--auth-text-3);
}
.auth-foot a {
    color: var(--auth-gold);
    font-weight: 700;
    transition: opacity 0.15s;
}
.auth-foot a:hover { opacity: 0.82; }

/* Back link (esqueci_senha, resetar_senha) */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--auth-text-3);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 18px;
    transition: color 0.15s;
}
.auth-back:hover { color: var(--auth-text); }
.auth-back i { font-size: 0.7rem; }

/* Legal footer */
.auth-legal {
    margin-top: 18px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--auth-text-4);
    line-height: 1.5;
}
.auth-legal a { color: var(--auth-text-3); text-decoration: underline; text-decoration-thickness: 1px; }
.auth-legal a:hover { color: var(--auth-text-2); }

/* Mobile spacing tweaks */
@media (max-width: 600px) {
    .auth-card { padding: 28px 22px; border-radius: 20px; }
    .auth-title { font-size: 1.4rem; }
    .auth-form-panel { padding: 24px 16px; }
}
