/* ============================================
   Simulado ENEM - Visual Moderno 2026
   ============================================ */

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

:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-darker: #172554;
    --primary-light: #3b82f6;
    --primary-lighter: #60a5fa;
    --accent: #f97316;
    --accent-dark: #ea580c;
    --accent-light: #fb923c;
    --success: #10b981;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.25);
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

/* ===== Navbar ===== */
.navbar-school {
    background: rgba(30, 58, 138, 0.95);
    backdrop-filter: blur(12px);
    border: none;
    padding: 0;
    height: 89px;
    display: flex;
    align-items: center;
}
.navbar-school .container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.navbar-school .navbar-brand {
    color: var(--white) !important;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex; align-items: center; gap: 0.5rem;
    height: 89px;
    padding: 0; margin: 0;
}
.navbar-school .navbar-brand img { height: 100%; width: auto; display: block; }
.navbar-school .nav-link { color: rgba(255,255,255,0.8) !important; font-size: 0.9rem; }
.navbar-school .nav-link:hover { color: var(--white) !important; }
.navbar-school .navbar-text { color: rgba(255,255,255,0.85) !important; font-size: 0.85rem; }
.navbar-school .navbar-collapse { position: absolute; right: 0; }
.navbar-toggler { border-color: rgba(255,255,255,0.3) !important; }
.navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important; }

@media (max-width: 500px) {
    .navbar-school { height: auto !important; min-height: 0; padding: 0; margin: 0; }
    .navbar-school .container { padding: 0; margin: 0; justify-content: center; flex-wrap: wrap; }
    .navbar-school .navbar-brand { width: 100%; height: auto; padding: 0; margin: 0 0 0.5rem 0; justify-content: center; }
    .navbar-school .navbar-brand img { width: 100% !important; height: auto !important; max-height: none !important; display: block; margin: 0; padding: 0; }
    .navbar-school .navbar-toggler { margin-bottom: 0.5rem; }
    .navbar-school .navbar-collapse { position: static; width: 100%; text-align: center; padding-bottom: 0.5rem; }
}

/* ===== Buttons ===== */
.btn { border-radius: var(--radius); font-weight: 500; transition: all 0.2s ease; letter-spacing: -0.01em; }

.btn-school-primary {
    background: var(--primary);
    border: none; color: var(--white);
    padding: 0.65rem 1.5rem;
    box-shadow: 0 1px 3px rgba(30,64,175,0.3);
}
.btn-school-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30,64,175,0.35);
}

.btn-school-accent {
    background: var(--accent);
    border: none; color: var(--white);
    box-shadow: 0 1px 3px rgba(249,115,22,0.3);
}
.btn-school-accent:hover {
    background: var(--accent-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249,115,22,0.35);
}

.btn-school-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-school-outline:hover { background: var(--primary); color: var(--white); }

/* ===== Cards ===== */
.card-school {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    background: var(--white);
}
.card-school .card-header {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    padding: 0.9rem 1.5rem;
    border: none;
    font-size: 0.95rem;
}
.card-school .card-body { padding: 1.5rem; }

/* ===== Tables ===== */
.table-school { border-radius: 0; overflow: hidden; font-size: 0.88rem; }
.table-school thead { background: var(--primary); color: var(--white); }
.table-school thead th { border: none; font-weight: 600; padding: 0.8rem 1rem; }
.table-school tbody tr { transition: background 0.15s; }
.table-school tbody tr:hover { background: var(--gray-50); }
.table-school tbody td { padding: 0.7rem 1rem; vertical-align: middle; }

