/* EDUBAS UI - Design System Unificado v4.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

:root {
    /* Identidade Visual */
    --primary: #0f172a;       /* Navy Profundo (Governo/Institucional) */
    --primary-light: #1e293b; 
    --accent: #2563eb;        /* Azul Real (Ação) */
    --accent-hover: #1d4ed8;
    
    /* Superfícies */
    --bg-page: #f8fafc;       
    --bg-card: #ffffff;
    --border: #e2e8f0;
    
    /* Estados */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    /* Elevação */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--primary);
    line-height: 1.6;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
/* CLASSE ESSENCIAL PARA O LOGIN FUNCIONAR */
.hidden {
    display: none !important;
}
/* --- ESTRUTURA --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header Global */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    padding: 1rem 0;
}
.nav-content { display: flex; justify-content: space-between; align-items: center; }

.logo {
    font-size: 1.4rem; font-weight: 800; color: var(--primary);
    text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.logo span {
    background: var(--accent); color: white; padding: 2px 6px;
    border-radius: 4px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px;
}

/* Header Escuro (Admin) */
.admin-header { background: #0f172a; border-bottom: 1px solid #1e293b; }
.admin-header .logo { color: white; }
.admin-header span { background: var(--accent); color: white; }

/* --- BOTÕES --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 24px; border-radius: 8px; font-weight: 600; text-decoration: none;
    transition: 0.2s; cursor: pointer; border: none; font-size: 1rem;
    min-height: 44px;
}
.btn-lg { padding: 16px 32px; font-size: 1.15rem; } /* Adicionado para index.html */

.btn-primary { background: var(--primary); color: white; }
.btn-primary:active { transform: scale(0.98); }

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--primary); }
.btn-outline:hover { border-color: var(--primary); background: white; }

