/* Pakum — telas públicas (login, cadastro, recuperação). Mobile-first. */
:root {
    --bg: #05070D;
    --bg-2: #0A0E1A;
    --panel: rgba(13, 18, 32, 0.78);
    --line: rgba(140, 170, 255, 0.12);
    --line-2: rgba(140, 170, 255, 0.24);
    --ink: #EAF0FF;
    --ink-2: #B7C2DE;
    --muted: #7F8BAD;
    --brand: #2563EB;
    --brand-2: #3B82F6;
    --brand-glow: rgba(37, 99, 235, 0.35);
    --ok: #10B981;
    --err: #F43F5E;
    --radius: 14px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body.auth {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Fundo */
.auth-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.auth-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 20%, transparent 75%);
    opacity: .55;
}
.auth-glow {
    position: absolute; width: 720px; height: 720px; left: -180px; top: -260px;
    background: radial-gradient(circle, var(--brand-glow), transparent 65%);
    filter: blur(20px);
}

.auth-shell {
    position: relative; z-index: 1;
    min-height: 100vh; min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
}

/* Coluna da marca (só desktop) */
.auth-brand { display: none; }

.auth-logo {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--ink); text-decoration: none;
    font-family: var(--display); font-weight: 700; letter-spacing: .14em; font-size: 15px;
}
.auth-logo img { object-fit: contain; }

/* Painel do formulário */
.auth-panel {
    display: flex; align-items: center; justify-content: center;
    padding: 28px 16px calc(28px + env(safe-area-inset-bottom));
}
.auth-card {
    width: 100%; max-width: 440px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px 22px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.auth-logo-mobile { margin-bottom: 22px; }
.auth-card h2 {
    font-family: var(--display); font-weight: 600;
    font-size: 26px; letter-spacing: -.02em; line-height: 1.15;
}
.auth-sub { color: var(--muted); margin-top: 6px; margin-bottom: 24px; }

/* Formulário */
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.field label {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px;
}
.field label a { font-weight: 500; }
.input-wrap { position: relative; }
.field input, .field select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background: rgba(5, 7, 13, .6);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    color: var(--ink);
    font: inherit;
    font-size: 16px; /* evita zoom no iOS */
    transition: border-color .15s, box-shadow .15s, background .15s;
    appearance: none; -webkit-appearance: none;
}
.field select {
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
    background-size: 5px 5px; background-repeat: no-repeat;
    padding-right: 34px;
}
.field input::placeholder { color: #4E5A7A; }
.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--brand-2);
    background: rgba(5, 7, 13, .85);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .18);
}
.field input[aria-invalid="true"] { border-color: var(--err); }
.field .hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.field .hint.err { color: var(--err); }
.toggle-pass {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    height: 32px; padding: 0 10px;
    background: transparent; border: 0; border-radius: 8px;
    color: var(--muted); font: 600 12px var(--font); cursor: pointer;
}
.toggle-pass:hover, .toggle-pass:focus-visible { color: var(--ink); background: rgba(255, 255, 255, .05); outline: none; }
.input-wrap input[type=password], .input-wrap input.has-toggle { padding-right: 84px; }

.phone-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.btn-primary {
    position: relative;
    width: 100%; height: 50px; margin-top: 8px;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    border: 0; border-radius: 12px; cursor: pointer;
    background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);
    color: #fff; font: 600 15px var(--font); letter-spacing: .01em;
    box-shadow: 0 10px 30px -10px var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, .2);
    transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 14px 36px -10px rgba(37, 99, 235, .55), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid #93C5FD; outline-offset: 3px; }
.btn-primary.is-loading { color: transparent; pointer-events: none; }
.btn-primary.is-loading::after {
    content: ''; position: absolute; width: 20px; height: 20px;
    border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-alt { margin-top: 22px; text-align: center; color: var(--muted); font-size: 14px; }

.auth-alert {
    padding: 12px 14px; border-radius: 12px; margin-bottom: 18px;
    font-size: 14px; border: 1px solid;
}
.auth-alert-error { background: rgba(244, 63, 94, .08); border-color: rgba(244, 63, 94, .35); color: #FDA4AF; }
.auth-alert-success { background: rgba(16, 185, 129, .08); border-color: rgba(16, 185, 129, .35); color: #6EE7B7; }
.auth-alert-info { background: rgba(59, 130, 246, .08); border-color: rgba(59, 130, 246, .35); color: #BFDBFE; }

.terms { font-size: 12px; color: var(--muted); margin-top: 14px; text-align: center; }

/* ---------- Tablet ---------- */
@media (min-width: 560px) {
    .auth-card { padding: 36px 34px; }
    .field-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- Desktop ---------- */
@media (min-width: 980px) {
    .auth-shell { grid-template-columns: minmax(0, 1.1fr) minmax(460px, .9fr); }
    .auth-logo-mobile { display: none; }
    .auth-brand {
        display: flex; flex-direction: column; justify-content: space-between;
        padding: 44px 56px; gap: 40px;
        border-right: 1px solid var(--line);
    }
    .auth-pitch { max-width: 640px; }
    .auth-kicker {
        display: inline-flex; align-items: center; gap: 8px;
        font: 500 12px var(--mono); letter-spacing: .16em; text-transform: uppercase;
        color: #93C5FD; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px;
        background: rgba(37, 99, 235, .08);
    }
    .auth-kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
    .auth-pitch h1 {
        font-family: var(--display); font-weight: 600;
        font-size: clamp(38px, 3.4vw, 54px); line-height: 1.04; letter-spacing: -.035em;
        margin: 22px 0 18px;
    }
    .auth-pitch h1 em {
        font-style: normal;
        background: linear-gradient(90deg, #60A5FA, #2563EB);
        -webkit-background-clip: text; background-clip: text; color: transparent;
    }
    .auth-lead { color: var(--ink-2); font-size: 17px; max-width: 460px; }
    .auth-proof { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 40px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
    .auth-proof li { background: rgba(10, 14, 26, .9); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
    .auth-proof strong { font-family: var(--display); font-weight: 600; font-size: 16px; }
    .auth-proof span { color: var(--muted); font-size: 13px; }
    .auth-ticker { display: flex; gap: 14px; font: 500 12px var(--mono); letter-spacing: .2em; color: #3E4A6B; }
    .auth-copy { color: #4E5A7A; font-size: 12px; }
    .auth-panel { padding: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
[hidden] { display: none !important; }
