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

:root {
    --blue: #3b82f6;
    --blue-dark: #2563eb;
    --blue-light: #eff6ff;
    --green: #2bd67b;
    --green-dark: #20c06a;
    --green-light: #dcfce7;
    --purple: #8b5cf6;
    --purple-dark: #7c3aed;
    --purple-light: #f3e8ff;
    --pink: #ec4899;
    --pink-light: #fdf2f8;
    --yellow: #fbbf24;
    --yellow-light: #fef9c3;
    --red: #ef4444;
    --red-light: #fef2f2;
    --dark: #0f172a;
    --slate: #1e293b;
    --text: #334155;
    --muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --white: #ffffff;
    --radius-sm: 0.75rem;
    --radius-md: 1.25rem;
    --radius-lg: 2rem;
    --radius-xl: 2.5rem;
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 20px -5px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.12);
}

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

body {
    font-family: 'Nunito', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    background-image: radial-gradient(#cbd5e1 1.5px, transparent 1.5px), radial-gradient(#cbd5e1 1.5px, transparent 1.5px);
    background-size: 32px 32px;
    background-position: 0 0, 16px 16px;
    color: var(--slate);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
img {max-width: 100%;display: block;border-radius: 50%;}
ul { list-style: none; }

/* LAYOUT & CONTAINERS */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
.container-wide {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
main { flex: 1; }

/* NAVBAR */
.navbar {
    background: var(--white);
    border-bottom: 3px solid #a7f3d0;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}
.navbar-inner {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 900;
    font-size: 1.5rem;
    color: #6366f1;
}
.brand-logo {
    width: 50px;
    height: 50px;
    background: #e0f2fe;
    border: 2px solid #bae6fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    transition: transform 0.2s;
}
.brand:hover .brand-logo { transform: rotate(12deg); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    font-weight: 800;
    color: var(--text);
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0;
    position: relative;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--blue); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* BOTONES 3D (.btn-fun) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 900;
    font-size: 0.95rem;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.12s ease-in-out;
}
.btn-fun {
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.16);
}
.btn-fun:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.16);
}
.btn-lg { font-size: 1.1rem; padding: 1rem 1.85rem; border-radius: 1.25rem; }
.btn-sm { font-size: 0.8rem; padding: 0.5rem 0.9rem; border-radius: 0.75rem; }
.btn-block { width: 100%; }

.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: var(--green-dark); }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-dark); }
.btn-purple { background: var(--purple); color: var(--white); }
.btn-purple:hover { background: var(--purple-dark); }
.btn-pink { background: var(--pink); color: var(--white); }
.btn-red { background: var(--red); color: var(--white); }
.btn-outline { background: var(--white); border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

/* HERO SECTION */
.hero {
    background: linear-gradient(135deg, #e6fffa 0%, #f0fdf4 50%, #eff6ff 100%);
    padding: 4rem 0 5rem;
    border-bottom: 2px dashed var(--border);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 3rem;
}
.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--yellow-light);
    color: #ca8a04;
    border: 1px solid #fef08a;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}
.hero-title {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    font-weight: 900;
    line-height: 1.12;
    color: var(--slate);
    margin-bottom: 1.25rem;
}
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple); }
.text-pink { color: var(--pink); }
.text-yellow { color: var(--yellow); }

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 2rem;
    max-width: 540px;
}
.hero-circle {
    width: 360px;
    height: 360px;
    margin: 0 auto;
    border-radius: 50%;
    border: 3px dashed #5ba6ff;
    background: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.hero-avatar {
    width: 315px;
    height: 315px;
    background: var(--white);
    border-radius: 50%;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: float 4s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

/* SECCIONES Y GRILLAS */
.section { padding: 4.5rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-title { font-size: clamp(2rem, 3.5vw, 3rem); font-weight: 900; margin-bottom: 0.5rem; }
.section-desc { color: var(--muted); font-weight: 700; font-size: 1.05rem; }

.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 2.25rem; }

/* TARJETAS DE CURSOS Y METODOLOGÍA */
.step-card {
    background: var(--white);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    border: 4px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s;
}
.step-card:hover { transform: translateY(-6px); }
.step-icon {
    width: 64px;
    height: 64px;
    border-radius: 1.1rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--white);
}

.card-fun {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 4px solid var(--white);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-fun:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-lg);
}
.card-thumb-wrap {
    position: relative;
    height: 230px;
    overflow: hidden;
    background: #e2e8f0;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.card-fun:hover .card-thumb-wrap img { transform: scale(1.06); }
.price-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--yellow);
    color: #4c1d95;
    font-weight: 900;
    padding: 0.4rem 1rem;
    border-radius: 1rem;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
    transform: rotate(-3deg);
}
.card-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.card-title { font-size: 1.45rem; font-weight: 900; margin-bottom: 0.65rem; }
.card-text { color: var(--muted); font-weight: 600; margin-bottom: 1.5rem; flex: 1; }
.card-footer {
    padding-top: 1.1rem;
    border-top: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* FORMULARIOS Y CAJAS DE AUTENTICACIÓN */
.auth-card {
    max-width: 480px;
    margin: 3rem auto;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border);
    overflow: hidden;
}
.auth-header {
    padding: 2rem;
    text-align: center;
    color: var(--white);
}
.auth-body { padding: 2rem; }

