:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --border: #e9ecef;
    --border-strong: #ced4da;
    --muted: #6c757d;
    --text-2: #343a40;
    --text: #212529;
    --black: #000000;
    --placeholder: #adb5bd;
    --input-bg: #f8f9fa;
    --radius: 12px;
    --radius-lg: 24px;
    --shadow-card: 0 30px 80px -30px rgba(0,0,0,0.25);
    --shadow-black: 0 10px 25px -8px rgba(0,0,0,0.35);
}

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

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ============ FUNDO ANIMADO ============ */
.bg-blobs {
    position: fixed; inset: 0;
    z-index: 0; pointer-events: none;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    background: rgba(0,0,0,0.06);
    animation: blob 14s ease-in-out infinite;
}
.blob-1 { width: 520px; height: 520px; top: -160px; left: -160px; }
.blob-2 { width: 480px; height: 480px; top: 33%; right: -128px; animation-delay: 2s; background: rgba(0,0,0,0.05); }
.blob-3 { width: 420px; height: 420px; bottom: 0; left: 33%; animation-delay: 4s; background: rgba(0,0,0,0.04); }

.bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    opacity: 0.04;
    background-image:
        linear-gradient(rgba(0,0,0,.9) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,.9) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
            mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
}

@keyframes blob {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(40px,-30px) scale(1.1); }
    66% { transform: translate(-30px,30px) scale(.95); }
}

/* ============ LAYOUT ============ */
.page {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 2.5rem 1.5rem;
    align-items: stretch;
}
@media (min-width: 960px) {
    .page {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        padding: 4rem 2rem;
    }
}

/* ============ MARCA ============ */
.brand-panel {
    display: flex; flex-direction: column; justify-content: space-between;
    order: 2;
    animation: fadeIn .7s ease-out both;
}
@media (min-width: 960px) { .brand-panel { order: 1; } }

.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: inherit; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--black); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-black);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; text-transform: uppercase; color: var(--black); }
.brand-name em { font-style: normal; color: var(--muted); }

.brand-hero { margin: 3rem 0; }
.brand-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700; line-height: 1.05; letter-spacing: -.03em; color: var(--black);
}
.grad-text {
    background: linear-gradient(90deg, #6c757d, #343a40, #000);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-hero > p {
    margin-top: 1.25rem; max-width: 28rem;
    font-size: 1.05rem; color: var(--muted); line-height: 1.55;
}

/* Card de estatísticas flutuante */
.stats-card {
    margin-top: 2rem; max-width: 22rem;
    background: rgba(255,255,255,.7);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 18px; padding: 1.25rem;
    box-shadow: 0 10px 40px -15px rgba(0,0,0,.15);
    animation: float 6s ease-in-out infinite;
    display: none;
}
@media (min-width: 768px) { .stats-card { display: block; } }

.stats-head { display: flex; justify-content: space-between; align-items: center; }
.stats-label { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stats-value { display: block; margin-top: .25rem; font-size: 1.4rem; font-weight: 700; color: var(--black); }
.stats-badge {
    background: var(--black); color: #fff;
    padding: .25rem .625rem; font-size: .72rem; font-weight: 600;
    border-radius: 999px;
}
.stats-bars { margin-top: 1rem; display: flex; gap: 6px; height: 56px; align-items: flex-end; }
.bar {
    flex: 1; border-radius: 2px;
    background: linear-gradient(to top, #adb5bd, #000);
    transform-origin: bottom;
    animation: barRise 900ms cubic-bezier(.22,1,.36,1) both;
}
@keyframes barRise { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.copy { font-size: .75rem; color: var(--muted); }

/* ============ CARD DE LOGIN ============ */
.login-panel { display: flex; align-items: center; justify-content: center; order: 1; }
@media (min-width: 960px) { .login-panel { order: 2; } }

.login-card {
    position: relative; width: 100%; max-width: 26rem;
    animation: scaleIn .6s cubic-bezier(.22,1,.36,1) both;
}
.card-glow {
    position: absolute; inset: -1px; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(0,0,0,.1), transparent, rgba(0,0,0,.1));
    filter: blur(6px); opacity: .7;
}
.card-inner {
    position: relative;
    background: var(--surface);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}
@media (min-width: 768px) { .card-inner { padding: 3rem; } }

.card-head { margin-bottom: 2rem; }
.card-head h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; color: var(--black); }
.card-head p { margin-top: .5rem; font-size: .9rem; color: var(--muted); }

.alert-error {
    background: #fff5f5; border: 1px solid #fecaca;
    color: #b91c1c; padding: .75rem 1rem; border-radius: 10px;
    font-size: .85rem; font-weight: 500; margin-bottom: 1rem;
    animation: fadeIn .3s ease-out;
}

/* ============ FORM ============ */
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.field label {
    display: block; margin-bottom: .5rem;
    font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
    color: var(--text-2);
}

.input-wrap { position: relative; }
.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--placeholder);
    transition: color .2s ease;
    pointer-events: none;
}
.input-wrap input, .input-wrap select {
    width: 100%;
    padding: .8rem 1rem .8rem 2.75rem;
    border: 1px solid var(--border);
    background: var(--input-bg);
    border-radius: var(--radius);
    font-size: .9rem; color: var(--black);
    outline: none; transition: all .2s ease;
    font-family: inherit;
}
.input-wrap input::placeholder { color: var(--placeholder); }
.input-wrap input:focus, .input-wrap select:focus {
    border-color: var(--black);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0,0,0,.05);
}
.input-wrap:focus-within .input-icon { color: var(--black); }