.btn-ghost { background: transparent; color: #64748b; font-size: 0.9rem; }
.btn-ghost:hover { color: var(--primary); text-decoration: underline; }

/* --- LANDING PAGE (index.html) --- */
.hero {
    padding: 80px 0; text-align: center; max-width: 800px; margin: 0 auto;
}
.hero h1 {
    font-size: 3rem; line-height: 1.1; margin-bottom: 20px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.25rem; color: #475569; margin-bottom: 40px; }
.hero-actions { display: flex; gap: 15px; justify-content: center; }

/* --- LOGIN --- */
.login-wrapper { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
    background: white; width: 100%; max-width: 400px;
    border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: hidden;
}
.login-header { padding: 30px; text-align: center; border-bottom: 1px solid var(--border); background: #f8fafc; }
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab-btn { flex: 1; padding: 15px; background: none; border: none; font-weight: 600; color: #94a3b8; cursor: pointer; border-bottom: 3px solid transparent; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: white; }
.form-section { padding: 30px; }
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: #475569; }
.input-field {
    width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 8px;
    font-size: 1rem; background: #f8fafc; transition: 0.2s;
}
.input-field:focus { border-color: var(--accent); background: white; outline: none; }

/* --- DASHBOARDS (ADMIN & PROF) --- */
.data-header { padding: 0 0 30px 0; margin-bottom: 0; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }

/* KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 40px; }
.kpi-card {
    background: white; padding: 24px; border-radius: 12px; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.kpi-card.success::before { background: var(--success); }
.kpi-value { font-size: 2.5rem; font-weight: 800; line-height: 1.2; color: var(--primary); }
.kpi-label { font-size: 0.85rem; text-transform: uppercase; font-weight: 600; color: #64748b; }

/* Cards de Lista (Professor/Aluno) */
.prof-card, .student-card {
    background: white; border-radius: 8px; padding: 20px;
    border: 1px solid var(--border); border-left: 4px solid var(--accent);
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; transition: transform 0.2s;
}
.prof-card:hover, .student-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.prof-info h4, .student-info h4 { margin: 0; font-size: 1.1rem; color: var(--primary); }
.prof-info p, .student-info p { margin: 0; color: #64748b; font-size: 0.9rem; }
.school-tag, .pin-badge {
    background: #f1f5f9; padding: 4px 10px; border-radius: 4px;
    font-size: 0.85rem; font-weight: 600; color: #475569; border: 1px solid #e2e8f0;
}

/* Formulários de Cadastro */
.data-card, .form-card {
    background: white; padding: 30px; border-radius: 12px;
    border: 1px solid var(--border); margin-bottom: 40px; box-shadow: var(--shadow-sm);
}
.card-header { border-bottom: 1px solid var(--border); margin-bottom: 20px; padding-bottom: 10px; }
.card-title { font-size: 1.2rem; font-weight: 700; }
.form-row { display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 15px; align-items: end; }

/* --- ÁREA DO ALUNO (APP DE JOGOS) --- */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.materia-card {
    background: white; border: 1px solid var(--border); border-radius: 16px;
    padding: 40px 20px; text-align: center; text-decoration: none; color: var(--primary);
    transition: 0.3s; display: flex; flex-direction: column; align-items: center;
}
.materia-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.icone-materia { font-size: 3rem; margin-bottom: 15px; }
.titulo-materia { font-size: 1.4rem; font-weight: 800; display: block; margin-bottom: 5px; }

/* Interface do Jogo */
.area-jogo {
    background: white; border: 2px solid var(--border); border-radius: 16px;
    padding: 30px; min-height: 220px; display: flex; flex-wrap: wrap;
    justify-content: center; align-items: center; gap: 20px; margin-bottom: 30px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.03); position: relative;
}

/* Grids de Resposta */
.grid-opcoes, .grid-leitura {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; width: 100%;
}
.btn-opcao {
    background: white; border: 2px solid var(--border); color: var(--primary);
    padding: 15px; font-size: 1.5rem; font-weight: 800; border-radius: 12px;
    cursor: pointer; box-shadow: 0 4px 0 var(--border); transition: 0.1s;
    min-height: 70px; display: flex; align-items: center; justify-content: center;
}
.btn-opcao:active { transform: translateY(4px); box-shadow: none; }

/* Feedback Visual */
.btn-erro { background-color: #fee2e2 !important; color: var(--error) !important; border-color: var(--error) !important; animation: shake 0.4s; }
.btn-sucesso { background-color: #dcfce7 !important; color: #166534 !important; border-color: #166534 !important; transform: scale(1.05); }
.feedback-msg { text-align: center; font-weight: 700; font-size: 1.2rem; min-height: 30px; margin-top: 15px; }

/* Progresso e Níveis */
.progress-container { background: #e2e8f0; height: 8px; border-radius: 4px; margin-bottom: 20px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); width: 0%; transition: width 0.5s ease; }
.painel-ciclos { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.btn-ciclo {
    padding: 8px 14px; background: white; border: 1px solid var(--border);
    border-radius: 20px; cursor: pointer; color: #64748b; font-size: 0.9rem; transition: 0.2s;
}
.btn-ciclo.ativo { background: var(--primary); color: white; border-color: var(--primary); font-weight: bold; }

/* Elementos Específicos */
.bloco, .bloco-palavra {
    background: white; border: 2px solid var(--primary); color: var(--primary);
    padding: 10px 20px; font-weight: 700; border-radius: 10px; cursor: pointer;
    box-shadow: 0 4px 0 var(--primary); user-select: none; display: inline-block; font-size: 1.1rem;
}
.objeto-concreto {
    width: 60px; height: 60px; border-radius: 50%;
    background-color: var(--error); box-shadow: 0 4px 0 #b91c1c;
    cursor: pointer; transition: 0.1s; position: relative;
}
.objeto-concreto.contado { background-color: var(--success); box-shadow: 0 4px 0 #15803d; }
.objeto-concreto.contado::after {
    content: '✓'; color: white; font-weight: bold; font-size: 1.5rem;
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}

/* --- MODAL (POPUP) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(5px);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.ativo { opacity: 1; pointer-events: all; }
.modal-card {
    background: white; width: 90%; max-width: 400px; border-radius: 20px;
    padding: 30px; text-align: center; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
    transform: translateY(20px); transition: transform 0.3s;
}
.modal-overlay.ativo .modal-card { transform: translateY(0); }
.modal-icon { font-size: 4rem; display: block; margin-bottom: 15px; animation: popIn 0.5s; }
.modal-titulo { font-size: 1.5rem; color: var(--primary); margin-bottom: 10px; }
.modal-msg { color: #64748b; margin-bottom: 25px; }

/* --- RESPONSIVIDADE (MOBILE) --- */
@media (max-width: 768px) {
    .container { padding: 0 15px; }
    
    /* Landing Page */
    .hero h1 { font-size: 2.2rem; }
    .hero-actions { flex-direction: column; }
    
    /* Jogos */
    .grid-opcoes, .grid-leitura { grid-template-columns: 1fr 1fr; gap: 10px; }
    .btn-opcao { font-size: 1.3rem; min-height: 60px; }
    .area-jogo { padding: 20px; gap: 10px; }
    .obj-grande { font-size: 4rem !important; }
    .obj-pequeno { font-size: 2.5rem !important; }
    .objeto-concreto { width: 50px; height: 50px; }
    .simbolo { font-size: 3.5rem !important; }
    
    /* Painéis Admin/Prof */
    .form-row { grid-template-columns: 1fr; gap: 10px; }
    .prof-card, .student-card { flex-direction: column; align-items: flex-start; gap: 10px; }
    .prof-card > div, .student-card > div { width: 100%; justify-content: space-between; display: flex; }
    
    /* Scroll Horizontal nos Ciclos */
    .painel-ciclos { justify-content: flex-start; overflow-x: auto; padding-bottom: 10px; flex-wrap: nowrap; }
    .btn-ciclo { flex: 0 0 auto; }
}

@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
@keyframes popIn { 0%{transform:scale(0)} 80%{transform:scale(1.1)} 100%{transform:scale(1)} }