/* ============================================================
   CEPI LMS — Estilos globales
   Archivo: assets/css/style.css
   Paleta: Centro Educativo Pedagógico Infantil (CEPI)
   ============================================================ */

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

:root {
    /* ── Paleta Oficial CEPI ───────────────────────────────── */
    --cepi-blue: #007BFF;
    --cepi-blue-light: #4DA3FF;
    --cepi-blue-soft: #EBF4FF;
    
    --cepi-orange: #FF9100;
    --cepi-orange-light: #FFB347;
    --cepi-orange-soft: #FFF4E5;
    
    --cepi-pink: #E91E63;
    --cepi-pink-light: #F06292;
    --cepi-pink-soft: #FDEBF1;
    
    --cepi-green: #4CAF50;
    --cepi-green-light: #81C784;
    --cepi-green-soft: #EFEFD;
    
    --cepi-yellow: #FFC107;
    --cepi-yellow-light: #FFD54F;
    --cepi-yellow-soft: #FFFDE7;
    
    /* ── Superficies y Texto ──────────────────────────────── */
    --bg: #F4F8FE;
    --surface: #FFFFFF;
    --surface-soft: #F0F5FF;
    --border: #E2E8F0;
    --text: #2D3748;
    --text-muted: #64748B;
    
    /* ── Tokens Principales ────────────────────────────────── */
    --accent: var(--cepi-blue);
    --accent-light: var(--cepi-blue-light);
    --accent-alt: var(--cepi-orange);
    --accent-pink: var(--cepi-pink);
    --accent-green: var(--cepi-green);
    
    --dark: #1E293B;
    --dark-soft: #334155;
    
    --success: #2E7D32;
    --danger: #D32F2F;
    --warning: #F59E0B;
    --rojo: #D32F2F;
    --verde: #2E7D32;
    --amarillo: #F59E0B;

    /* ── Compatibilidad con variables previas ─────────────── */
    --seed-gris: var(--cepi-blue);
    --seed-gris-dark: var(--dark);
    --seed-gris-light: var(--cepi-blue-light);
    --seed-gris-suave: var(--surface-soft);
    --seed-blanco: var(--surface);
    --seed-borde: var(--border);
    --seed-texto: var(--text);
    --seed-texto-suave: var(--text-muted);
    --seed-acento: var(--cepi-blue);
    --seed-acento-light: var(--cepi-blue-light);
    
    --guinda: var(--cepi-blue);
    --guinda-dark: #0056B3;
    --guinda-light: var(--cepi-blue-light);
    --guinda-suave: var(--cepi-blue-soft);
    --dorado: var(--cepi-orange);
    --dorado-light: var(--cepi-yellow);
    --gris-claro: var(--bg);
    --gris-borde: var(--border);
    --texto: var(--text);
    --texto-suave: var(--text-muted);
}

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

html {
    background: var(--bg);
}

body {
    font-family: "Outfit", "Inter", "Segoe UI", sans-serif;
    font-size: 14px;
    color: var(--text);
    background: 
        radial-gradient(circle at 10% 10%, rgba(0, 123, 255, 0.06) 0%, transparent 35%),
        radial-gradient(circle at 90% 15%, rgba(255, 145, 0, 0.06) 0%, transparent 35%),
        radial-gradient(circle at 50% 90%, rgba(233, 30, 99, 0.05) 0%, transparent 40%),
        linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--cepi-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--cepi-blue-light);
}

/* ============================================================
   LOGIN Y REGISTRO
   ============================================================ */
.login-body {
    background: linear-gradient(135deg, #EBF4FF 0%, #FFF4E5 50%, #FDEBF1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-header {
    background: var(--surface);
    width: 100%;
    text-align: center;
    padding: 2.2rem 2rem 1.25rem;
    border-radius: 24px 24px 0 0;
    border-bottom: 1px solid var(--border);
}

.login-header img {
    height: 120px;
    width: auto;
    margin-top: 0.5rem;
    transition: transform 0.3s ease;
}

.login-header img:hover {
    transform: scale(1.04);
}

.login-card {
    background: var(--surface);
    border-radius: 0 0 24px 24px;
    padding: 2rem 2.2rem 2.5rem;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 123, 255, 0.1);
}

.login-card-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.login-links {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 13px;
}

.login-links a {
    color: var(--cepi-blue);
    font-weight: 600;
}