.pwd-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: transparent; border: none; padding: 8px; cursor: pointer;
    color: var(--placeholder); border-radius: 8px;
    transition: color .2s ease;
    display: inline-flex; align-items: center; justify-content: center;
}
.pwd-toggle:hover { color: var(--black); }
.pwd-toggle svg { width: 16px; height: 16px; }
.input-wrap:has(.pwd-toggle) input { padding-right: 44px; }

/* Checkbox custom */
.row-between { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--muted); }
.check:hover { color: var(--black); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
    width: 16px; height: 16px; border-radius: 4px;
    border: 1px solid var(--border-strong); background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .2s ease; color: #fff;
}
.check .box svg { width: 10px; height: 10px; opacity: 0; transition: opacity .15s; }
.check input:checked + .box { background: var(--black); border-color: var(--black); }
.check input:checked + .box svg { opacity: 1; }
.link-muted { color: var(--muted); text-decoration: none; font-weight: 500; transition: color .2s; }
.link-muted:hover { color: var(--black); }

/* Botão principal */
.btn-primary {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    width: 100%; padding: .95rem 1rem; margin-top: .5rem;
    background: var(--black); color: #fff;
    border: none; border-radius: var(--radius);
    font-family: inherit; font-size: .9rem; font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 25px -10px rgba(0,0,0,.4);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -8px rgba(0,0,0,.5); }
.btn-primary:disabled, .btn-primary.is-loading { opacity: .7; cursor: wait; transform: none; }
.btn-primary .shine {
    position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
    transition: transform .7s ease;
}
.btn-primary:hover .shine { transform: translateX(100%); }
.btn-arrow { width: 16px; height: 16px; transition: transform .2s ease; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }
.btn-primary.is-loading .btn-arrow { display: none; }
.btn-primary.is-loading::before {
    content: ''; width: 14px; height: 14px; margin-right: 6px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff; border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.foot-cta { margin-top: 2rem; text-align: center; font-size: .9rem; color: var(--muted); }
.foot-cta a { color: var(--black); font-weight: 600; text-decoration: none; }
.foot-cta a:hover { text-decoration: underline; }

/* ============ MOBILE: campos com 16px (iOS não dá zoom ao tocar) ============ */
@media (max-width: 767px) {
    .input-wrap input,
    .input-wrap select { font-size: 16px; min-height: 48px; }
    .card-inner { padding: 1.5rem 1.25rem; }
    .page { padding-left: 1rem; padding-right: 1rem; }
}