/* ===== Forms ===== */
.form-control, .form-select {
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* ===== Login Pages ===== */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-darker);
    position: relative; overflow: hidden;
    padding: 2rem 1rem;
}
.auth-page::before {
    content: '';
    position: absolute;
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 60%);
    top: -300px; right: -200px;
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}
.auth-page::after {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(249,115,22,0.08) 0%, transparent 60%);
    bottom: -200px; left: -200px;
    border-radius: 50%;
    animation: float 25s ease-in-out infinite reverse;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -20px); }
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    width: 100%; max-width: 420px;
    overflow: hidden;
    position: relative; z-index: 1;
}
.auth-card-header {
    background: var(--white);
    padding: 0;
}
.auth-card-header img {
    width: 100%; height: auto;
    display: block;
}
.auth-card-body { padding: 2rem; }
.auth-card-footer {
    padding: 1.2rem 2rem 1.8rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-400);
    line-height: 2.2;
}

.auth-title {
    font-size: 1.5rem; font-weight: 700;
    color: var(--gray-900); margin-bottom: 0.2rem;
    text-align: center;
}
.auth-subtitle {
    font-size: 0.9rem; color: var(--gray-500);
    text-align: center; margin-bottom: 1.5rem;
}

.auth-welcome {
    text-align: center; color: var(--white);
    margin-bottom: 2rem; position: relative; z-index: 1;
}
.auth-welcome-icon {
    width: 56px; height: 56px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.8rem; margin-bottom: 0.8rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.15);
}
.auth-welcome h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.3rem; }
.auth-welcome p { opacity: 0.7; font-size: 0.9rem; }

.auth-input {
    position: relative; margin-bottom: 1rem;
}
.auth-input .form-control {
    padding-left: 2.8rem;
    height: 48px;
    background: var(--gray-50);
    border-color: var(--gray-200);
}
.auth-input .form-control:focus { background: var(--white); }
.auth-input-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 1rem;
    pointer-events: none;
}

.auth-links {
    display: flex; justify-content: space-between; gap: 1rem;
    margin-top: 1.2rem; font-size: 0.82rem;
}
.auth-links a {
    text-decoration: none; color: var(--primary);
    text-align: center; transition: color 0.2s;
}
.auth-links a:hover { color: var(--primary-dark); }
.auth-links a small { display: block; color: var(--gray-400); font-size: 0.75rem; }

/* ===== Flash Messages ===== */
.flash-container .alert {
    border-radius: var(--radius);
    border: none;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
}

/* ===== Footer ===== */
.footer-school {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 1.2rem 0;
    font-size: 0.85rem;
}

/* ===== Stat Cards ===== */
.stat-card {
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    background: var(--white);
    box-shadow: var(--shadow);
    transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .stat-number { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { color: var(--gray-500); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .auth-card { margin: 0; max-width: 100%; border-radius: var(--radius-lg); }
    .auth-card-body { padding: 1.5rem; }
    .auth-title { font-size: 1.3rem; }
    .navbar-school .navbar-brand { font-size: 0.9rem; }
    .navbar-school .navbar-brand img { height: 32px; }
    .stat-card .stat-number { font-size: 1.4rem; }
    .card-school .card-body { padding: 1rem; }
}
@media (max-width: 576px) {
    .container { padding-left: 0.75rem; padding-right: 0.75rem; }
    .auth-page { padding: 1rem 0.75rem; }
    .auth-card-body { padding: 1.25rem; }
}

/* ===== Login legacy support ===== */

/* Turmas grid - 7 por linha em desktop */
@media (min-width: 992px) {
    .turmas-grid > .col {
        flex: 0 0 calc(100% / 7);
        max-width: calc(100% / 7);
    }
}

/* ===== Cores por Área de Conhecimento ===== */
.badge-area-1 { background-color: #7c3aed !important; color: #fff !important; } /* Linguagens - roxo */
.badge-area-2 { background-color: #0891b2 !important; color: #fff !important; } /* Humanas - ciano */
.badge-area-3 { background-color: #059669 !important; color: #fff !important; } /* Natureza - verde */
.badge-area-4 { background-color: #d97706 !important; color: #fff !important; } /* Matemática - amarelo escuro */
.badge-area-5 { background-color: #dc2626 !important; color: #fff !important; } /* Técnica - vermelho */

/* Select com texto que não invade a seta */
.form-select {
    padding-right: 2.5rem !important;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
