@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800;900&display=swap');

/* ============================================================ */
/* RESET GLOBAL — elimina bordas brancas e margens padrão       */
/* ============================================================ */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: #667eea; /* mesma cor do topo do gradiente de login */
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0f172a;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --radius: 20px;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --gradient-green: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --gradient-orange: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    --foco-bg: #0f172a;
    --foco-text: #f8fafc;
    --foco-card: #1e293b;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', -apple-system, system-ui, sans-serif; }

body { background: var(--bg); color: var(--text); padding: 24px; min-height: 100vh; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }

.hidden { display: none !important; }

/* ========================================== */
/* MODAIS */
/* ========================================== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999; animation: fadeIn 0.5s ease; padding: 20px;
}
.modal-overlay.hidden { display: none !important; }
.modal {
    background: white; border-radius: var(--radius);
    max-width: 850px; width: 100%; max-height: 90vh;
    overflow-y: auto; padding: 40px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease; position: relative;
}
@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

.modal h2 { font-size: 2rem; font-weight: 800; color: var(--secondary); margin-bottom: 8px; text-align: center; }
.modal .subtitle { text-align: center; color: var(--text-light); margin-bottom: 30px; font-size: 1rem; }
.progress-bar { width: 100%; height: 6px; background: #e2e8f0; border-radius: 10px; overflow: hidden; margin-bottom: 30px; }
.progress-fill { height: 100%; background: var(--gradient); transition: width 0.5s ease; border-radius: 10px; }
.question-number { font-size: 0.85rem; color: var(--text-light); font-weight: 600; margin-bottom: 20px; }
.question-text { font-size: 1.3rem; font-weight: 700; color: var(--secondary); margin-bottom: 25px; line-height: 1.5; }
.options { display: grid; gap: 12px; margin-bottom: 25px; }
.option-btn {
    padding: 16px 20px; border: 2px solid #e2e8f0; border-radius: 12px;
    background: white; cursor: pointer; font-size: 1rem; text-align: left;
    transition: all 0.25s; color: var(--text); font-weight: 500;
    display: flex; align-items: center; gap: 12px;
}
.option-btn:hover:not(.disabled) { border-color: var(--primary); background: #f8fafc; transform: translateX(4px); }
.option-btn .letter {
    width: 32px; height: 32px; border-radius: 50%; background: #f1f5f9;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; color: var(--text-light); flex-shrink: 0;
}
.option-btn.correct { border-color: var(--success); background: #dcfce7; }
.option-btn.correct .letter { background: var(--success); color: white; }
.option-btn.wrong { border-color: var(--danger); background: #fee2e2; }
.option-btn.wrong .letter { background: var(--danger); color: white; }
.option-btn.disabled { cursor: default; opacity: 0.7; }
.option-btn.disabled:hover { transform: none; }

.feedback { padding: 16px 20px; border-radius: 12px; margin-bottom: 20px; font-weight: 500; display: none; }
.feedback.show { display: block; animation: fadeIn 0.3s ease; }
.feedback.correct { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.feedback.wrong { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }

.btn-next {
    padding: 14px 40px; border: none; border-radius: 12px;
    background: var(--gradient); color: white; font-weight: 700;
    font-size: 1rem; cursor: pointer; transition: all 0.3s;
    display: none; margin: 0 auto;
}
.btn-next:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(99,102,241,0.3); }
.btn-next.show { display: block; }
.enter-hint { text-align: center; margin-top: 12px; font-size: 0.8rem; color: var(--text-light); opacity: 0.7; display: none; }
.enter-hint.show { display: block; }
.enter-hint kbd { background: #e2e8f0; padding: 2px 10px; border-radius: 4px; font-weight: 600; font-size: 0.75rem; color: var(--secondary); border: 1px solid #cbd5e1; }

/* RESULTADO */
.result-container { text-align: center; padding: 20px 0; }
.result-container .emoji-big { font-size: 5rem; margin-bottom: 15px; }
.result-container h2 { font-size: 2.2rem; margin-bottom: 10px; }
.result-container .score {
    font-size: 3.5rem; font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.result-container .score-detail { font-size: 1.1rem; color: var(--text-light); margin: 10px 0 20px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 25px 0; }
.stat-item { background: #f8fafc; padding: 15px; border-radius: 12px; }
.stat-item .number { font-size: 1.8rem; font-weight: 800; color: var(--secondary); }
.stat-item .label { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

.result-badge { display: inline-block; padding: 8px 24px; border-radius: 40px; font-weight: 700; font-size: 0.9rem; margin: 10px 0; }
.result-badge.excelente { background: #dcfce7; color: #166534; }
.result-badge.bom { background: #dbeafe; color: #1e40af; }
.result-badge.regular { background: #fef3c7; color: #92400e; }
.result-badge.ruim { background: #fee2e2; color: #991b1b; }

.btn-final {
    padding: 16px 50px; border: none; border-radius: 12px;
    background: var(--gradient); color: white; font-weight: 700;
    font-size: 1.1rem; cursor: pointer; transition: all 0.3s; margin-top: 15px;
}
.btn-final:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(99,102,241,0.3); }
.btn-final.secondary { background: #e2e8f0; color: var(--text); }
.btn-final.secondary:hover { background: #cbd5e1; }
.btn-final.danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.btn-final:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ESCOLHA OBJETIVO */
.escolha-objetivo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 25px 0; }
.objetivo-btn {
    padding: 20px; border: 3px solid #e2e8f0; border-radius: 16px;
    background: white; cursor: pointer; transition: all 0.3s;
    text-align: center; font-weight: 600; font-size: 1rem; color: var(--text);
}
.objetivo-btn:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(99,102,241,0.15); }
.objetivo-btn.selected { border-color: var(--primary); background: #eef2ff; }
.objetivo-btn .icon { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.objetivo-btn .label { font-size: 0.85rem; color: var(--text-light); display: block; }

/* ========================================== */
/* HEADER */
/* ========================================== */
.header-wrapper {
    background: var(--gradient); border-radius: var(--radius);
    padding: 40px 50px; margin-bottom: 40px;
    position: relative; overflow: hidden;
    box-shadow: 0 20px 60px rgba(99,102,241,0.3);
}
.header-wrapper::before {
    content: ''; position: absolute; top: -50%; right: -20%;
    width: 400px; height: 400px; background: rgba(255,255,255,0.05);
    border-radius: 50%; pointer-events: none;
}
header {
    position: relative;
    z-index: 1;
}

header h1 {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 2.8rem;
    font-weight: 900;
    color: white;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

header h1 img {
    height: 70px;
    width: 70px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

/* Texto principal "Missão Estudos BR" — SEM badge */
header h1 > span:not(#tipoDiagnosticoLabel) {
    font-size: 2.8rem;
    font-weight: 900;
    color: white;
    letter-spacing: -1px;
    line-height: 1.1;
    background: none;
    padding: 0;
    border-radius: 0;
    margin-left: 0;
    border: none;
    box-shadow: none;
}

/* Badge "ENEM 2026" — COM estilo de badge */
header h1 #tipoDiagnosticoLabel,
header h1 .badge {
    background: rgba(255,255,255,0.2);
    padding: 4px 16px;
    border-radius: 40px;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin-left: 12px;
    white-space: nowrap;
    border: none;
    box-shadow: none;
    align-self: center;
}

header p { color: rgba(255,255,255,0.85); font-size: 1.1rem; font-weight: 300; }

.header-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 15px; }
.diagnostic-btn {
    padding: 12px 35px; border: 2px solid white; border-radius: 12px;
    background: transparent; color: white; font-weight: 700; font-size: 1rem;
    cursor: pointer; transition: all 0.3s;
}
.diagnostic-btn:hover { background: white; color: var(--primary); transform: scale(1.03); }
.diagnostic-btn.refazer { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }
.diagnostic-btn.refazer:hover { background: white; color: var(--danger); }

.result-badge-header { display: inline-block; padding: 6px 18px; border-radius: 40px; font-weight: 700; font-size: 0.85rem; margin-top: 10px; }
.result-badge-header.excelente { background: rgba(34,197,94,0.3); color: #86efac; }
.result-badge-header.bom { background: rgba(59,130,246,0.3); color: #93c5fd; }
.result-badge-header.regular { background: rgba(234,179,8,0.3); color: #fcd34d; }
.result-badge-header.ruim { background: rgba(239,68,68,0.3); color: #fca5a5; }

/* CONTAINER PRINCIPAL */
.container {
    max-width: 1200px; margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr;
    gap: 30px; align-items: start;
}

@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; }
    .header-wrapper { padding: 30px 25px; }
    header h1 { font-size: 2rem; }
    header h1 img { height: 55px; width: 55px; }
    header h1 > span:not(#tipoDiagnosticoLabel) { font-size: 1.8rem; }
    header h1 #tipoDiagnosticoLabel { font-size: 1rem; margin-left: 8px; padding: 4px 14px; }
    .modal { padding: 25px; }
    .result-stats { grid-template-columns: 1fr; }
    .escolha-objetivo { grid-template-columns: 1fr; }
}

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tabs { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.tab-buttons {
    display: flex; background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto; padding: 4px 4px 0 4px; gap: 4px;
}
.tab-btn {
    padding: 16px 24px; border: none; background: transparent; cursor: pointer;
    font-weight: 600; font-size: 0.9rem; color: var(--text-light);
    transition: all 0.3s; border-radius: 12px 12px 0 0; white-space: nowrap; position: relative;
}
.tab-btn:hover { color: var(--text); background: rgba(99,102,241,0.05); }
.tab-btn.active { color: var(--primary); background: white; box-shadow: 0 -2px 10px rgba(99,102,241,0.1); }
.tab-btn.active::after {
    content: ''; position: absolute; bottom: 0; left: 20%; right: 20%;
    height: 3px; background: var(--primary); border-radius: 10px 10px 0 0;
}
.tab-btn.hidden { display: none !important; }

.tab-content { padding: 35px 40px; display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
.tab-content h2 { font-size: 1.6rem; font-weight: 800; color: var(--secondary); margin-bottom: 16px; letter-spacing: -0.5px; }
.tab-content ul { list-style: none; padding: 0; margin-bottom: 20px; }
.tab-content ul li {
    padding: 12px 18px; margin-bottom: 8px;
    background: #f8fafc; border-radius: 12px;
    border-left: 4px solid var(--primary);
    line-height: 1.6; font-size: 0.95rem;
}
.tab-content a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* DASHBOARD */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dashboard-card {
    background: #f8fafc; border-radius: 16px; padding: 16px 14px;
    text-align: center; border: 1px solid #e2e8f0; transition: all 0.2s;
}
.dashboard-card:hover { border-color: var(--primary-light); transform: translateY(-3px); }
.dashboard-card .value { font-size: 1.8rem; font-weight: 800; color: var(--secondary); }
.dashboard-card .label { font-size: 0.75rem; color: var(--text-light); margin-top: 4px; }
.dashboard-card .icon { font-size: 1.8rem; margin-bottom: 4px; }
.progress-bar-dash { width: 100%; height: 8px; background: #e2e8f0; border-radius: 10px; overflow: hidden; margin-top: 8px; }
.progress-bar-dash .fill { height: 100%; background: var(--gradient); border-radius: 10px; transition: width 0.5s ease; }

/* MISSÃO HOJE */
.missao-hoje { background: var(--gradient); color: white; border-radius: 16px; padding: 25px 30px; margin-bottom: 24px; }
.missao-hoje .titulo { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.missao-hoje .assunto { font-size: 1.8rem; font-weight: 900; }
.missao-hoje .detalhes { display: flex; gap: 20px; flex-wrap: wrap; margin: 12px 0 16px; font-size: 0.95rem; opacity: 0.9; }
.missao-hoje .motivo { background: rgba(255,255,255,0.15); padding: 12px 18px; border-radius: 10px; font-size: 0.95rem; margin-bottom: 16px; border-left: 3px solid rgba(255,255,255,0.5); }
.missao-hoje .btn-missao {
    padding: 14px 40px; border: none; border-radius: 12px;
    background: white; color: var(--primary); font-weight: 700;
    font-size: 1.1rem; cursor: pointer; transition: all 0.3s;
}
.missao-hoje .btn-missao:hover { transform: scale(1.03); box-shadow: 0 8px 25px rgba(0,0,0,0.2); }

/* TIMER */
.timer-card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 35px 30px;
    text-align: center; position: sticky; top: 20px;
}
.timer-card h3 { font-size: 1.4rem; font-weight: 800; color: var(--secondary); margin-bottom: 4px; }
.timer-card .subtitle { color: var(--text-light); font-size: 0.85rem; margin-bottom: 20px; }
.timer-display {
    font-size: 4rem; font-weight: 800; color: var(--primary);
    font-variant-numeric: tabular-nums; letter-spacing: 2px;
    background: #f8fafc; padding: 20px; border-radius: 16px;
    margin-bottom: 25px; font-family: 'Inter', monospace;
}
.timer-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn {
    padding: 12px 28px; border: none; border-radius: 12px; cursor: pointer;
    font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
    letter-spacing: 0.5px; transition: all 0.3s; flex: 1; min-width: 80px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.btn-start { background: var(--gradient-green); color: white; }
.btn-pause { background: var(--gradient-orange); color: white; }
.btn-reset { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }

.timer-status {
    display: flex; justify-content: center; gap: 15px;
    margin-top: 20px; padding-top: 20px; border-top: 2px solid #f1f5f9;
}
.timer-status span { font-size: 0.8rem; color: var(--text-light); display: flex; align-items: center; gap: 6px; }
.timer-config { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 15px; font-size: 0.9rem; }
.timer-config select { padding: 6px 12px; border-radius: 8px; border: 1px solid #e2e8f0; font-weight: 600; background: white; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.idle { background: #94a3b8; }
.dot.running { background: #22c55e; animation: pulse 1s infinite; }
.dot.paused { background: #eab308; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.9); } }

/* PLANO */
.plano-container { text-align: left; margin-top: 20px; }
.plano-header {
    background: var(--gradient); border-radius: 16px;
    padding: 25px 30px; color: white; margin-bottom: 25px;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 15px;
}
.plano-header .info-item { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.plano-meses { display: grid; gap: 20px; }
.mes-item {
    background: #f8fafc; border-radius: 16px; padding: 20px 25px;
    border-left: 5px solid var(--primary); transition: all 0.3s;
}
.mes-item .mes-titulo {
    font-weight: 700; font-size: 1.1rem; color: var(--secondary);
    display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.mes-item .mes-titulo .badge-mes { font-size: 0.65rem; padding: 2px 14px; border-radius: 20px; background: var(--primary); color: white; font-weight: 600; }
.mes-item .mes-titulo .toggle-icon { margin-left: auto; transition: transform 0.3s; color: var(--text-light); }
.mes-item .mes-titulo .toggle-icon.rotated { transform: rotate(180deg); }
.mes-conteudo { margin-top: 15px; padding-top: 15px; border-top: 1px solid #e2e8f0; display: none; }
.mes-conteudo.show { display: block; animation: fadeIn 0.3s ease; }

.topico {
    background: white; border-radius: 12px; padding: 16px 20px;
    margin-bottom: 12px; border: 1px solid #e2e8f0; transition: all 0.2s;
}
.topico:hover { border-color: var(--primary-light); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.topico .topico-titulo { font-weight: 700; color: var(--secondary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topico .topico-desc { color: var(--text-light); font-size: 0.95rem; margin-top: 6px; line-height: 1.6; }
.topico .topico-exercicio {
    margin-top: 10px; background: #f1f5f9; border-radius: 8px;
    padding: 14px 18px; border-left: 3px solid var(--primary); font-size: 0.9rem;
}
.topico .topico-exercicio .resposta {
    display: none; margin-top: 8px; padding: 10px 14px;
    background: #dcfce7; border-radius: 6px; color: #166534; font-weight: 500;
}
.topico .topico-exercicio .resposta.show { display: block; }
.btn-ver-resposta {
    margin-top: 8px; padding: 6px 16px; border: none; border-radius: 6px;
    background: var(--primary); color: white; font-weight: 600;
    font-size: 0.8rem; cursor: pointer;
}
.btn-ver-resposta:hover { background: var(--primary-dark); }

.topico-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.topico-actions button {
    padding: 6px 14px; border: none; border-radius: 8px;
    font-weight: 600; font-size: 0.8rem; cursor: pointer;
}
.topico-actions .btn-concluir { background: var(--gradient-green); color: white; }
.topico-actions .btn-estudar { background: var(--gradient); color: white; }
.topico-actions .btn-revisar { background: var(--gradient-orange); color: white; }
.topico-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

.topico-status { font-size: 0.75rem; font-weight: 600; padding: 2px 12px; border-radius: 20px; display: inline-block; }
.topico-status.nao-iniciado { background: #e2e8f0; color: #475569; }
.topico-status.em-andamento { background: #fef3c7; color: #92400e; }
.topico-status.dominio-parcial { background: #fef3c7; color: #92400e; }
.topico-status.precisa-reforco { background: #fee2e2; color: #991b1b; }
.topico-status.dominado { background: #dcfce7; color: #166534; }

/* ONBOARDING */
.onboarding-step { animation: fadeIn 0.4s ease; }
.onboarding-progress { display: flex; gap: 8px; justify-content: center; margin-bottom: 30px; }
.onboarding-dot { width: 10px; height: 10px; border-radius: 50%; background: #e2e8f0; transition: all 0.3s; }
.onboarding-dot.active { background: var(--primary); transform: scale(1.3); }
.onboarding-dot.completed { background: var(--success); }

.onboarding-option {
    padding: 16px 20px; border: 2px solid #e2e8f0; border-radius: 12px;
    background: white; cursor: pointer; transition: all 0.25s;
    text-align: left; font-size: 1rem; display: flex; align-items: center;
    gap: 12px; width: 100%;
}
.onboarding-option:hover { border-color: var(--primary-light); background: #f8fafc; }
.onboarding-option.selected { border-color: var(--primary); background: #eef2ff; }
.onboarding-option .option-icon { font-size: 1.5rem; }
.onboarding-option .option-check { margin-left: auto; color: var(--primary); font-weight: 700; }

.onboarding-nav { display: flex; justify-content: space-between; margin-top: 30px; gap: 12px; }
.onboarding-nav button { padding: 12px 30px; border: none; border-radius: 12px; font-weight: 700; cursor: pointer; }
.onboarding-nav .btn-back { background: #e2e8f0; color: var(--text); }
.onboarding-nav .btn-next { background: var(--gradient); color: white; display: block; }

.onboarding-summary { background: #f8fafc; border-radius: 16px; padding: 25px; margin: 20px 0; text-align: left; }
.onboarding-summary-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
.onboarding-summary-item:last-child { border-bottom: none; }
.onboarding-summary-item .label { font-weight: 600; color: var(--text-light); }
.onboarding-summary-item .value { font-weight: 700; color: var(--secondary); }

/* MENU LATERAL */
.side-menu {
    position: fixed; top: 0; right: -420px; width: 360px;
    max-width: 85vw; height: 100%; background: var(--secondary);
    color: white; z-index: 10000; transition: right 0.3s ease;
    box-shadow: -10px 0 40px rgba(0,0,0,0.3); overflow-y: auto;
}
.side-menu.open { right: 0; }
.side-menu.hidden { display: block !important; }
.side-menu-content { padding: 30px 25px 40px; }
.side-menu-header {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 1.4rem; font-weight: 700; padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 25px;
}
.side-menu ul { list-style: none; padding: 0; }
.side-menu ul li { margin-bottom: 4px; }
.side-menu ul li a {
    display: block; padding: 14px 18px; color: rgba(255,255,255,0.85);
    text-decoration: none; border-radius: 10px; transition: all 0.2s;
    font-weight: 500; font-size: 1.05rem;
}
.side-menu ul li a:hover { background: rgba(255,255,255,0.1); color: white; }

/* MODO FOCO */
.modo-foco .timer-card { background: var(--foco-bg); color: var(--foco-text); border: 1px solid #334155; }
.modo-foco .timer-display { background: var(--foco-card); color: var(--foco-text); }
.modo-foco .tab-content { background: var(--foco-bg); color: var(--foco-text); }
.modo-foco .tab-content h2 { color: var(--foco-text); }
.modo-foco .dashboard-card { background: var(--foco-card); border-color: #334155; color: var(--foco-text); }

/* PROFESSOR / COMUNIDADE */
.professor-badge {
    background: #f59e0b; color: #1e293b;
    padding: 2px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 700; display: inline-block;
}

.professor-publicacao {
    background: white; border-radius: 16px;
    padding: 24px; margin-bottom: 20px;
    border: 1px solid #e2e8f0; transition: all 0.2s;
}
.professor-publicacao:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.professor-publicacao .professor-info {
    display: flex; align-items: center;
    gap: 12px; margin-bottom: 12px;
}
.professor-publicacao .professor-foto {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--gradient); display: flex;
    align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 1.2rem; flex-shrink: 0;
}
.professor-publicacao .professor-nome { font-weight: 700; color: var(--secondary); }
.professor-publicacao .professor-data { font-size: 0.8rem; color: var(--text-light); }
.professor-publicacao .publicacao-titulo { font-size: 1.2rem; font-weight: 700; color: var(--secondary); margin: 8px 0; }
.professor-publicacao .publicacao-desc { color: var(--text); line-height: 1.6; }
.professor-publicacao .publicacao-meta {
    display: flex; gap: 16px; flex-wrap: wrap;
    font-size: 0.85rem; color: var(--text-light); margin: 10px 0;
}
.professor-publicacao .publicacao-acoes {
    display: flex; gap: 12px; align-items: center;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid #e2e8f0; flex-wrap: wrap;
}
.professor-publicacao .btn-like,
.professor-publicacao .btn-dislike {
    padding: 6px 16px; border: 1px solid #e2e8f0; border-radius: 8px;
    background: white; cursor: pointer; font-weight: 600;
    font-size: 0.85rem; transition: all 0.2s;
    display: flex; align-items: center; gap: 6px;
}
.professor-publicacao .btn-like:hover { border-color: var(--success); background: #dcfce7; }
.professor-publicacao .btn-dislike:hover { border-color: var(--danger); background: #fee2e2; }
.professor-publicacao .btn-download {
    padding: 6px 16px; border: none; border-radius: 8px;
    background: var(--primary); color: white; font-weight: 600;
    font-size: 0.85rem; cursor: pointer; text-decoration: none;
}
.professor-publicacao .btn-download:hover { background: var(--primary-dark); }

/* PERFIL */
.perfil-form { max-width: 500px; margin: 0 auto; }
.perfil-form label { display: block; font-weight: 600; margin-top: 16px; margin-bottom: 4px; }
.perfil-form input, .perfil-form select, .perfil-form textarea {
    width: 100%; padding: 12px 16px; border: 1px solid #e2e8f0;
    border-radius: 10px; font-size: 1rem; background: white;
}
.perfil-form .btn-salvar {
    margin-top: 24px; width: 100%; padding: 14px;
    border: none; border-radius: 12px; background: var(--gradient);
    color: white; font-weight: 700; font-size: 1.1rem; cursor: pointer;
}
.perfil-form .btn-resetar {
    margin-top: 12px; width: 100%; padding: 12px;
    border: none; border-radius: 12px; background: #fee2e2;
    color: #991b1b; font-weight: 700; cursor: pointer;
}

/* HISTÓRICO */
.historico-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px; background: #f8fafc; border-radius: 10px;
    margin-bottom: 8px; border-left: 4px solid var(--primary);
}
.historico-item .data { font-size: 0.8rem; color: var(--text-light); }
.historico-item .desc { font-weight: 500; }
.historico-item .xp {
    background: var(--gradient); color: white;
    padding: 2px 12px; border-radius: 20px;
    font-weight: 700; font-size: 0.8rem;
}

/* ERROS */
.erro-item {
    background: #f8fafc; border-radius: 12px;
    padding: 16px 20px; margin-bottom: 12px;
    border-left: 4px solid var(--danger);
}
.erro-item .pergunta { font-weight: 700; }
.erro-item .detalhes { font-size: 0.9rem; color: var(--text-light); margin-top: 4px; }
.erro-item .resposta-correta {
    background: #dcfce7; padding: 6px 12px; border-radius: 6px;
    margin-top: 6px; font-weight: 600; color: #166534;
}

/* APOSTILAS */
.apostila-card { transition: all 0.3s ease; border-radius: 16px; overflow: hidden; }
.apostila-conteudo {
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease;
    padding-right: 10px;
}
.apostila-conteudo h4 { font-size: 1.2rem; font-weight: 700; margin: 20px 0 10px; }
.apostila-conteudo p { line-height: 1.8; color: var(--text); }

/* SESSÃO */
.sessao-btn {
    padding: 10px 24px; border: none; border-radius: 10px;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.sessao-btn.primary { background: var(--gradient); color: white; }
.sessao-btn.success { background: var(--gradient-green); color: white; }
.sessao-btn.secondary { background: #e2e8f0; color: var(--text); }
.sessao-btn.warning { background: var(--gradient-orange); color: white; }

/* RESPONSIVO */
@media (max-width: 600px) {
    body { padding: 12px; }
    .tab-content { padding: 25px 20px; }
    .tab-btn { padding: 12px 16px; font-size: 0.8rem; }
    .timer-display { font-size: 3rem; padding: 15px; }
    .timer-card { padding: 25px 20px; }
    .modal { padding: 20px; }
    .question-text { font-size: 1.1rem; }
    .header-buttons { flex-direction: column; }
    .diagnostic-btn { text-align: center; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .onboarding-nav { flex-direction: column; }
    .onboarding-nav button { width: 100%; }
    .side-menu { width: 300px; }

    /* Header no mobile */
    header h1 {
        font-size: 1.6rem;
        gap: 10px;
    }
    header h1 img {
        height: 45px;
        width: 45px;
    }
    header h1 > span:not(#tipoDiagnosticoLabel) {
        font-size: 1.5rem;
    }
    header h1 #tipoDiagnosticoLabel {
        font-size: 0.9rem;
        padding: 3px 12px;
        margin-left: 6px;
    }
}
/* ============================================================ */
/* TELA DE LOGIN — Missão Estudos BR                            */
/* ============================================================ */

/* Quando a tela de auth está ativa, o body não deve ter padding
   nem background cinza — senão aparece uma "borda" ao redor. */
body.auth-active {
  padding: 0;
  margin: 0;
  background: #667eea; /* fallback, mas o gradient do auth cobre */
  overflow: hidden;    /* evita barra de rolagem desnecessária */
}

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;              /* ← era 100vw; 100% evita overflow horizontal */
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #7c3aed 100%);
  background-attachment: fixed;
  position: relative;
  overflow: hidden;
  margin: 0;
}

/* Decorações flutuantes */
.auth-bg-decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-icon {
  position: absolute;
  font-size: 2rem;
  opacity: 0.08;
  animation: floatAround 30s ease-in-out infinite;
  filter: grayscale(0.3);
}

.icon-book       { top: 12%; left: 6%;   animation-delay: 0s; }
.icon-pencil     { top: 22%; right: 8%;  animation-delay: 3s;  }
.icon-lightbulb  { top: 68%; left: 10%;  animation-delay: 6s;  }
.icon-graduation { bottom: 12%; right: 12%; animation-delay: 9s; }
.icon-brain      { top: 48%; left: 4%;   animation-delay: 12s; }
.icon-target     { bottom: 22%; left: 18%; animation-delay: 15s; }
.icon-rocket     { top: 35%; right: 6%;  animation-delay: 18s; }

@keyframes floatAround {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(10px, -12px); }
}

/* Caixa principal */
.auth-box {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
  animation: authSlideIn 0.5s ease-out;
}

@keyframes authSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Ícone da marca */
.auth-mascot {
  width: 130px;
  height: 130px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mascotFloat 4s ease-in-out infinite;
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(124, 58, 237, 0.22));
  user-select: none;
  -webkit-user-drag: none;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.auth-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0 0 28px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Erro */
.auth-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  border-left: 4px solid #ef4444;
  animation: shakeIn 0.3s ease-out;
}

@keyframes shakeIn {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* Loading */
.auth-loading { text-align: center; padding: 20px 0; }

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border: 3px solid #e5e7eb;
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#authLoadingText {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Formulário */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 1;
  transition: transform 0.2s ease;
}

.input-group:focus-within .input-icon {
  transform: scale(1.15);
}

.auth-form input {
  width: 100%;
  padding: 14px 48px 14px 46px;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  font-size: 1rem;
  background: #f9fafb;
  transition: all 0.2s ease;
  font-family: inherit;
  color: #1f2937;
}

.auth-form input:focus {
  outline: none;
  border-color: #7c3aed;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.auth-form input::placeholder { color: #9ca3af; }

.toggle-password {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
  color: #9ca3af;
}

.toggle-password:hover {
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
}

.toggle-password:active { transform: scale(0.95); }

.eye-icon {
  width: 20px;
  height: 20px;
  display: block;
  transition: opacity 0.15s ease;
}

.toggle-password .eye-open    { display: none; }
.toggle-password .eye-closed  { display: block; }
.toggle-password.revealed .eye-open    { display: block; }
.toggle-password.revealed .eye-closed  { display: none; }

/* Botão principal */
.btn-auth-primary {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
  margin-top: 6px;
}

.btn-auth-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.45);
  background: linear-gradient(135deg, #6d28d9, #9333ea);
}

.btn-auth-primary:active:not(:disabled) { transform: translateY(0); }

.btn-auth-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Links inferiores */
.auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.link-btn {
  background: transparent;
  border: none;
  color: #7c3aed;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.link-btn:hover {
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.08);
  text-decoration: underline;
}

.divider { color: #d1d5db; font-size: 0.9rem; }

/* Responsivo */
@media (max-width: 480px) {
  .auth-box {
    padding: 32px 24px;
    border-radius: 20px;
  }

  .auth-mascot {
    width: 110px;
    height: 110px;
  }

  .auth-title { font-size: 1.5rem; }

  .floating-icon {
    opacity: 0.1;
    font-size: 2rem !important;
  }
}