/* ===== Login da Área do Aluno — Fagner Lage ===== */
:root {
    --bg: #07080b;
    --bg-2: #0d0f14;
    --card: #12151c;
    --input: #161a22;
    --line: rgba(255, 255, 255, .08);
    --text: #f3f4f6;
    --muted: #9aa0ab;
    --red: #e3202b;
    --red-2: #ff3b45;
    --red-dark: #8f0f17;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }

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

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
}

/* ---------- Painel visual ---------- */
.visual {
    position: relative; overflow: hidden; min-height: 100vh;
    background: #0a0507;
}
.visual-photo {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center 30%;
    filter: grayscale(.35) contrast(1.1) brightness(.75);
}
.visual-shade {
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(7, 8, 11, .55) 0%, rgba(7, 8, 11, .1) 35%, rgba(7, 8, 11, .85) 85%, var(--bg) 100%),
        linear-gradient(120deg, rgba(227, 32, 43, .55), rgba(143, 15, 23, .25) 45%, rgba(7, 8, 11, .2) 70%),
        linear-gradient(90deg, transparent 75%, var(--bg) 100%);
    mix-blend-mode: normal;
}

/* Brilhos e "rastros" vermelhos, no lugar dos planetas e cometas da referência */
.glow { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.g1 {
    width: 460px; height: 460px; top: -170px; left: -140px;
    background: radial-gradient(circle at 60% 60%, rgba(255, 59, 69, .55), rgba(227, 32, 43, .15) 55%, transparent 70%);
}
.g2 {
    width: 220px; height: 220px; top: 38%; right: 14%;
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .18), rgba(255, 59, 69, .35) 40%, transparent 70%);
    animation: float 7s ease-in-out infinite;
}
.streak {
    position: absolute; height: 2px; border-radius: 2px; transform: rotate(35deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85));
    box-shadow: 0 0 10px rgba(255, 59, 69, .9);
}
.s1 { width: 180px; top: 18%; left: 48%; }
.s2 { width: 110px; top: 62%; left: 20%; opacity: .7; }
.s3 { width: 80px; top: 30%; left: 78%; opacity: .5; }
@keyframes float { 50% { transform: translateY(-14px); } }

.brand {
    position: absolute; top: 28px; left: 34px; z-index: 2;
    display: flex; align-items: center; gap: 10px;
}
.brand img { height: 40px; width: auto; }
.brand span { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1rem; line-height: 1.1; }
.brand small {
    display: block; font-family: 'Inter', sans-serif; font-weight: 500;
    font-size: .6rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted);
}

.visual-title {
    position: absolute; left: 40px; bottom: 48px; z-index: 2;
    font-family: 'Montserrat', sans-serif; font-weight: 900; text-transform: uppercase;
    font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.02;
    text-shadow: 0 6px 30px rgba(0, 0, 0, .6);
}
.visual-title span { color: var(--red-2); }

/* ---------- Formulário ---------- */
.panel {
    display: flex; align-items: center; justify-content: center;
    padding: 48px 40px;
    background:
        radial-gradient(600px 400px at 100% 0%, rgba(227, 32, 43, .14), transparent 60%),
        var(--bg);
}
.panel-inner { width: 100%; max-width: 380px; }

.back {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 40px;
    font-size: .82rem; color: var(--muted);
}
.back:hover { color: #fff; }

.panel h1 {
    font-family: 'Montserrat', sans-serif; font-weight: 900; text-transform: uppercase;
    font-size: clamp(2.4rem, 4vw, 3.2rem); line-height: 1; margin-bottom: 30px;
}

.group { margin-bottom: 12px; }
.group label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 10px; }

.field {
    position: relative; display: flex; align-items: center;
    background: var(--input); border: 1px solid var(--line); border-radius: 10px;
    transition: border-color .2s, box-shadow .2s;
}
.field:focus-within { border-color: var(--red-2); box-shadow: 0 0 0 3px rgba(255, 59, 69, .15); }
.field > i { position: absolute; left: 16px; color: var(--muted); font-size: .95rem; }
.field input {
    width: 100%; border: 0; outline: 0; background: transparent; color: var(--text);
    padding: 15px 46px 15px 46px; font-size: .92rem; font-family: inherit;
}
.field input::placeholder { color: #6b7280; }
.field input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 40px var(--input) inset;
    -webkit-text-fill-color: var(--text);
}
.toggle-pass {
    position: absolute; right: 12px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px;
}
.toggle-pass:hover { color: #fff; }

.link { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: .8rem; }
.link:hover { color: #fff; }
.link.strong { color: var(--red-2); font-weight: 700; }
.forgot { display: block; margin: 2px 0 16px auto; }

.btn-login {
    width: 100%; padding: 15px; border: 0; border-radius: 10px; cursor: pointer;
    background: linear-gradient(90deg, var(--red-dark), var(--red) 55%, var(--red-2));
    color: #fff; font-weight: 700; font-size: .95rem;
    box-shadow: 0 12px 30px -10px rgba(227, 32, 43, .7);
    transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn-login:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 16px 36px -10px rgba(227, 32, 43, .85); }
.btn-login:disabled { opacity: .6; cursor: wait; transform: none; }

.divider { height: 1px; background: var(--line); margin: 28px 0 22px; }
.continue { font-size: .75rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; }

.btn-google {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px; border-radius: 10px; cursor: pointer;
    background: var(--input); border: 1px solid var(--line); color: #fff;
    font-weight: 600; font-size: .88rem; transition: border-color .2s, background .2s;
}
.btn-google:hover { border-color: rgba(255, 255, 255, .25); background: #1c212b; }
.btn-google:disabled { opacity: .6; cursor: wait; }
.btn-google svg { width: 18px; height: 18px; }
.social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-apple svg { width: 16px; height: 18px; color: #fff; }

.switch { margin-top: 22px; font-size: .8rem; color: var(--muted); }

.message { min-height: 20px; margin-top: 14px; font-size: .82rem; }
.message.error { color: var(--red-2); }
.message.ok { color: #4ade80; }

.logged > i { font-size: 2.8rem; color: #4ade80; margin-bottom: 18px; }
.logged h1 { font-size: 2.2rem; margin-bottom: 10px; text-transform: none; }
.logged h1 span { color: var(--red-2); }
.logged p { color: var(--muted); margin-bottom: 26px; }

/* Carregando */
.loading {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(7, 8, 11, .8); display: flex; align-items: center; justify-content: center;
}
.spinner {
    width: 46px; height: 46px; border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, .15); border-top-color: var(--red-2);
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Celular: imagem no topo, formulário embaixo ---------- */
@media (max-width: 860px) {
    .login-page { grid-template-columns: 1fr; }
    .visual { min-height: 0; height: 300px; }
    .visual-photo { object-position: center 8%; }
    .visual-shade {
        background:
            linear-gradient(180deg, rgba(7, 8, 11, .5) 0%, rgba(7, 8, 11, .1) 40%, var(--bg) 100%),
            linear-gradient(120deg, rgba(227, 32, 43, .55), rgba(143, 15, 23, .25) 45%, rgba(7, 8, 11, .2) 70%);
    }
    .brand { top: 20px; left: 20px; }
    .visual-title { display: none; }
    .g2 { width: 140px; height: 140px; top: 30%; right: 8%; }
    .panel { align-items: flex-start; padding: 8px 22px 40px; margin-top: -40px; background: transparent; position: relative; z-index: 2; }
    .back { margin-bottom: 18px; }
    .panel h1 { margin-bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .g2 { animation: none; }
}
