/* ===== VARIABLES ===== */
:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #f44336;
    
    /* Light theme */
    --bg-main: #f5f7fa;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --text-main: #2c3e50;
    --text-muted: #64748b;
    --border-color: rgba(102, 126, 234, 0.2);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 60px rgba(102, 126, 234, 0.25);
}

[data-theme="dark"] {
    --bg-main: #0f0c29;
    --bg-card: rgba(30, 30, 60, 0.7);
    --bg-card-hover: rgba(40, 40, 80, 0.85);
    --text-main: #f0f0f0;
    --text-muted: #a0aec0;
    --border-color: rgba(102, 126, 234, 0.3);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 60px rgba(102, 126, 234, 0.4);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
}

/* ===== FONDO ANIMADO ===== */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: floatShape 20s infinite ease-in-out;
}

[data-theme="light"] .bg-shape {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="dark"] .bg-shape {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.2;
}

.shape-1 { width: 500px; height: 500px; top: -150px; left: -150px; }
.shape-2 { width: 400px; height: 400px; bottom: -100px; right: -100px; animation-delay: -5s; }
.shape-3 { width: 350px; height: 350px; top: 40%; left: 60%; animation-delay: -10s; }

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(80px, -80px) scale(1.1); }
    66% { transform: translate(-60px, 60px) scale(0.9); }
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ===== HEADER ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: all 0.3s ease;
}

.main-header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .main-header.scrolled {
    background: rgba(15, 12, 41, 0.85);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.2em;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.logo-text {
    font-size: 1.1em;
}

.logo-accent {
    color: var(--primary);
}

.main-nav {
    display: flex;
    gap: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    text-decoration: none;
    color: var(--text-main);
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95em;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-icon {
    font-size: 1.1em;
}

.theme-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    cursor: pointer;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-main);
}

.theme-toggle:hover {
    transform: rotate(180deg) scale(1.1);
    background: var(--primary);
    color: white;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-main);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ===== PAGE HERO ===== */
.page-hero {
    padding: calc(70px + 60px) 20px 80px;
    text-align: center;
    position: relative;
}

.page-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 20px;
}

.page-title {
    font-size: clamp(2em, 5vw, 3.5em);
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.2em;
    margin-bottom: 30px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 25px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 5px;
}

.stat-divider {
    width: 2px;
    height: 50px;
    background: var(--border-color);
}

/* ===== SECCIONES ===== */
.section {
    padding: 80px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 15px;
}

.section-title {
    font-size: clamp(1.8em, 4vw, 2.8em);
    font-weight: 800;
    margin-bottom: 15px;
}

.section-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    margin: 0 auto;
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1em;
    margin-top: 15px;
}

/* ===== INFO CARD ===== */
.info-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.info-item {
    text-align: center;
}

.info-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.info-item h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--primary);
}

.info-item p {
    color: var(--text-muted);
    line-height: 1.8;
}

.duration-highlight {
    font-size: 2em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 10px 0;
}

/* ===== CONTENTS GRID ===== */
.contents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.content-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.content-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.content-number {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2em;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.content-card h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--text-main);
}

.content-card p {
    color: var(--text-muted);
    font-size: 0.95em;
}

/* ===== EXAM SECTION ===== */
.exam-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

[data-theme="dark"] .exam-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

/* ===== EVALUATIONS GRID ===== */
.evaluations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.evaluation-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.evaluation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.evaluation-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.evaluation-card.unlocked {
    border: 2px solid var(--success);
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.3);
}

.evaluation-card.unlocked::before {
    background: linear-gradient(90deg, var(--success), #45a049);
}

.evaluation-card.final-eval {
    border: 2px solid var(--warning);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.05), rgba(255, 87, 34, 0.05));
}

.evaluation-card.final-eval::before {
    background: linear-gradient(90deg, var(--warning), var(--error));
    height: 6px;
}

.evaluation-card.final-eval.unlocked {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(69, 160, 73, 0.1));
}

.eval-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.eval-number {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1em;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.final-eval .eval-number {
    background: linear-gradient(135deg, var(--warning), var(--error));
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.eval-badge {
    padding: 6px 14px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.eval-badge.final {
    background: rgba(255, 152, 0, 0.15);
    color: var(--warning);
}

.evaluation-card h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: var(--text-main);
}

.eval-description {
    color: var(--text-muted);
    font-size: 0.95em;
    margin-bottom: 20px;
}

/* ===== PASSWORD SECTION ===== */
.password-section {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    width: 100%;
    align-items: stretch;
}

.module-password {
    flex: 1;
    min-width: 0; /* Evita que el input se desborde */
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9em;
    font-family: 'Poppins', sans-serif;
    background: var(--bg-card-hover);
    color: var(--text-main);
    transition: all 0.3s ease;
    max-width: 100%;
}

.module-password:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.module-password.correct {
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.module-password::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
    font-size: 0.85em;
}

.btn-check-password {
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    white-space: nowrap;
    flex-shrink: 0; /* Evita que el botón se encoja */
    min-width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-check-password:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-check-password:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.error-message {
    display: none;
    padding: 10px 15px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid var(--error);
    border-radius: 10px;
    color: var(--error);
    font-size: 0.85em;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    animation: shake 0.5s;
    width: 100%;
}

.error-message.show {
    display: flex;
}

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

/* ===== BUTTONS ===== */
.btn-eval {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: auto;
}

.btn-eval:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-eval:hover:not(.disabled) .btn-arrow {
    transform: translateX(5px);
}

.btn-eval.disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    pointer-events: none;
}

.btn-final {
    background: linear-gradient(135deg, var(--warning), var(--error));
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.btn-final:hover:not(.disabled) {
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.6);
}

.btn-arrow {
    transition: transform 0.3s ease;
}

/* ===== FOOTER ===== */
.main-footer {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 40px 20px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.btn-back-footer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: var(--bg-card-hover);
    color: var(--primary);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.btn-back-footer:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-5px);
    border-color: var(--primary);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* ===== ANIMATIONS ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        justify-content: center;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .stat-divider {
        display: none;
    }
    
    .password-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-check-password {
        width: 100%;
        min-width: auto;
        padding: 14px 20px;
    }
    
    .module-password {
        width: 100%;
    }
    
}

@media (max-width: 600px) {
    .header-content {
        padding: 0 15px;
    }
    
    .logo-text {
        display: none;
    }
    
    .page-hero {
        padding: calc(70px + 40px) 15px 60px;
    }
    
    .section {
        padding: 50px 15px;
    }
    
    .info-card {
        padding: 25px;
    }
    
    .evaluation-card {
        padding: 25px;
    }
    
    .evaluations-grid {
        grid-template-columns: 1fr;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}