.form-group { margin-bottom: 1.15rem; }
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.4rem;
}
.form-control {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 2px solid var(--border);
    border-radius: 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--slate);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--blue); }
textarea.form-control { resize: vertical; min-height: 90px; }

/* ALERTAS & BADGES */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    font-weight: 800;
    font-size: 0.92rem;
    margin-bottom: 1.25rem;
    text-align: center;
}
.alert-error { background: var(--red-light); color: var(--red); border: 2px solid #fecaca; }
.alert-success { background: var(--green-light); color: #15803d; border: 2px solid #bbf7d0; }
.alert-warning { background: var(--yellow-light); color: #b45309; border: 2px solid #fef08a; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 900;
}
.badge-paid { background: var(--green-light); color: #15803d; border: 1px solid #bbf7d0; }
.badge-pending { background: var(--yellow-light); color: #ca8a04; border: 1px solid #fef08a; }
.badge-suspended { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.badge-expired { background: var(--red-light); color: var(--red); border: 1px solid #fecaca; }

/* REPRODUCTOR DE CLASES (AULA) */
.player-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 2rem 0 4rem;
}
.video-box {
    background: var(--white);
    padding: 0.85rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-md);
}
.video-frame {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    border-radius: 1.5rem;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
    padding: 1.5rem;
}
.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.playlist-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.playlist-header {
    background: var(--pink);
    color: var(--white);
    padding: 1.15rem;
    font-weight: 900;
    font-size: 1.15rem;
    text-align: center;
}
.playlist-items {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 520px;
    overflow-y: auto;
}
.lesson-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem;
    border-radius: 1rem;
    border: 2px solid var(--border);
    transition: all 0.2s;
}
.lesson-item:hover { border-color: var(--blue); background: var(--blue-light); }
.lesson-item.active { border-color: var(--blue); background: var(--blue-light); }
.lesson-item.locked { opacity: 0.65; background: #f8fafc; }
.lesson-num {
    width: 40px;
    height: 40px;
    border-radius: 0.8rem;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    flex-shrink: 0;
}
.lesson-item.active .lesson-num { background: var(--blue); color: var(--white); }

/* PANELES ADMINISTRATIVOS (ADMIN Y PROFESOR) */
.admin-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    margin: 2rem 0 4rem;
    align-items: start;
}
.panel-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.panel-box-header {
    background: #f8fafc;
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.tabs-bar {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 1.5rem 0;
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}
.tab-btn {
    background: none;
    border: none;
    border-bottom: 4px solid transparent;
    padding: 0.6rem 0.25rem 1rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tab-btn.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

/* TABLAS */
.table-wrap { width: 100%; overflow-x: auto; padding: 1rem; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; text-align: left; }
.table th {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.85rem 1rem;
    border-bottom: 2px solid var(--border);
}
.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:hover td { background: #f8fafc; }

/* MODALES */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
}
.modal-header {
    padding: 1.5rem;
    color: var(--white);
    text-align: center;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
    cursor: pointer;
    font-weight: 900;
}
.modal-body { padding: 1.5rem; }

/* FOOTER */
.footer {
    background: var(--dark);
    color: #cbd5e1;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
.footer h4 { color: var(--white); font-weight: 900; margin-bottom: 1rem; }
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 700;
}

@media (max-width: 992px) {
    .hero-grid, .player-layout, .admin-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}