.login-links a:hover {
    color: var(--cepi-pink);
}

.login-footer {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    margin-top: 1rem;
}

/* ============================================================
   FORMULARIOS
   ============================================================ */
.campo {
    margin-bottom: 1rem;
}

.campo label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.campo input,
.campo select,
.campo textarea {
    width: 100%;
    padding: 0.7rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #F8FAFC;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    border-color: var(--cepi-blue);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.12);
    background: var(--surface);
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn-login {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-login,
.btn-primary {
    background: linear-gradient(135deg, var(--cepi-blue) 0%, #0062CC 100%);
    color: var(--surface);
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.6rem;
    font-size: 14px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 10px 24px rgba(0, 123, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-login:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, #1A88FF 0%, #0072E6 100%);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 123, 255, 0.32);
}

.btn-dorado {
    background: linear-gradient(135deg, var(--cepi-orange) 0%, #E68200 100%);
    color: var(--surface);
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.6rem;
    font-size: 14px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(255, 145, 0, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-dorado:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(255, 145, 0, 0.32);
}

.btn-block {
    width: 100%;
    text-align: center;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 12px;
    border-radius: 999px;
}

.btn-danger {
    background: rgba(211, 47, 47, 0.08);
    color: var(--rojo);
    border: 1px solid rgba(211, 47, 47, 0.3);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: var(--rojo);
    color: var(--surface);
}

.btn-outline {
    background: var(--surface);
    color: var(--cepi-blue);
    border: 1.5px solid var(--cepi-blue);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--cepi-blue);
    color: var(--surface);
    transform: translateY(-1px);
}

/* ============================================================
   ALERTAS
   ============================================================ */
.alerta {
    padding: 0.85rem 1.15rem;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.alerta-error {
    background: var(--cepi-pink-soft);
    color: var(--cepi-pink);
    border: 1px solid rgba(233, 30, 99, 0.25);
}

.alerta-ok {
    background: #E8F5E9;
    color: var(--verde);
    border: 1px solid rgba(76, 175, 80, 0.25);
}

.alerta-info {
    background: var(--cepi-yellow-soft);
    color: #B78103;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.06);
    border-bottom: 1px solid rgba(0, 123, 255, 0.08);
    min-height: 76px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.navbar img {
    height: 60px !important;
    width: auto !important;
    padding: 0;
    transition: transform 0.2s ease;
}

.navbar img:hover {
    transform: scale(1.05);
}

.navbar-nombre {
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.navbar-sub {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    display: block;
}

.navbar-spacer {
    flex: 1;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.navbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cepi-blue) 0%, var(--cepi-pink) 100%);
    color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* ============================================================
   TOPBAR (Navegación Alumno)
   ============================================================ */
.topbar-container {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 860px;
    margin: 1.5rem auto 0;
    padding: 0 1rem;
}

.topbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.5rem 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    gap: 0.5rem;
    border: 1px solid rgba(0, 123, 255, 0.1);
    box-shadow: 0 12px 30px rgba(0, 123, 255, 0.08);
    border-radius: 999px;
    width: 100%;
    flex-wrap: wrap;
}

.topbar a {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.25s ease;
}

.topbar a:hover {
    background: var(--cepi-blue-soft);
    color: var(--cepi-blue);
    transform: translateY(-1px);
}

.topbar a.active {
    color: var(--surface);
    background: linear-gradient(135deg, var(--cepi-blue) 0%, #0062CC 100%);
    box-shadow: 0 6px 18px rgba(0, 123, 255, 0.3);
}

/* ============================================================
   LAYOUT & CONTENIDO
   ============================================================ */
.layout {
    display: flex;
    max-width: 1160px;
    width: calc(100% - 2rem);
    margin: 0 auto;
    min-height: calc(100vh - 110px);
    gap: 1.5rem;
}

.sidebar {
    width: 250px;
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 14px 40px rgba(0, 123, 255, 0.05);
    flex-shrink: 0;
    padding: 1rem 0;
    overflow: hidden;
}

.sidebar-section {
    padding: 0.75rem 1.2rem 0.35rem;
    font-size: 11px;
    font-weight: 800;
    color: var(--cepi-blue);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar a:hover {
    background: var(--cepi-blue-soft);
    color: var(--cepi-blue);
}

.sidebar a.active {
    background: linear-gradient(135deg, var(--cepi-blue) 0%, #0062CC 100%);
    color: var(--surface);
    font-weight: 700;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.6rem 0;
}

.contenido {
    flex: 1;
    padding: 2rem;
    overflow-x: hidden;
    background: var(--surface);
    border: 1px solid rgba(0, 123, 255, 0.1);
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0, 123, 255, 0.06);
}

.contenido-dashboard {
    max-width: 1120px;
    margin: 0 auto;
}

.section-title-center {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    border: none;
    margin-bottom: 2rem;
    padding: 0;
}

.badge-notif {
    background: var(--cepi-pink);
    color: var(--surface);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    margin-left: 6px;
    font-weight: 800;
}

/* ============================================================
   HERO BANNER
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--cepi-blue) 0%, var(--cepi-pink) 55%, var(--cepi-orange) 100%);
    border-radius: 24px;
    padding: 2.2rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 20px 50px rgba(0, 123, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "CEPI";
    position: absolute;
    right: -20px;
    bottom: -30px;
    font-size: 130px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.hero h2 {
    color: #FFFFFF;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    max-width: 520px;
}

.hero-stats {
    margin-left: auto;
    display: flex;
    gap: 0.85rem;
    position: relative;
    z-index: 2;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 1rem 1.25rem;
    text-align: center;
    min-width: 105px;
}

.hero-stat-num {
    color: #FFFFFF;
    font-size: 28px;
    font-weight: 900;
}

.hero-stat-lbl {
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
}

/* ============================================================
   TÍTULOS DE SECCIÓN
   ============================================================ */
.section-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text);
    border-left: 6px solid var(--cepi-orange);
    padding-left: 0.9rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
}

/* ============================================================
   TARJETAS DE CURSOS
   ============================================================ */
.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.curso-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.curso-card:hover {
    box-shadow: 0 20px 45px rgba(0, 123, 255, 0.12);
    transform: translateY(-4px);
    border-color: rgba(0, 123, 255, 0.3);
}

.curso-thumb {
    height: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
    position: relative;
    padding: 1.75rem;
}

.bloqueado-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #FFFFFF;
}

.curso-badge {
    margin-top: 0.5rem;
}

.curso-body {
    padding: 1.4rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.curso-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.curso-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
    flex: 1;
}

.badge-sin-iniciar {
    background: var(--cepi-blue-soft);
    color: var(--cepi-blue);
}

.curso-card.bloqueado {
    opacity: 0.8;
    cursor: not-allowed;
}

.curso-thumb.guinda {
    background: linear-gradient(135deg, var(--cepi-blue) 0%, var(--cepi-pink) 100%);
    color: #FFFFFF;
}

.curso-thumb.dorado {
    background: linear-gradient(135deg, var(--cepi-orange) 0%, var(--cepi-yellow) 100%);
    color: #FFFFFF;
}

.curso-thumb.dark {
    background: linear-gradient(135deg, var(--cepi-green) 0%, #2E7D32 100%);
    color: #FFFFFF;
}

/* ============================================================
   PROGRESO
   ============================================================ */
.progress-bar {
    height: 8px;
    background: #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cepi-blue) 0%, var(--cepi-pink) 100%);
    transition: width 0.4s ease;
}

.progress-fill.completo {
    background: var(--cepi-green);
}

.progress-fill.bloqueado {
    background: #CBD5E1;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.badge-ok {
    background: #E8F5E9;
    color: var(--verde);
}

.badge-prog {
    background: var(--cepi-blue-soft);
    color: var(--cepi-blue);
}

.badge-block {
    background: var(--cepi-pink-soft);
    color: var(--cepi-pink);
}

.badge-admin {
    background: var(--cepi-orange-soft);
    color: var(--cepi-orange);
}

/* ============================================================
   TABLAS
   ============================================================ */
.tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.tabla thead {
    background: #F8FAFC;
    color: var(--text);
}

.tabla th {
    padding: 0.85rem 1.1rem;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
}

.tabla td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.tabla tbody tr:last-child td {
    border-bottom: none;
}

.tabla tbody tr:hover {
    background: var(--cepi-blue-soft);
}

/* ============================================================
   MODALES
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--surface);
    padding: 2rem;
    border-radius: 24px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 25px 60px rgba(0, 123, 255, 0.2);
    border: 1px solid var(--border);
}

.modal h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.25rem;
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 12px; }
.w-100 { width: 100%; }