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

:root {
    /* Light Theme (Default) */
    --bg-gradient-start: #049FD9;
    --bg-gradient-end: #1E3A8A;

    /* Text */
    --text-color: #1f2937;
    --text-muted: #4b5563;
    --text-primary: #1f2937;
    /* alias de --text-color */
    --text-secondary: #4b5563;
    /* alias de --text-muted */

    /* Cards / surfaces */
    --card-bg: white;
    --card-border: transparent;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --surface-bg: #f8fafc;
    /* fondos interiores suaves */
    --surface-border: #e2e8f0;
    /* bordes suaves */

    /* Inputs */
    --input-bg: white;
    --input-border: #e2e8f0;
    --input-text: #1f2937;
    --border-color: #e2e8f0;
    /* alias de --input-border */

    /* Brand */
    --primary-color: #049FD9;
    --heading-color: #1B3B5F;

    /* Misc */
    --node-border: white;
    --node-shadow: rgba(0, 100, 150, 0.5);
}

.dark-mode {
    /* Deep Dark Theme */
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;

    /* Text */
    --text-color: #f8fafc;
    --text-muted: #cbd5e1;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    /* Cards / surfaces */
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --card-shadow: rgba(0, 0, 0, 0.4);
    --surface-bg: #1e293b;
    /* fondos interiores oscuros */
    --surface-border: rgba(255, 255, 255, 0.08);

    /* Inputs */
    --input-bg: rgba(30, 41, 59, 0.9);
    --input-border: #475569;
    --input-text: #f8fafc;
    --border-color: #475569;

    /* Brand */
    --primary-color: #12b6e8;
    --heading-color: #f8fafc;

    /* Misc */
    --node-border: white;
    --node-shadow: rgba(0, 100, 150, 0.5);
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: clamp(8px, 2.5vw, 20px);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background 0.5s ease;
    margin: 0;
    overflow-x: hidden;
    /* Asegurar que no haya márgenes que causen scroll innecesario */
}

.container {
    max-width: 1100px;
    /* Increased from 900px to fit all stats */
    margin: 0 auto;
    width: 100%;
}

/* ── Banner de sincronización pendiente ─────────────────────────────────── */
.sync-warning-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #92400e;
    flex-wrap: wrap;
}

.dark-mode .sync-warning-banner {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
}

.sync-warning-banner i.fa-exclamation-triangle {
    color: #f59e0b;
    flex-shrink: 0;
}

.sync-warning-banner span {
    flex: 1;
    min-width: 180px;
}

.sync-warning-banner button {
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.sync-warning-banner button:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.sync-warning-banner button:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.header {
    background: rgba(255, 255, 255, 0.85);
    /* Glassmorphism light */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dark mode override for header */
.dark-mode .header {
    background: var(--card-bg);
}

.logo {
    display: flex;
    align-items: center;
}

.logo span {
    font-size: 32px;
    font-weight: 700;
    color: var(--heading-color);
}

.logo-img {
    height: 96px;
    /* Adjusted size based on request */
    width: auto;
    object-fit: contain;
}

/* --- Premium Animated Theme Toggle Button --- */

/* SweetAlert Custom Styles */
.swal-button-custom {
    border-radius: 12px !important;
    font-weight: 700 !important;
    padding: 12px 24px !important;
    box-shadow: 0 4px 6px rgba(4, 159, 217, 0.3) !important;
    transition: all 0.2s ease !important;
}

.swal-button-custom:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(4, 159, 217, 0.4) !important;
}

.theme-toggle-animated {
    --size: 44px;
    --icon-fill: #FFD700;
    --icon-fill-hover: #F59E0B;
    background: var(--card-bg);
    border: none;
    cursor: pointer;
    width: var(--size);
    height: var(--size);
    min-width: var(--size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    color: var(--icon-fill);
    flex-shrink: 0;
}

.theme-toggle-animated:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
    color: var(--icon-fill-hover);
}

.dark-mode .theme-toggle-animated {
    --icon-fill: #C084FC;
    --icon-fill-hover: #D8B4FE;
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* SVG Animations (Morphing Sun to Moon) */
.sun-and-moon> :is(.moon, .sun, .sun-beams) {
    transform-origin: center;
}

.sun-and-moon> :is(.moon, .sun) {
    transition: transform .5s cubic-bezier(.5, 1.25, .75, 1.25);
}

.sun-and-moon>.sun-beams {
    transition: transform .5s cubic-bezier(.5, 1.5, .75, 1.25), opacity .5s cubic-bezier(.25, 0, .3, 1);
}

/* Dark mode transitions */
.dark-mode .sun-and-moon>.sun {
    transform: scale(1.75);
}

.dark-mode .sun-and-moon>.sun-beams {
    opacity: 0;
    transform: rotateZ(-25deg);
}

.dark-mode .sun-and-moon>.moon>circle {
    transform: translateX(-7px);
    transition: transform .25s cubic-bezier(0, 0, 0, 1) .1s;
}

body:not(.dark-mode) .sun-and-moon>.moon>circle {
    transform: translateX(0);
    transition: transform .5s cubic-bezier(0, 0, 0, 1);
}

.stats {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    margin-right: 0;
}

.stat {
    background: var(--card-bg);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    min-width: 0;
    color: inherit;
    flex-shrink: 0;
}

.stat:hover {
    transform: translateY(-3px);
    background: var(--card-bg);
    /* Ensure background stays white */
    box-shadow: 0 8px 20px var(--card-shadow);
}

.stat-icon {
    font-size: 28px;
    transition: transform 0.3s;
}

.stat:hover .stat-icon {
    transform: scale(1.15);
}

/* Logo adjustments for Dark Mode */
.dark-mode .logo-img {
    filter: brightness(0) invert(1);
    /* Make it white */
}

/* Base definitions for all Custom SVGs Stats */
.duo-stat-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: -4px;
}

.duo-stat-svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat:hover .duo-stat-svg {
    transform: scale(1.1) rotate(5deg);
}

.stat-energy {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.stat-energy .stat-icon {
    /* Color magenta eléctrico estilo Duolingo */
    color: #FF4B82;
    transition: all 0.3s ease;
}

/* Base definitions for the custom SVG battery */
.duo-energy-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: -4px;
}

.duo-energy-svg {
    filter: drop-shadow(0 4px 6px rgba(255, 75, 130, 0.3));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-energy:hover .duo-energy-svg {
    transform: scale(1.1) rotate(5deg);
}

/* Energy Container Full State */
.stat-energy.full-energy {
    background: linear-gradient(135deg, rgba(255, 75, 130, 0.05) 0%, rgba(255, 30, 86, 0.05) 100%);
    border: 1px solid rgba(255, 75, 130, 0.3);
    box-shadow: 0 4px 15px rgba(255, 75, 130, 0.15);
}

.dark-mode .stat-energy.full-energy {
    background: linear-gradient(135deg, rgba(255, 75, 130, 0.1) 0%, rgba(255, 30, 86, 0.1) 100%);
    border: 1px solid rgba(255, 75, 130, 0.4);
}

.stat-energy.full-energy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: shine 3s infinite;
}

.dark-mode .stat-energy.full-energy::before {
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 100%);
}

@keyframes shine {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.stat-streak .stat-icon {
    color: #FF8C42;
}

.stat-lessons .stat-icon {
    color: #4ADE80;
}

.stat-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-value {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(15px, 2.5vw, 20px);
    font-weight: 800;
    color: var(--text-color) !important;
    line-height: 1;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    /* Improved contrast: changed from #6b7280 to #4b5563 for WCAG AA compliance */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Separador visual en la barra de estadísticas del header */
.stats-separator {
    width: 2px;
    height: 28px;
    background: var(--surface-border);
    border-radius: 2px;
    opacity: 0.5;
    flex-shrink: 0;
}

.main-content {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: clamp(20px, 4vw, 40px);
    margin-top: 0;
    box-shadow: 0 8px 32px var(--card-shadow);
    min-height: 500px;
}

.lesson-list {
    position: relative;
    padding: 60px 0;
    max-width: 900px;
    margin: 0 auto;
}

/* Contenedor de cada lección en el roadmap */
.roadmap-item {
    position: relative;
    margin-bottom: 80px;
    display: flex;
    align-items: center;
    /* Estado inicial: invisible y desplazado */
    opacity: 0;
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Desplazamiento inicial según lado */
.roadmap-item.left {
    transform: translateX(-60px);
}

.roadmap-item.right {
    transform: translateX(60px);
}

/* Cuando el observer activa la clase */
.roadmap-item.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Badge de módulo también animado */
.module-badge-container {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.module-badge-container.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alternar posición izquierda/derecha */
.roadmap-item.left {
    justify-content: flex-start;
    padding-right: 52%;
}

.roadmap-item.right {
    justify-content: flex-end;
    padding-left: 52%;
}

/* Ensure stats container is flex and visible */
.stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}

.lesson-node {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    z-index: 2;
    box-shadow: 0 6px 0 var(--node-shadow), 0 10px 20px rgba(0, 0, 0, 0.3);
    /* Botón 3D grueso ajustado al modo oscuro */
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 5px solid var(--node-border);
}

.lesson-node:not(.locked):hover {
    transform: translateX(-50%) translateY(4px);
    /* Se hunde ligeramente */
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.3);
    /* Reduce sombra al presionar */
}

/* Colores de nodos por módulo */
.lesson-node.module-1 {
    background: linear-gradient(135deg, #049FD9 0%, #1E3A8A 100%);
}

.lesson-node.module-2 {
    background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
}

.lesson-node.module-3 {
    background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
}

.lesson-node.module-4 {
    background: linear-gradient(135deg, #374151 0%, #1F2937 100%);
}

.lesson-node.locked {
    background: #9ca3af;
    opacity: 0.6;
}

.lesson-node.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Línea conectora desde el nodo a la tarjeta */
.lesson-connector {
    position: absolute;
    top: 50%;
    width: 50px;
    height: 6px;
    background: linear-gradient(90deg, rgba(4, 159, 217, 0.2) 0%, rgba(224, 224, 224, 0.6) 100%);
    border-radius: 4px;
    z-index: 1;
}

.roadmap-item.left .lesson-connector {
    right: 50%;
    margin-right: 35px;
}

.roadmap-item.right .lesson-connector {
    left: 50%;
    margin-left: 35px;
}

.lesson-connector.completed {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

/* Tarjeta de lección */
.lesson-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--card-border);
    width: 380px;
    box-shadow: 0 8px 24px var(--card-shadow);
    position: relative;
    z-index: 1;
    color: var(--text-color);
}

.roadmap-item.left .lesson-card {
    margin-right: 90px;
}

.roadmap-item.right .lesson-card {
    margin-left: 90px;
}

.lesson-card:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Estado bloqueado */
.lesson-card.locked {
    background: #f8fafc;
    opacity: 0.8;
    cursor: not-allowed;
    filter: grayscale(1);
    box-shadow: none;
}

.lesson-card.locked:hover {
    transform: none;
}

.lesson-card.locked .lesson-title {
    color: #64748b;
    /* Improved contrast: changed from #94a3b8 to #64748b */
}

/* Estado completado */
.lesson-card.completed {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.lesson-card.completed .lesson-title,
.lesson-card.completed .lesson-description {
    color: white;
}

.lesson-card.completed .lesson-status {
    background: transparent;
}

/* Colores por módulo (para tarjetas activas/pendientes) */
.lesson-card.module-1 {
    border-top: 5px solid #049FD9;
}

.lesson-card.module-2 {
    border-top: 5px solid #1E3A8A;
}

.lesson-card.module-3 {
    border-top: 5px solid #7C3AED;
}

.lesson-card.module-4 {
    border-top: 5px solid #DB2777;
}

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

/* Título de la lección */
.lesson-title {
    font-size: clamp(14px, 2.5vw, 18px);
    font-weight: 700;
    color: var(--heading-color);
    /* Dark Blue Text */
    margin-bottom: 8px;
    padding-right: 40px;
}

.lesson-status {
    font-size: 24px;
}

/* Descripción */
.lesson-description {
    font-size: 14px;
    color: var(--text-muted);
    /* Improved contrast: changed from #64748b to #475569 for better readability */
    line-height: 1.5;
}

/* Contenedor del badge que corta la línea */
.module-badge-container {
    position: relative;
    z-index: 1;
    background: transparent;
    /* Changed from var(--card-bg) to avoid the transparent box issue */
    padding: 20px 0;
    margin: 30px auto;
    width: fit-content;
}

/* Badge de módulo */
.module-badge {
    background: linear-gradient(135deg, #049FD9 0%, #1E3A8A 100%);
    color: white !important;
    /* Force white text */
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    max-width: 450px;
    box-shadow: 0 6px 20px rgba(4, 159, 217, 0.4);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module-badge.module-2 {
    background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.module-badge.module-3 {
    background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.module-badge.module-4 {
    background: linear-gradient(135deg, #374151 0%, #1F2937 100%);
    box-shadow: 0 4px 12px rgba(55, 65, 81, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .lesson-list::before {
        left: 30px;
    }

    .roadmap-item.left,
    .roadmap-item.right {
        justify-content: flex-start;
        padding-left: 80px;
        padding-right: 0;
    }

    .lesson-node {
        left: 30px;
        transform: translateX(0);
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .lesson-connector {
        display: none;
    }

    .lesson-card {
        width: calc(100% - 80px);
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

.exercise-container {
    display: none;
}

.exercise-container.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 30px;
}

.options {
    display: grid;
    gap: 12px;
    margin-bottom: 30px;
}

.option {
    background: var(--input-bg);
    border: 3px solid var(--input-border);
    border-radius: 12px;
    padding: 18px 24px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 16px;
    color: var(--input-text);
}

.option:hover {
    border-color: #049FD9;
    background: #e0f2fe;
    transform: translateY(-2px);
}

.option:active {
    transform: scale(0.98);
    /* Micro-interacción de hundimiento */
}

.option.selected {
    border-color: #049FD9;
    background: #dbeafe;
}

.option.correct {
    border-color: #4ade80;
    background: #d4fce3;
}

.option.incorrect {
    border-color: #f87171;
    background: #fee2e2;
}

.option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Botones y Elementos de Interacción */
.button {
    background: linear-gradient(135deg, #FF5A7E 0%, #E11D48 100%);
    /* Gradiente dinámico */
    background-size: 200% auto;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(255, 90, 126, 0.3);
}

.button:hover {
    background-position: right center;
    /* Animar gradiente */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 90, 126, 0.4);
}

.button:active {
    transform: scale(0.96);
    /* Hundimiento al presionar */
    box-shadow: 0 2px 4px rgba(255, 90, 126, 0.2);
}

.button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button.secondary {
    background: #e0e0e0;
    color: #333;
}

.feedback {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    font-size: 16px;
    display: none;
}

.feedback.show {
    display: block;
    animation: slideUp 0.3s;
}

/* Welcome Message */
.dark-mode h1,
.dark-mode #welcome-message {
    color: white !important;
}

/* Título de sección (Roadmap) */
h2 {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 700;
    color: var(--heading-color);
    text-align: center;
    margin-bottom: clamp(20px, 4vw, 40px);
}

/* Ajustes a tarjetas pendientes (Available/Pending) */
/* Asumimos que son las tarjetas por defecto que no tienen .locked ni .completed */
.lesson-card:not(.locked):not(.completed) {
    background: #1B3B5F;
    /* Dark Blue as requested */
    color: white;
    /* This specific card style is meant to be dark blue always */
}

.lesson-card:not(.locked):not(.completed) .lesson-title {
    color: white;
    /* High contrast */
}

.lesson-card:not(.locked):not(.completed) .lesson-description {
    color: rgba(255, 255, 255, 0.9);
    /* High contrast */
}

.lesson-card:not(.locked):not(.completed) .lesson-status {
    background: transparent;
    color: white;
}

/* --- User Profile & Login Styles --- */

/* Full Screen Views */
.full-screen-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    font-family: 'Nunito', sans-serif;
}

/* Login View Styling */
#login-view {
    background: linear-gradient(135deg, #049FD9 0%, #1E3A8A 100%);
    color: white;
}

.login-card {
    background: var(--card-bg);
    padding: 50px;
    border-radius: 24px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-logo {
    height: 100px;
    margin-bottom: 20px;
}

.login-card h1 {
    font-size: 32px;
    color: var(--heading-color);
    margin-bottom: 10px;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.5;
}

.login-form input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 20px;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--input-text);
}

.login-form input:focus {
    border-color: #049FD9;
    box-shadow: 0 0 0 4px rgba(4, 159, 217, 0.1);
}

/* Loading View Styling */
#loading-view {
    background: var(--card-bg);
    flex-direction: column;
}

.loader-content {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e2e8f0;
    border-top: 5px solid #049FD9;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

#loading-text {
    color: var(--heading-color);
    font-size: 18px;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

/* Profile Header Button */
.stat-profile {
    cursor: pointer;
    transition: all 0.3s;
}

.stat-profile:hover {
    background: #e0f2fe;
    /* Light blue hover */
    transform: translateY(-3px);
}

.stat-profile:hover .duo-stat-svg {
    transform: scale(1.1) rotate(5deg);
}

/* Login Overlay */
#login-overlay {
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

#login-overlay input:focus {
    border-color: #049FD9 !important;
    box-shadow: 0 0 0 4px rgba(4, 159, 217, 0.1);
}

/* Profile View in Dashboard */
#profile-view {
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.profile-stats .stat {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 24px;
    flex-direction: column;
    text-align: center;
    gap: 10px;
    justify-content: center;
}

.profile-stats .stat-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.profile-stats .stat-value {
    font-size: 36px;
    color: var(--heading-color) !important;
}

.profile-stats .stat-label {
    font-size: 14px;
    color: #64748b;
}

.plan-badge-free {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
}

.plan-upgrade-link {
    color: #f59e0b;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.plan-upgrade-link:hover {
    color: #d97706;
    transform: translateX(2px);
}

.dark-mode .plan-badge-free {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

/* Animations */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* Removemos los bordes de color por módulo en las tarjetas oscuras para limpieza visual, o los mantenemos? */
/* El usuario pidió "Pending card... increase text contrast". Si el fondo es dark blue, los bordes de color podrían verse bien o mal.
   Vamos a dejar los bordes top que pusimos antes, pero asegurándonos que el texto sea blanco. */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback.correct {
    background: #d4fce3;
    color: #166534;
    border: 2px solid #4ade80;
}

.feedback.incorrect {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #f87171;
}

.progress-bar {
    background: #e0e0e0;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #049FD9 0%, #1E3A8A 100%);
    height: 100%;
    transition: width 0.3s;
    border-radius: 4px;
}

/* Header de navegación de lección */
.lesson-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.lesson-title-nav {
    font-size: 20px;
    font-weight: 600;
    color: var(--heading-color);
}

/* Grupo de controles (corazones + botón X) */
.lesson-controls-group {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
}

.exit-button {
    background: transparent;
    border: 2px solid var(--input-border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 18px;
    z-index: 100;
    position: relative;
}

.exit-button:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #dc2626;
    transform: scale(1.1);
}

/* Contador de energía en la lección - Baterías individuales */
.lesson-energy-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 20px;
    background: linear-gradient(to bottom, var(--card-bg), #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), inset 0 2px 4px rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.dark-mode .lesson-energy-counter {
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    border-color: #334155;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.05);
}

.lesson-energy {
    width: 38px;
    height: 38px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lesson-energy .duo-energy-svg {
    width: 100%;
    height: 100%;
}

/* Active Energy State (Full Battery) */
.lesson-energy.energy-active {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 4px 6px rgba(255, 75, 130, 0.4));
}

.lesson-energy.energy-active .duo-bg {
    fill: #FF4B82;
    stroke: #D9205A;
    stroke-width: 4;
}

.lesson-energy.energy-active .duo-cap {
    stroke: #D9205A;
    stroke-width: 6;
}

.lesson-energy.energy-active .duo-bolt {
    fill: #FFFFFF;
}

.lesson-energy.energy-active .duo-highlight {
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 4;
}

/* Lost Energy State (Empty Battery) */
.lesson-energy.energy-lost {
    opacity: 0.6;
    transform: scale(0.85);
    filter: none;
}

.lesson-energy.energy-lost .duo-bg {
    fill: #e2e8f0;
    stroke: #cbd5e1;
    stroke-width: 4;
}

.lesson-energy.energy-lost .duo-cap {
    stroke: #cbd5e1;
    stroke-width: 6;
}

.lesson-energy.energy-lost .duo-bolt {
    fill: #f1f5f9;
}

.lesson-energy.energy-lost .duo-highlight {
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 4;
}

.dark-mode .lesson-energy.energy-lost .duo-bg {
    fill: #334155;
    stroke: #1e293b;
}

.dark-mode .lesson-energy.energy-lost .duo-cap {
    stroke: #1e293b;
}

.dark-mode .lesson-energy.energy-lost .duo-bolt {
    fill: #475569;
}

/* Animación de desaparición de la batería */
.lesson-energy.energy-disappear {
    animation: premiumEnergyDisappear 0.6s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

@keyframes premiumEnergyDisappear {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 4px 6px rgba(255, 75, 130, 0.4));
    }

    15% {
        transform: scale(1.2) rotate(-5deg);
        filter: drop-shadow(0 6px 10px rgba(255, 75, 130, 0.6));
    }

    30% {
        transform: scale(1.1) rotate(5deg);
    }

    100% {
        transform: scale(0) translateY(30px) rotate(20deg);
        opacity: 0;
        filter: drop-shadow(0 0 0 transparent);
    }
}

/* Animación de aparición de batería */
.lesson-energy.energy-appear {
    animation: premiumEnergyAppear 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes premiumEnergyAppear {
    0% {
        transform: scale(0) translateY(-30px);
        opacity: 0;
    }

    50% {
        transform: scale(1.3) translateY(0);
        opacity: 0.9;
        filter: drop-shadow(0 6px 10px rgba(255, 75, 130, 0.5));
    }

    75% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 4px 6px rgba(255, 75, 130, 0.4));
    }
}

/* Timer Premium Styles */
.stat-timer {
    font-size: 11px !important;
    font-weight: 800 !important;
    font-family: 'JetBrains Mono', monospace;
    margin-top: -2px !important;
    background: linear-gradient(135deg, #fff0f4 0%, #fce7ef 100%);
    color: #D9205A !important;
    padding: 3px 9px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    letter-spacing: 0.5px;
    border: 1.5px solid rgba(217, 32, 90, 0.25);
    box-shadow: 0 1px 6px rgba(255, 75, 130, 0.15);
}

.dark-mode .stat-timer {
    background: linear-gradient(135deg, #2d1520 0%, #3d1a28 100%);
    border-color: rgba(255, 75, 130, 0.3);
    color: #FF4B82 !important;
    box-shadow: 0 1px 6px rgba(255, 75, 130, 0.2);
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Contador de ejercicios */
.exercise-counter {
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Botones de navegación */
.navigation-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.nav-button {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-button:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #d1d5db;
    transform: translateY(-2px);
}

.nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-button i {
    font-size: 14px;
}

.theory-content {
    background: #e0f2fe;
    border-left: 4px solid #049FD9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.theory-content h3 {
    color: #049FD9;
    margin-bottom: 15px;
}

.theory-content p {
    line-height: 1.6;
    color: #333;
    /* Theory text stays dark in light box */
    margin-bottom: 12px;
}

.theory-content ul {
    margin-left: 20px;
    line-height: 1.8;
}

.completion-screen {
    text-align: center;
    padding: 40px;
    display: none;
}

.completion-screen.show {
    display: block;
    animation: fadeIn 0.5s;
}

.completion-icon {
    font-size: 80px;
    margin-bottom: 20px;
    color: #F59E0B;
}

.completion-title {
    font-size: 32px;
    font-weight: bold;
    color: var(--heading-color);
    margin-bottom: 10px;
}

.completion-nodes {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 800;
    color: #00C8FF;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.completion-nodes-label {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.85;
}

.completion-points {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    color: #10b981;
    margin-bottom: 6px;
    font-weight: 700;
    margin: 20px 0;
    letter-spacing: -0.5px;
}

.input-answer {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 3px solid var(--input-border);
    border-radius: 12px;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
    background: var(--input-bg);
    color: var(--input-text);
}

.input-answer:focus {
    outline: none;
    border-color: #049FD9;
}

.matching-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.matching-item {
    background: var(--input-bg);
    border: 3px solid var(--input-border);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--input-text);
}

.matching-item:hover {
    border-color: #049FD9;
}

.matching-item.selected {
    border-color: #049FD9;
    background: #dbeafe;
}

.matching-item.matched {
    border-color: #4ade80;
    background: #d4fce3;
    cursor: default;
}

/* Animations */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.3);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.3);
    }

    70% {
        transform: scale(1);
    }
}

.stat-energy .stat-icon.beating {
    animation: heartBeat 1.5s infinite;
    color: #FF4B82;
}

.stat-energy .stat-value span {
    font-weight: normal;
}

/* --- New Login UI Styles (Scoped) --- */
/* Adapted from Uiverse.io by Smit-Prajapati */

.login-card-container {
    max-width: 350px;
    width: calc(100% - 40px); /* Evita overflow en pantallas pequeñas */
    background: #F8F9FD;
    background: linear-gradient(0deg, rgb(255, 255, 255) 0%, rgb(244, 247, 251) 100%);
    border-radius: 40px;
    padding: 25px 35px;
    border: 5px solid rgb(255, 255, 255);
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 30px 30px -20px;
    margin: 20px auto;
    text-align: center;
    /* Centering content */
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-heading {
    text-align: center;
    font-weight: 900;
    font-size: 30px;
    color: rgb(16, 137, 211);
    margin-bottom: 20px;
}

.login-form-new {
    margin-top: 20px;
}

.login-form-new .login-input {
    width: 100%;
    background: white;
    border: none;
    padding: 15px 20px;
    border-radius: 20px;
    margin-top: 15px;
    box-shadow: #cff0ff 0px 10px 10px -5px;
    border-inline: 2px solid transparent;
    font-family: inherit;
    /* Inherit font from body */
}

.login-form-new .login-input::-moz-placeholder {
    color: rgb(170, 170, 170);
}

.login-form-new .login-input::placeholder {
    color: rgb(170, 170, 170);
}

.login-form-new .login-input:focus {
    outline: none;
    border-inline: 2px solid #12B1D1;
}

/* El input dentro del wrapper del ojo mantiene su apariencia normal;
   el botón se posiciona encima via absolute */
.login-form-new .reg-input-wrapper .login-input {
    margin-top: 0;
}

.login-form-new .forgot-password {
    display: block;
    margin-top: 10px;
    margin-left: 10px;
    text-align: right;
}

.login-form-new .forgot-password a {
    font-size: 11px;
    color: #0099ff;
    text-decoration: none;
}

.login-form-new .login-btn-new {
    display: block;
    width: 100%;
    font-weight: bold;
    background: linear-gradient(45deg, rgb(16, 137, 211) 0%, rgb(18, 177, 209) 100%);
    color: white;
    padding-block: 15px;
    margin: 20px auto;
    border-radius: 20px;
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 20px 10px -15px;
    border: none;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    font-size: 16px;
}

.login-form-new .login-btn-new:hover {
    transform: scale(1.03);
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 23px 10px -20px;
}

.login-form-new .login-btn-new:active {
    transform: scale(0.95);
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 15px 10px -10px;
}

.social-account-container {
    margin-top: 25px;
}

.social-account-container .title {
    display: block;
    text-align: center;
    font-size: 10px;
    color: rgb(170, 170, 170);
}

.social-account-container .social-accounts {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
}

.social-account-container .social-accounts .social-button {
    background: linear-gradient(45deg, rgb(0, 0, 0) 0%, rgb(112, 112, 112) 100%);
    border: 5px solid white;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    /* Explicit height */
    aspect-ratio: 1;
    display: grid;
    place-content: center;
    box-shadow: rgba(133, 189, 215, 0.8784313725) 0px 12px 10px -8px;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.social-account-container .social-accounts .social-button .svg {
    fill: white;
    margin: auto;
}

.social-account-container .social-accounts .social-button:hover {
    transform: scale(1.2);
}

.social-account-container .social-accounts .social-button:active {
    transform: scale(0.9);
}

.agreement {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #475569;
    /* Ensure visible text on white card */
    font-size: 14px;
}

.agreement a {
    text-decoration: none;
    color: #049FD9;
    font-size: 14px;
    font-weight: 600;
}

/* Animation reused for errors and alerts */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Animación para regeneración de vida */
@keyframes lifeRegenPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
        color: #10b981;
        text-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    }

    100% {
        transform: scale(1);
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.life-regen-pulse {
    animation: lifeRegenPulse 0.6s ease-in-out;
}

/* Error state for new login input */
.login-form-new .login-input.input-error {
    border-inline: 2px solid #ef4444;
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* --- New Exercise UI Styles --- */

.theory-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.theory-card h3 {
    color: #1B3B5F;
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0f2fe;
}

.theory-text {
    font-size: 16px;
    line-height: 1.8;
    color: #334155;
    white-space: pre-line;
    /* Handle line breaks in text */
}

.theory-text ul {
    margin-left: 20px;
    margin-top: 10px;
}

.theory-text li {
    margin-bottom: 8px;
}

.question-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.question-text {
    font-size: clamp(15px, 2.5vw, 20px);
    color: #1B3B5F;
    margin-bottom: 25px;
    font-weight: 600;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.option-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    text-align: left;
    font-size: 16px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.option-btn:hover:not(:disabled) {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-2px);
}

.option-btn.selected {
    border-color: #049FD9;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 500;
}

.option-btn.correct {
    border-color: #22c55e;
    background: #dcfce7;
    color: #15803d;
}

.option-btn.incorrect {
    border-color: #ef4444;
    background: #fee2e2;
    color: #b91c1c;
    opacity: 0.7;
}

.exercise-input {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.exercise-input:focus {
    border-color: #049FD9;
    box-shadow: 0 0 0 3px rgba(4, 159, 217, 0.1);
}

.lesson-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.nav-btn,
.action-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    font-size: 16px;
}

.nav-btn.secondary {
    background: #f1f5f9;
    color: #64748b;
}

.nav-btn.secondary:hover:not(:disabled) {
    background: #e2e8f0;
    color: #475569;
}

.action-btn.primary {
    background: #049FD9;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(4, 159, 217, 0.3);
}

.action-btn.primary:hover:not(:disabled) {
    background: #0369a1;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(4, 159, 217, 0.4);
}

.action-btn.success {
    background: #22c55e;
    color: white;
}

.action-btn:disabled,
.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .container {
        width: 100%;
        padding: 0;
    }

    /* ── Header ── */
    .header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 14px;
        border-radius: 14px;
    }

    .main-content {
        margin-top: 0;
    }

    .logo {
        margin-bottom: 0;
    }

    .logo-img {
        height: 52px;
    }

    /* Stats: 2 por fila, centrados */
    .stats {
        flex-wrap: wrap !important;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin-right: 0;
    }

    .stats-separator {
        display: none;
    }

    .stat {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        max-width: calc(50% - 4px);
        padding: 7px 10px;
        justify-content: center;
        border-radius: 16px;
    }

    /* Perfil ocupa una fila completa */
    .stat-profile {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-icon svg,
    .duo-stat-svg,
    .duo-energy-svg {
        width: 26px !important;
        height: 26px !important;
    }

    .theme-toggle-animated {
        display: none;
        /* Mover a otro lugar si se necesita en mobile */
    }

    /* ── Main Content ── */
    .main-content {
        padding: 16px 14px;
        border-radius: 14px;
    }

    /* ── Login ── */
    .login-card-container {
        width: calc(100% - 24px);
        margin: 12px auto;
        padding: 24px 20px;
        border-radius: 20px;
    }

    .login-heading {
        font-size: 24px;
    }

    /* ── Roadmap ── */
    .lesson-list::before {
        left: 24px;
    }

    .roadmap-item.left,
    .roadmap-item.right {
        justify-content: flex-start;
        padding-left: 68px;
        padding-right: 0;
    }

    /* En mobile todos los items entran por la izquierda */
    .roadmap-item.left,
    .roadmap-item.right {
        transform: translateX(-40px);
    }

    .roadmap-item.is-visible {
        transform: translateX(0);
    }

    .lesson-node {
        left: 24px;
        transform: translateX(0) !important;
        width: 46px;
        height: 46px;
        font-size: 20px;
        border-width: 3px;
    }

    .lesson-node:not(.locked):hover {
        transform: translateX(0) translateY(3px) !important;
    }

    .lesson-connector {
        display: none;
    }

    .lesson-card {
        width: calc(100% - 68px);
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 18px 16px;
        border-radius: 16px;
    }

    .lesson-title {
        font-size: 15px;
    }

    .lesson-description {
        font-size: 13px;
    }

    .module-badge {
        font-size: 13px;
        padding: 12px 22px;
        border-radius: 50px;
    }

    /* ── Lesson View ── */
    .lesson-header-nav {
        flex-wrap: wrap;
        gap: 8px;
        padding-bottom: 12px;
        margin-bottom: 14px;
    }

    .lesson-title-nav {
        font-size: 16px;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .lesson-controls-group {
        gap: 8px;
        margin-top: 0;
    }

    .exit-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .lesson-energy-counter {
        padding: 5px 10px;
        gap: 6px;
    }

    .lesson-energy {
        width: 28px;
        height: 28px;
    }

    .progress-bar {
        margin-bottom: 20px;
        height: 10px;
    }

    .question-text {
        font-size: 17px !important;
        line-height: 1.55 !important;
        margin-bottom: 20px !important;
    }

    .question {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .option {
        padding: 14px 18px;
        font-size: 15px;
        border-radius: 12px;
    }

    .options {
        gap: 10px;
        margin-bottom: 20px;
    }

    #check-button {
        width: 100%;
        justify-content: center;
        font-size: 16px;
        padding: 14px;
    }

    /* Drag & drop en móvil */
    .matching-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* ── Completion Screen ── */
    .completion-screen {
        padding: 24px 16px;
    }

    .completion-icon {
        font-size: 60px;
        margin-bottom: 14px;
    }

    .completion-title {
        font-size: 24px;
    }

    .completion-points {
        font-size: 22px;
    }

    .completion-nodes {
        font-size: 17px;
    }

    .completion-screen .button {
        width: 100%;
        justify-content: center;
    }

    /* ── Profile ── */
    #profile-view {
        padding: 24px 16px;
    }

    #profile-view>div:first-of-type {
        font-size: 64px !important;
    }

    #profile-view>div:first-of-type button {
        width: 28px !important;
        height: 28px !important;
        bottom: 2px !important;
        right: -2px !important;
    }

    #profile-view>div:first-of-type button i {
        font-size: 12px !important;
    }

    #profile-name {
        font-size: 24px !important;
    }

    #profile-email {
        font-size: 14px !important;
        margin-bottom: 20px !important;
    }

    .profile-stats {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 24px;
    }

    .profile-stats .stat {
        max-width: none;
        width: 100%;
        padding: 16px;
        flex-direction: row;
        text-align: left;
        justify-content: flex-start !important;
    }

    .profile-stats .stat-icon {
        font-size: 32px;
        margin-bottom: 0;
        margin-right: 16px;
    }

    .profile-stats .stat-content {
        display: flex;
        flex-direction: column;
    }

    .profile-stats .stat-value {
        font-size: 24px;
    }

    .profile-actions {
        flex-direction: column;
        gap: 10px !important;
    }

    .profile-actions .button,
    .profile-settings-actions .button {
        width: 100%;
        justify-content: center;
    }

    /* ── SweetAlert2 en móvil ── */
    .swal2-popup {
        padding: 28px 20px 22px !important;
        border-radius: 20px !important;
        width: 90vw !important;
        max-width: none !important;
    }

    .swal2-title {
        font-size: 19px !important;
    }

    .swal2-html-container {
        font-size: 14px !important;
    }

    .swal2-styled {
        font-size: 14px !important;
        padding: 10px 22px !important;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
    }

    .logo-img {
        height: 44px;
    }

    .stat {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .lesson-card {
        padding: 14px 12px;
        border-radius: 14px;
    }

    .lesson-title {
        font-size: 14px;
    }

    .module-badge {
        font-size: 12px;
        padding: 10px 18px;
    }

    .question-text {
        font-size: 15px !important;
    }

    .option {
        padding: 12px 14px;
        font-size: 14px;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .button {
        width: 100%;
        justify-content: center;
    }

    .completion-title {
        font-size: 20px;
    }

    .completion-points {
        font-size: 19px;
    }

    .swal2-popup {
        padding: 22px 16px 18px !important;
        border-radius: 18px !important;
    }

    .swal2-title {
        font-size: 17px !important;
    }

    .swal2-actions {
        flex-direction: column;
        gap: 8px !important;
    }

    .swal2-styled {
        width: 100% !important;
    }
}

/* ========================================
   PLACEMENT TEST - DISEÑO MEJORADO
   ======================================== */

/* Overlay y Fondo con Gradiente */
.placement-overlay {
    background: linear-gradient(135deg, #0369a1 0%, #1e3a8a 50%, #312e81 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Decoración de Fondo - Partículas */
.placement-bg-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.placement-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: floatParticle 20s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}


/* Tarjeta Principal con Glassmorphism */
.placement-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 35px 35px;
    max-width: 550px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: visible;
    z-index: 1;
}


/* Contenedor del Icono Principal */
.placement-icon-container {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #049FD9 0%, #1E3A8A 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 35px rgba(4, 159, 217, 0.4);
    position: relative;
}

/* Anillo Pulsante del Icono */
.placement-icon-container::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: pulseRing 2s infinite;
}

/* Icono Principal */
.placement-icon {
    font-size: 45px;
    color: white;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    z-index: 1;
}

/* Título con Gradiente de Texto */
.placement-title {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #1e3a8a 0%, #049FD9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

/* Texto Descriptivo */
.placement-text {
    font-size: 15px;
    color: #64748b;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 20px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* Badge de Tiempo */
.placement-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f9ff;
    color: #0369a1;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #bae6fd;
    box-shadow: 0 2px 8px rgba(3, 105, 161, 0.15);
    white-space: nowrap;
}

.placement-badge i {
    font-size: 14px;
}

/* Lista de Beneficios */
.placement-benefits {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    text-align: left;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.benefit-item:hover {
    background: #e0f2fe;
    transform: translateX(5px);
    border-color: #bae6fd;
}

.benefit-item i {
    font-size: 18px;
    color: #049FD9;
    min-width: 24px;
}

.benefit-item span {
    font-size: 14px;
    color: #334155;
    font-weight: 500;
}

/* Botón Premium con Gradiente */
.btn-premium {
    background: linear-gradient(135deg, #049FD9 0%, #0369a1 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(4, 159, 217, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Efecto de Brillo en Hover */
.btn-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-premium:hover::before {
    left: 100%;
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(4, 159, 217, 0.5);
}

.btn-premium:active {
    transform: translateY(-1px);
}

.btn-premium i {
    font-size: 20px;
}

/* Botón Ghost (Secundario) */
.btn-ghost {
    background: transparent;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 12px;
    display: block;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.btn-ghost:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
    transform: translateY(-2px);
}

/* ========================================
   ANIMACIONES
   ======================================== */

/* Animación de Entrada de Tarjeta */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animación de Flotación del Icono */
@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Animación del Anillo Pulsante */
@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.1;
    }

    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Animación de Partículas Flotantes */
@keyframes floatParticle {
    0% {
        transform: translate(0, 0);
        opacity: 0.6;
    }

    25% {
        transform: translate(10px, -10px);
        opacity: 1;
    }

    50% {
        transform: translate(-5px, -20px);
        opacity: 0.8;
    }

    75% {
        transform: translate(-15px, -10px);
        opacity: 0.6;
    }

    100% {
        transform: translate(0, 0);
        opacity: 0.6;
    }
}

/* ========================================
   RESPONSIVE - PLACEMENT TEST
   ======================================== */

@media (max-width: 768px) {
    .placement-card {
        padding: 40px 30px;
        max-width: 90%;
        border-radius: 24px;
    }

    .placement-title {
        font-size: 32px;
    }

    .placement-text {
        font-size: 16px;
    }

    .placement-icon-container {
        width: 100px;
        height: 100px;
    }

    .placement-icon {
        font-size: 50px;
    }

    .benefit-item {
        padding: 10px 12px;
    }

    .benefit-item span {
        font-size: 14px;
    }

    .btn-premium {
        font-size: 16px;
        padding: 14px 28px;
    }

    .btn-ghost {
        font-size: 14px;
        padding: 12px 24px;
    }
}

/* ========================================
   PLACEMENT TEST - PANTALLA DE PREGUNTAS
   ======================================== */

/* Tarjeta de preguntas con ancho adecuado */
#placement-questions {
    max-width: 700px !important;
    width: 90% !important;
}

/* Texto de la pregunta */
#placement-questions .question-text {
    font-size: 20px !important;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 30px !important;
    line-height: 1.6;
    text-align: center;
}

/* Grid de opciones en placement test */
#placement-questions .options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

/* Botones de opciones en placement test */
#placement-questions .option-btn {
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 24px;
    text-align: left;
    font-size: 17px;
    color: #334155;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#placement-questions .option-btn:hover:not(:disabled) {
    border-color: #049FD9;
    background: #f0f9ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(4, 159, 217, 0.15);
}

#placement-questions .option-btn.selected {
    border-color: #049FD9;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(4, 159, 217, 0.2);
}

#placement-questions .option-btn.correct {
    border-color: #22c55e;
    background: #dcfce7;
    color: #15803d;
    font-weight: 600;
}

#placement-questions .option-btn.incorrect {
    border-color: #ef4444;
    background: #fee2e2;
    color: #b91c1c;
    opacity: 0.7;
}

/* Responsive para preguntas */
@media (max-width: 768px) {
    #placement-questions {
        max-width: 95% !important;
    }

    #placement-questions .question-text {
        font-size: 18px !important;
    }

    #placement-questions .option-btn {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* ========================================
   PLACEMENT TEST - PANTALLA DE CARGA
   ======================================== */

.loading-spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e0f2fe;
    border-top: 4px solid #049FD9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Retry Banner */
.retry-banner {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid #fecaca;
    animation: slideUpFade 0.4s ease forwards;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.05);
}

.retry-banner i {
    font-size: 18px;
}

/* Footer Badge */
.app-footer {
    margin: 40px auto 30px;
    text-align: center;
}

.app-footer p {
    display: inline-block;
    margin: 0;
    font-size: 12px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.3px;
}

.app-footer strong {
    font-family: 'Cinzel', Georgia, serif;
    color: #049FD9;
    font-weight: 600;
    letter-spacing: 0.08em;
    font-size: 11px;
}

/* ============================================
   NetLearn — SweetAlert2 Custom Theme
   Aplica a todas las notificaciones del sistema
   ============================================ */

/* Backdrop con blur */
.swal2-container {
    z-index: 9999 !important;
}

.swal2-container.swal2-backdrop-show,
.swal2-container.swal2-noanimation {
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

/* Popup card */
.swal2-popup {
    border-radius: 24px !important;
    font-family: 'Nunito', 'Inter', sans-serif !important;
    padding: 36px 32px 28px !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

/* Título */
.swal2-title {
    font-family: 'Nunito', sans-serif !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #1B3B5F !important;
    letter-spacing: -0.3px !important;
    line-height: 1.2 !important;
    padding: 0 0 6px !important;
}

/* Texto de cuerpo */
.swal2-html-container {
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important;
    color: #475569 !important;
    line-height: 1.65 !important;
    margin: 4px 0 0 !important;
}

/* Contenedor de botones */
.swal2-actions {
    gap: 10px !important;
    margin-top: 24px !important;
    flex-wrap: wrap !important;
}

/* Todos los botones */
.swal2-styled {
    border-radius: 100px !important;
    font-family: 'Nunito', sans-serif !important;
    font-weight: 800 !important;
    font-size: 15px !important;
    padding: 11px 28px !important;
    letter-spacing: 0.2px !important;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15), 0 6px 16px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    outline: none !important;
}

.swal2-styled:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15), 0 10px 22px rgba(0, 0, 0, 0.14) !important;
}

.swal2-styled:active {
    transform: translateY(1px) !important;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15), 0 3px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Input dentro del modal */
.swal2-input {
    border-radius: 14px !important;
    border: 2px solid #e2e8f0 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important;
    padding: 10px 16px !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.swal2-input:focus {
    border-color: #049FD9 !important;
    box-shadow: 0 0 0 3px rgba(4, 159, 217, 0.18) !important;
}

/* Icono del modal */
.swal2-icon {
    width: 68px !important;
    height: 68px !important;
    margin: 0 auto 18px !important;
    border-width: 3px !important;
}

/* Icono success — verde Duolingo */
.swal2-icon.swal2-success {
    border-color: #58CC02 !important;
    color: #58CC02 !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #58CC02 !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(88, 204, 2, 0.25) !important;
}

/* Icono error — rosa energía */
.swal2-icon.swal2-error {
    border-color: #FF4B82 !important;
    color: #FF4B82 !important;
}

.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: #FF4B82 !important;
}

/* Icono warning — ámbar */
.swal2-icon.swal2-warning {
    border-color: #F59E0B !important;
    color: #F59E0B !important;
}

/* Icono question / info — azul NetLearn */
.swal2-icon.swal2-question,
.swal2-icon.swal2-info {
    border-color: #049FD9 !important;
    color: #049FD9 !important;
}

/* --- Dark Mode --- */
.dark-mode .swal2-popup {
    background: #1e293b !important;
    border: 1px solid rgba(100, 116, 139, 0.2) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55) !important;
}

.dark-mode .swal2-title {
    color: #f1f5f9 !important;
}

.dark-mode .swal2-html-container {
    color: #94a3b8 !important;
}

.dark-mode .swal2-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

.dark-mode .swal2-input:focus {
    border-color: #049FD9 !important;
    box-shadow: 0 0 0 3px rgba(4, 159, 217, 0.2) !important;
}

/* ============================================================
   SISTEMA DE PLANES PREMIUM
   ============================================================ */

/* --- Botón Upgrade en el Header --- */
.btn-upgrade-header {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.btn-upgrade-header:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-upgrade-header .fa-crown {
    font-size: 13px;
}

/* --- Botón Tienda en el Header --- */
.btn-store-header {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.btn-store-header:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-store-header .fa-store {
    font-size: 15px;
}

/* ============================================================
   TIENDA DE NODOS
   ============================================================ */
.store-modal-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
    text-align: left;
    position: relative;
}

.store-header {
    text-align: center;
    margin-bottom: 10px;
}

.store-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--heading-color);
    margin-bottom: 5px;
}

.store-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.store-balance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--card-bg);
    border: 2px solid var(--input-border);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
}

.store-balance-icon {
    width: 40px;
    height: 40px;
}

.store-balance-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--heading-color);
}

.store-balance-amount {
    font-size: 24px;
    font-weight: 900;
    color: #00D4E8;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.store-item {
    background: var(--card-bg);
    border: 2px solid var(--input-border);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.store-item:hover {
    transform: translateY(-5px);
    border-color: #8b5cf6;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.15);
}

.store-item.popular {
    border-color: #f59e0b;
}

.store-item.popular::before {
    content: 'MÁS POPULAR';
    position: absolute;
    top: 12px;
    right: -30px;
    background: #f59e0b;
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 30px;
    transform: rotate(45deg);
    letter-spacing: 1px;
}

.store-item-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
}

.store-item-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--heading-color);
    margin-bottom: 5px;
}

.store-item-amount {
    font-size: 24px;
    font-weight: 900;
    color: #00D4E8;
    margin-bottom: 15px;
}

.store-item-btn {
    width: 100%;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.store-item-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    transform: scale(1.02);
}

.store-item.popular .store-item-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.store-item.popular .store-item-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

/* Store Popup Specific Styles */
.store-popup {
    border-radius: 24px !important;
    padding: 0 !important;
    overflow: visible !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.store-popup.swal2-show {
    animation: swal2-show 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* --- Tarjeta de lección premium (bloqueada) --- */
.lesson-card.premium-locked {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 2px solid rgba(245, 158, 11, 0.35);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.lesson-card.premium-locked::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(245, 158, 11, 0.1) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: shimmer-gold 3s infinite;
}

@keyframes shimmer-gold {
    0% {
        left: -100%;
    }

    30% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.lesson-card.premium-locked:hover {
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.lesson-card.premium-locked .lesson-title {
    color: var(--heading-color);
    opacity: 0.85;
}

/* Badge PRO dentro de la tarjeta */
.pro-badge-card {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* Texto "Desbloquea con Pro" en la tarjeta */
.premium-overlay-text {
    font-size: 11px;
    color: #d97706;
    font-weight: 700;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dark-mode .premium-overlay-text {
    color: #fbbf24;
}

/* Badge "Desbloqueada por tu nivel" en lecciones placement-unlocked (BUG FIX) */
.placement-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #0369a1;
    background: rgba(3, 105, 161, 0.1);
    border: 1px solid rgba(3, 105, 161, 0.25);
    border-radius: 20px;
    padding: 3px 10px;
    letter-spacing: 0.3px;
}

.dark-mode .placement-badge {
    color: #7dd3fc;
    background: rgba(125, 211, 252, 0.1);
    border-color: rgba(125, 211, 252, 0.2);
}

/* ── Dark Mode: modales manage-pro (colores hardcodeados) ── */
.dark-mode .manage-pro-popup .swal2-html-container span,
.dark-mode .manage-pro-popup .swal2-html-container p {
    color: #94a3b8 !important;
}

.dark-mode .manage-pro-popup .swal2-html-container b,
.dark-mode .manage-pro-popup .swal2-html-container strong {
    color: #f1f5f9 !important;
}

.dark-mode .manage-pro-popup .swal2-html-container div[style*="background:#f1f5f9"],
.dark-mode .manage-pro-popup .swal2-html-container div[style*="background: #f1f5f9"],
.dark-mode .manage-pro-popup .swal2-html-container div[style*="background:#f8fafc"],
.dark-mode .manage-pro-popup .swal2-html-container div[style*="background: #f8fafc"] {
    background: #1e293b !important;
    border-color: #334155 !important;
}



/* Nodo premium en el roadmap */
.lesson-node.premium-node {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border-color: #d97706 !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4) !important;
}

/* ============================================================
   MODAL PREMIUM (NUEVO DISEÑO)
   ============================================================ */

.premium-popup {
    border-radius: 24px !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
}

.premium-popup.swal2-show {
    animation: swal2-show 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Botón X incrustado dentro del contenedor visual del modal */
.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    color: #0f172a;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.premium-close-btn {
    color: #64748b !important;
    background: #ffffff !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    top: 12px !important;
    right: 12px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    z-index: 100 !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
}

.premium-close-btn:hover {
    color: #0f172a !important;
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

.premium-modal-container {
    display: flex;
    flex-direction: row;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    min-height: 550px;
    font-family: 'Nunito', sans-serif;
    text-align: left;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Lado Izquierdo: Beneficios */
.premium-features-section {
    flex: 1.2;
    background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 100%);
    color: white;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.premium-features-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(4, 159, 217, 0.15) 0%, transparent 60%);
    animation: rotateBg 25s linear infinite;
    pointer-events: none;
}

.premium-header-left {
    position: relative;
    z-index: 1;
    margin-bottom: 48px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.premium-crown-icon {
    font-size: 48px;
    color: #FFD700;
    margin-bottom: -10px;
    /* Acercar la corona al texto */
    margin-left: 15px;
    /* Alinear un poco con el texto */
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    animation: floatCrown 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
    /* Asegurar que esté por encima */
}

.premium-header-left h2 {
    font-size: 40px;
    font-weight: 900;
    margin: 0 0 16px;
    letter-spacing: -0.5px;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

.text-gradient {
    background: linear-gradient(to right, #FFD700, #F59E0B);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
}

.premium-header-left p {
    font-size: 17px;
    color: #e2e8f0;
    /* Color más claro para mejor legibilidad */
    line-height: 1.6;
    margin: 0;
    font-weight: 500;
    max-width: 90%;
}

.premium-benefits {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Reducido el gap porque ahora los items tienen padding */
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: transform 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.benefit-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.benefit-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.15);
    /* Fondo blanco semitransparente */
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ffffff;
    /* Icono blanco puro */
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Borde blanco sutil */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    /* Sombra oscura para dar profundidad */
}

.benefit-text h4 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.benefit-text p {
    margin: 0;
    font-size: 14px;
    color: #e2e8f0;
    line-height: 1.5;
}

/* Lado Derecho: Precios */
.premium-pricing-section {
    flex: 1;
    background: #f8fafc;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pricing-header {
    text-align: center;
    margin-bottom: 36px;
}

.pricing-header h3 {
    font-size: 26px;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 10px;
    letter-spacing: -0.3px;
}

.pricing-header p {
    font-size: 15px;
    color: #64748b;
    margin: 0;
    font-weight: 600;
}

.pricing-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 36px;
}

.pricing-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.pricing-card input[type="radio"] {
    display: none;
}

.pricing-card-content {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 22px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.03);
}

.pricing-card:hover .pricing-card-content {
    border-color: #cbd5e1;
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08);
}

.pricing-card input[type="radio"]:checked+.pricing-card-content {
    border-color: #049FD9;
    background: #f0f9ff;
    box-shadow: 0 10px 25px rgba(4, 159, 217, 0.15);
    transform: scale(1.03);
}

.discount-badge {
    position: absolute;
    top: -14px;
    right: 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 12px;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: 14px;
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
    letter-spacing: 0.5px;
    border: 2px solid white;
    z-index: 2;
}

.pricing-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.plan-name {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    transition: color 0.3s ease;
}

.plan-price-box {
    text-align: right;
}

.plan-price {
    font-size: 28px;
    font-weight: 900;
    color: #0f172a;
    transition: color 0.3s ease;
}

.plan-period {
    font-size: 15px;
    color: #64748b;
    font-weight: 600;
}

.plan-total {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 600;
}

.pricing-card input[type="radio"]:checked+.pricing-card-content .plan-name,
.pricing-card input[type="radio"]:checked+.pricing-card-content .plan-price {
    color: #0284c7;
}

.pricing-footer {
    text-align: center;
}

.btn-premium-cta {
    width: 100%;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 50%, #f59e0b 100%);
    background-size: 200% auto;
    color: white;
    border: none;
    border-radius: 18px;
    padding: 20px;
    font-size: 20px;
    font-weight: 900;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow, background-position;
}

.btn-premium-cta::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(30deg) translateX(-100%);
    animation: shimmerBtn 3s infinite;
}

.btn-premium-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(245, 158, 11, 0.5);
    background-position: right center;
}

.premium-guarantee {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}

/* Dark mode modal */
.dark-mode .premium-modal-container {
    background: #0f172a;
}

.dark-mode .premium-pricing-section {
    background: #0f172a;
}

.dark-mode .pricing-card-content {
    background: #1e293b;
    border-color: #334155;
}

.dark-mode .plan-name,
.dark-mode .plan-price {
    color: #f8fafc;
}

.dark-mode .pricing-header h3 {
    color: #f8fafc;
}

.dark-mode .pricing-card input[type="radio"]:checked+.pricing-card-content {
    background: rgba(4, 159, 217, 0.1);
    border-color: #049FD9;
}

.dark-mode .pricing-card input[type="radio"]:checked+.pricing-card-content .plan-name,
.dark-mode .pricing-card input[type="radio"]:checked+.pricing-card-content .plan-price {
    color: #38bdf8;
}

/* Mobile premium modal */
@media (max-width: 768px) {
    .premium-modal-container {
        flex-direction: column;
    }

    .premium-features-section {
        padding: 30px 20px;
    }

    .premium-pricing-section {
        padding: 30px 20px;
    }

    .premium-popup {
        width: 95vw !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
}

/* ============================================================
   CHECKOUT MODAL (PAGO)
   ============================================================ */

.checkout-popup {
    border-radius: 24px !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
}

.checkout-close-btn {
    color: #64748b !important;
    background: #ffffff !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    top: 12px !important;
    right: 12px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    z-index: 100 !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 24px !important;
}

.checkout-close-btn:hover {
    color: #0f172a !important;
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

.checkout-modal {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    text-align: left;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.checkout-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
    position: relative;
}

.checkout-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.checkout-header h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.checkout-header p {
    margin: 0;
    font-size: 15px;
    color: #cbd5e1;
    font-weight: 500;
}

.checkout-summary {
    padding: 24px 40px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-label {
    font-size: 15px;
    color: #64748b;
    font-weight: 600;
}

.summary-value {
    font-size: 16px;
    color: #1e293b;
    font-weight: 700;
}

.total-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #cbd5e1;
}

.total-row .summary-label {
    font-size: 18px;
    color: #0f172a;
    font-weight: 800;
}

.summary-value.highlight {
    font-size: 24px;
    color: #049FD9;
    font-weight: 900;
}

.summary-value.highlight small {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.checkout-methods {
    padding: 30px 40px 20px;
}

.methods-title {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 16px;
}

.payment-method {
    display: block;
    margin-bottom: 12px;
    cursor: pointer;
}

.payment-method input[type="radio"] {
    display: none;
}

.method-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    transition: all 0.2s ease;
    background: white;
}

.payment-method:hover .method-content {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.payment-method input[type="radio"]:checked+.method-content {
    border-color: #049FD9;
    background: #f0f9ff;
    box-shadow: 0 4px 12px rgba(4, 159, 217, 0.1);
}

.method-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.method-icon {
    font-size: 24px;
    color: #64748b;
    width: 30px;
    text-align: center;
}

.payment-method input[type="radio"]:checked+.method-content .method-icon {
    color: #049FD9;
}

.method-info span {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
}

.payment-method input[type="radio"]:checked+.method-content .method-info span {
    color: #0f172a;
}

.method-brands {
    display: flex;
    gap: 8px;
    color: #94a3b8;
    font-size: 20px;
}

.promo-container {
    padding: 0 40px 20px;
    animation: slideUpFade 0.3s ease;
}

.promo-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
    color: #1e293b;
    font-weight: 600;
}

.promo-input:focus {
    border-color: #f59e0b;
    background: white;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.checkout-footer {
    padding: 20px 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-checkout-pay {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px;
    font-size: 18px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-checkout-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.4);
}

.btn-checkout-cancel {
    width: 100%;
    background: transparent;
    color: #64748b;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-checkout-cancel:hover {
    background: #f1f5f9;
    color: #334155;
}

/* Dark mode checkout */
.dark-mode .checkout-modal {
    background: #0f172a;
}

.dark-mode .checkout-summary {
    background: #1e293b;
    border-color: #334155;
}

.dark-mode .summary-label {
    color: #94a3b8;
}

.dark-mode .summary-value {
    color: #f8fafc;
}

.dark-mode .total-row {
    border-color: #334155;
}

.dark-mode .total-row .summary-label {
    color: #f8fafc;
}

.dark-mode .methods-title {
    color: #f8fafc;
}

.dark-mode .method-content {
    background: #1e293b;
    border-color: #334155;
}

.dark-mode .method-info span {
    color: #e2e8f0;
}

.dark-mode .payment-method:hover .method-content {
    background: #334155;
    border-color: #475569;
}

.dark-mode .payment-method input[type="radio"]:checked+.method-content {
    background: rgba(4, 159, 217, 0.1);
    border-color: #049FD9;
}

.dark-mode .payment-method input[type="radio"]:checked+.method-content .method-info span {
    color: #38bdf8;
}

.dark-mode .promo-input {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

.dark-mode .promo-input:focus {
    border-color: #f59e0b;
    background: #0f172a;
}

.dark-mode .btn-checkout-cancel:hover {
    background: #1e293b;
    color: #f8fafc;
}

@media (max-width: 768px) {
    .checkout-popup {
        width: 95vw !important;
    }

    .checkout-header {
        padding: 24px 20px;
    }

    .checkout-summary {
        padding: 20px;
    }

    .checkout-methods {
        padding: 24px 20px 16px;
    }

    .promo-container {
        padding: 0 20px 16px;
    }

    .checkout-footer {
        padding: 16px 20px 24px;
    }

    .method-brands {
        display: none;
        /* Ocultar iconos de tarjetas en móvil para ahorrar espacio */
    }
}

/* ============================================================
   NOTIFICACIÓN DE ÉXITO PREMIUM
   ============================================================ */

.premium-success-popup {
    border-radius: 24px !important;
    padding: 40px 30px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    border: 2px solid #f59e0b !important;
    background: #ffffff !important;
}

.btn-premium-success {
    width: 100% !important;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 18px !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    font-family: 'Nunito', sans-serif !important;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4) !important;
    transition: all 0.3s ease !important;
    margin-top: 20px !important;
}

.btn-premium-success:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 30px rgba(245, 158, 11, 0.5) !important;
}

.dark-mode .premium-success-popup {
    background: #0f172a !important;
    border-color: #d97706 !important;
}

.dark-mode .premium-success-popup h2 {
    color: #f8fafc !important;
}

.dark-mode .premium-success-popup p {
    color: #94a3b8 !important;
}

.dark-mode .premium-success-popup div[style*="background: #f8fafc"] {
    background: #1e293b !important;
    border-color: #334155 !important;
}

.dark-mode .premium-success-popup span[style*="color: #0f172a"] {
    color: #e2e8f0 !important;
}

/* ============================================================
   GESTIÓN DE SUSCRIPCIÓN (CANCELAR)
   ============================================================ */

.manage-pro-popup {
    border-radius: 24px !important;
    padding: 40px 30px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    background: var(--card-bg) !important;
}

.btn-cancel-sub {
    color: #ef4444 !important;
    border: 2px solid #ef4444 !important;
    background: transparent !important;
    border-radius: 16px !important;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
}

.btn-cancel-sub:hover {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.dark-mode .btn-cancel-sub:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

/* ============================================================
   PLAN BADGES — Profile view (usa clases en lugar de inline styles)
   ============================================================ */

.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
}

.plan-badge-pro {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

.plan-badge-free {
    background: var(--surface-bg);
    color: var(--text-secondary);
    border: 1px solid var(--surface-border);
}

.plan-upgrade-link {
    color: #f59e0b;
    font-weight: 800;
    text-decoration: none;
}

.plan-upgrade-link:hover {
    text-decoration: underline;
}

/* ============================================================
   SWEETALERT2 — MODO OSCURO GLOBAL (swal-themed)
   Todos los Swal.fire sin background hardcodeado usan esto.
   ============================================================ */

.dark-mode .swal2-popup.swal-themed,
.dark-mode .swal2-popup {
    background: #1e293b !important;
    border: 1px solid rgba(100, 116, 139, 0.25) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6) !important;
    border-radius: 20px !important;
}

.dark-mode .swal2-title {
    color: #f1f5f9 !important;
}

.dark-mode .swal2-html-container {
    color: #94a3b8 !important;
}

.dark-mode .swal2-html-container label {
    color: #cbd5e1 !important;
}

/* ============================================================
   DARK MODE — Overrides para colores hardcodeados en modales JS
   Usa selectores [style*="..."] para capturar inline styles
   ============================================================ */

/* Fondos claros genéricos (#f8fafc, #f1f5f9, white) → oscuro */
.dark-mode .swal2-html-container div[style*="background:#f8fafc"],
.dark-mode .swal2-html-container div[style*="background: #f8fafc"],
.dark-mode .swal2-html-container div[style*="background:#f1f5f9"],
.dark-mode .swal2-html-container div[style*="background: #f1f5f9"],
.dark-mode .swal2-html-container div[style*="background:white"],
.dark-mode .swal2-html-container div[style*="background: white"] {
    background: #0f172a !important;
    border-color: #334155 !important;
}

/* Textos oscuros hardcodeados (#1e293b, #1f2937) → claros */
.dark-mode .swal2-html-container h2[style*="color:#1e293b"],
.dark-mode .swal2-html-container h2[style*="color: #1e293b"],
.dark-mode .swal2-html-container h2[style*="color:#1f2937"],
.dark-mode .swal2-html-container p[style*="color:#1e293b"],
.dark-mode .swal2-html-container span[style*="color:#0f172a"],
.dark-mode .swal2-html-container span[style*="color: #0f172a"] {
    color: #f1f5f9 !important;
}

/* Textos secundarios hardcodeados (#64748b, #475569) → claros */
.dark-mode .swal2-html-container p[style*="color:#64748b"],
.dark-mode .swal2-html-container p[style*="color: #64748b"],
.dark-mode .swal2-html-container div[style*="color:#64748b"],
.dark-mode .swal2-html-container span[style*="color:#64748b"] {
    color: #94a3b8 !important;
}

/* Badge "ACTIVA" verde — mantener en dark mode */
.dark-mode .swal2-html-container span[style*="background:#dcfce7"] {
    background: rgba(22, 163, 74, 0.2) !important;
    color: #4ade80 !important;
}

/* Refill energy card en game.js */
.dark-mode .swal2-html-container div[style*="background:#f1f5f9"][style*="border-radius:12px"] {
    background: #0f172a !important;
    color: #94a3b8 !important;
}

.dark-mode .swal2-html-container div[style*="background:#f1f5f9"] div[style*="color:#64748b"] {
    color: #94a3b8 !important;
}

/* ============================================================
   ANIMACIONES DARK MODE — smooth transition
   ============================================================ */

*,
*::before,
*::after {
    transition-property: background-color, border-color, color, box-shadow;
    transition-duration: 0.25s;
    transition-timing-function: ease;
}

/* Excluir elementos que no deben transicionar (evita flash en inputs) */
input,
textarea,
select,
.spinner,
[class*="fa-"],
.lesson-energy,
.duo-bg,
.duo-cap,
.duo-bolt,
.swal2-popup,
.swal2-backdrop-show {
    transition: none !important;
}

/* ============================================================
   LEADERBOARD (Salón de la Fama)
   ============================================================ */

.swal-leaderboard {
    border-radius: 24px !important;
    padding: 0 !important;
    overflow: hidden !important;
    max-width: 480px !important;
}

.lb-swal-html-container {
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
}

.leaderboard-container {
    text-align: left;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow-x: hidden;
    width: 100%;
}

.lb-header {
    background: linear-gradient(135deg, rgba(4, 159, 217, 0.1), rgba(30, 58, 138, 0.1));
    padding: 30px 20px 20px;
    text-align: center;
    border-bottom: 1px solid var(--surface-border);
}

.dark-mode .lb-header {
    background: linear-gradient(135deg, rgba(4, 159, 217, 0.05), rgba(30, 58, 138, 0.15));
}

.lb-icon-wrap {
    margin: 0 auto 12px;
}

.lb-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.lb-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.lb-list {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lb-list::-webkit-scrollbar,
.achievements-list::-webkit-scrollbar {
    width: 6px;
}

.lb-list::-webkit-scrollbar-track,
.achievements-list::-webkit-scrollbar-track {
    background: transparent;
}

.lb-list::-webkit-scrollbar-thumb,
.achievements-list::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: 10px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.leaderboard-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-shadow);
}

.row-top1 {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), var(--surface-bg));
    border-color: rgba(245, 158, 11, 0.4);
}

.row-top2 {
    /* Plata más brillante y azulado para que no parezca deshabilitado */
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.2), var(--surface-bg));
    border-color: rgba(148, 163, 184, 0.5);
}

.row-top3 {
    /* Bronce más cálido y vibrante */
    background: linear-gradient(90deg, rgba(217, 119, 6, 0.12), var(--surface-bg));
    border-color: rgba(217, 119, 6, 0.4);
}

.row-current-user {
    border: 2px solid var(--primary-color);
    background: rgba(4, 159, 217, 0.05);
}

/* ── Tu posición (fuera del top 20) ──────────────────────── */
.lb-your-rank {
    margin-top: 12px;
}

.lb-your-rank-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.lb-your-rank-divider::before,
.lb-your-rank-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color, rgba(150, 150, 170, 0.25));
}

.lb-rank {
    width: 40px;
    text-align: center;
    font-weight: 800;
    color: var(--text-secondary);
    font-size: 16px;
}

.rank-medal {
    font-size: 22px;
    line-height: 1;
}

.lb-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.lb-avatar {
    font-size: 32px;
    color: var(--text-muted);
    opacity: 0.6;
}

.lb-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lb-pro-badge i {
    color: #f59e0b;
    font-size: 12px;
}

.lb-points {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 15px;
    white-space: nowrap;
    padding-left: 12px;
}

/* ============================================================
   DARK MODE — CORRECCIONES DE INCONSISTENCIAS
   Componentes que usaban colores hardcoded en lugar de variables
   ============================================================ */

/* ── Lección bloqueada ───────────────────────────────────────────────────── */
.dark-mode .lesson-card.locked {
    background: var(--surface-bg);
}

/* ── Login input ─────────────────────────────────────────────────────────── */
.dark-mode .login-form-new .login-input {
    background: var(--input-bg);
    color: var(--input-text);
    border-inline: 2px solid var(--input-border);
    box-shadow: none;
}

/* ── Tarjetas de teoría y ejercicio ─────────────────────────────────────── */
.dark-mode .theory-card {
    background: var(--card-bg);
    border-color: var(--surface-border);
}

.dark-mode .theory-card h3 {
    color: var(--heading-color);
    border-bottom-color: var(--surface-border);
}

.dark-mode .theory-text {
    color: var(--text-secondary);
}

.dark-mode .question-container {
    background: var(--card-bg);
}

.dark-mode .question-text {
    color: var(--heading-color);
}

.dark-mode .option-btn {
    background: var(--card-bg);
    border-color: var(--surface-border);
    color: var(--text-secondary);
}

.dark-mode .option-btn:hover:not(:disabled) {
    background: var(--surface-bg);
    border-color: var(--input-border);
}

.dark-mode #placement-questions .option-btn {
    background: var(--card-bg);
    border-color: var(--surface-border);
    color: var(--text-color);
}

/* ── Botones de navegación en ejercicios ─────────────────────────────────── */
.dark-mode .nav-button {
    background: var(--surface-bg);
    color: var(--text-color);
    border-color: var(--surface-border);
}

.dark-mode .nav-button:hover {
    background: var(--input-bg);
}

.dark-mode .nav-btn.secondary {
    background: var(--surface-bg);
    color: var(--text-muted);
}

.dark-mode .nav-btn.secondary:hover:not(:disabled) {
    background: var(--input-bg);
    color: var(--text-color);
}

/* ── Modal de upgrade — benefit items y btn-ghost ───────────────────────── */
.dark-mode .benefit-item {
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .benefit-item:hover {
    background: rgba(4, 159, 217, 0.1);
}

.dark-mode .btn-ghost:hover {
    background: var(--surface-bg);
    border-color: var(--input-border);
    color: var(--text-color);
}

/* ── Botones de cerrar modales ───────────────────────────────────────────── */
.dark-mode .modal-close-btn,
.dark-mode .premium-close-btn,
.dark-mode .checkout-close-btn {
    background: var(--surface-bg) !important;
    color: var(--text-muted) !important;
}

.dark-mode .modal-close-btn:hover,
.dark-mode .premium-close-btn:hover,
.dark-mode .checkout-close-btn:hover {
    color: var(--text-color) !important;
}

/* ============================================================
   ACHIEVEMENTS — SISTEMA DE LOGROS REDISEÑADO
   ============================================================ */

/* ── Modal header ────────────────────────────────────────────────────────── */
.achievements-modal-container {
    position: relative;
    padding: 0;
}

.achievements-modal-header {
    text-align: center;
    padding: 28px 28px 0;
}

.achievements-modal-title {
    font-size: clamp(20px, 4vw, 24px);
    font-weight: 900;
    color: var(--heading-color);
    margin: 0 0 6px;
    text-align: center;
}

.achievements-modal-title span {
    color: #f59e0b;
}

.achievements-modal-header p {
    color: var(--text-muted);
    font-size: 13.5px;
    margin: 0;
}

/* ── Progress summary bar ────────────────────────────────────────────────── */
.achievements-progress-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 16px 24px;
    padding: 14px 20px;
    background: var(--surface-bg);
    border-radius: 16px;
    border: 1px solid var(--surface-border);
}

.ach-prog-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ach-prog-value {
    font-size: 22px;
    font-weight: 900;
    color: var(--heading-color);
    font-family: 'Nunito', sans-serif;
    line-height: 1;
}

.ach-prog-value--alert {
    color: #00C8FF;
}

.ach-prog-label {
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}

.ach-prog-divider {
    width: 1px;
    height: 36px;
    background: var(--surface-border);
    opacity: 0.7;
    flex-shrink: 0;
}

/* ── Scrollable list ─────────────────────────────────────────────────────── */
.achievements-list {
    max-height: 58vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

@media (max-height: 600px) {
    .achievements-list {
        max-height: 42vh;
    }
}

/* ── Base card ───────────────────────────────────────────────────────────── */
.ach-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1.5px solid var(--surface-border);
    background: var(--surface-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* ── Locked state ────────────────────────────────────────────────────────── */
.ach-card--locked {
    opacity: 0.6;
}

.ach-card--locked .ach-icon-wrap {
    filter: grayscale(1);
}

.ach-card--locked:hover {
    transform: translateY(-1px);
}

/* ── Claimable state — glowing border + shimmer ──────────────────────────── */
.ach-card--claimable {
    border-color: rgba(0, 200, 255, 0.45);
    background: linear-gradient(135deg, var(--surface-bg) 0%, rgba(0, 200, 255, 0.04) 100%);
    box-shadow: 0 0 0 1px rgba(0, 200, 255, 0.15), 0 4px 20px rgba(0, 200, 255, 0.1);
}

.ach-card--claimable::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(0, 200, 255, 0.07),
        transparent
    );
    transform: skewX(-18deg);
    animation: ach-shine 3.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ach-shine {
    0%   { left: -120%; }
    40%  { left: 160%;  }
    100% { left: 160%;  }
}

.ach-card--claimable:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(0, 200, 255, 0.3), 0 8px 24px rgba(0, 200, 255, 0.18);
}

.ach-card--claimable:hover .ach-icon-wrap {
    transform: scale(1.08) rotate(-4deg);
}

/* ── Claimed state ───────────────────────────────────────────────────────── */
.ach-card--claimed {
    border-color: rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, var(--surface-bg) 0%, rgba(16, 185, 129, 0.03) 100%);
    opacity: 0.72;
}

/* ── Icon wrapper ────────────────────────────────────────────────────────── */
.ach-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--card-bg);
    border: 1.5px solid var(--surface-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ach-card--claimable .ach-icon-wrap {
    background: rgba(0, 200, 255, 0.07);
    border-color: rgba(0, 200, 255, 0.28);
    box-shadow: 0 4px 12px rgba(0, 200, 255, 0.14);
}

.ach-card--claimed .ach-icon-wrap {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(16, 185, 129, 0.22);
}

/* ── Body text ───────────────────────────────────────────────────────────── */
.ach-body {
    flex: 1;
    min-width: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ach-title {
    font-weight: 800;
    font-size: 15px;
    color: var(--heading-color);
    margin-bottom: 1px;
    word-break: break-word;
    line-height: 1.3;
}

.ach-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

.ach-reward-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(0, 200, 255, 0.1);
    border: 1px solid rgba(0, 200, 255, 0.22);
    font-size: 11px;
    font-weight: 700;
    color: #00C8FF;
    letter-spacing: 0.3px;
    align-self: flex-start;
}

.ach-card--locked .ach-reward-pill {
    background: var(--surface-bg);
    border-color: var(--surface-border);
    color: var(--text-muted);
}

.ach-card--claimed .ach-reward-pill {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

/* ── Modal popup sizing ─────────────────────────────────────────────────── */
.achievements-popup {
    width: clamp(320px, 92vw, 580px) !important;
    max-width: 580px !important;
    padding: 0 !important;
    border-radius: 24px !important;
    overflow: hidden !important;
}

/* Resetear el padding que SweetAlert2 aplica al html-container */
.achievements-popup .swal2-html-container {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}

/* ── Action column ───────────────────────────────────────────────────────── */
.ach-action {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    min-width: 90px;
    max-width: 120px;
    padding-top: 2px;
}

/* ── Status pills ────────────────────────────────────────────────────────── */
.ach-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.ach-status--claimed {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #10b981;
}

.ach-status--locked {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
}

/* ── Claim button ────────────────────────────────────────────────────────── */
.ach-btn-claim {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #00C8FF 0%, #0284c7 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 200, 255, 0.38);
    font-family: 'Nunito', sans-serif;
    white-space: nowrap;
    animation: ach-pulse-btn 2.5s ease-in-out infinite;
}

@keyframes ach-pulse-btn {
    0%, 100% { box-shadow: 0 4px 14px rgba(0, 200, 255, 0.38); }
    50%       { box-shadow: 0 6px 22px rgba(0, 200, 255, 0.6);  }
}

.ach-btn-claim:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 200, 255, 0.55);
    animation: none;
}

.ach-btn-claim:active {
    transform: scale(0.95);
}

/* ── Claim reward popup ──────────────────────────────────────────────────── */
.ach-claim-popup {
    border-radius: 28px !important;
    padding: 0 !important;
    max-width: 360px !important;
    overflow: visible !important;
}

.ach-claim-popup-body {
    text-align: center;
    padding: 32px 24px 8px;
}

.ach-claim-icon-wrap {
    width: 88px;
    height: 88px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.12) 0%, rgba(2, 132, 199, 0.12) 100%);
    border: 2px solid rgba(0, 200, 255, 0.32);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: ach-icon-pop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes ach-icon-pop {
    from { transform: scale(0) rotate(-20deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

.ach-claim-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--heading-color);
    margin-bottom: 4px;
}

.ach-claim-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ach-claim-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 18px;
}

.ach-claim-reward-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.12) 0%, rgba(2, 132, 199, 0.12) 100%);
    border: 1.5px solid rgba(0, 200, 255, 0.32);
    border-radius: 24px;
    font-size: 22px;
    font-weight: 900;
    color: #00C8FF;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 6px;
}

.ach-btn-confirm {
    background: linear-gradient(135deg, #00C8FF 0%, #0284c7 100%) !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 12px 28px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    font-family: 'Nunito', sans-serif !important;
    box-shadow: 0 6px 18px rgba(0, 200, 255, 0.4) !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
}

.ach-btn-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 26px rgba(0, 200, 255, 0.55) !important;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .achievements-modal-header {
        padding: 20px 16px 0;
    }

    .achievements-progress-summary {
        margin: 12px;
        gap: 12px;
        padding: 10px 12px;
    }

    .ach-prog-value {
        font-size: 17px;
    }

    .achievements-list {
        padding: 6px 10px 16px;
        gap: 7px;
    }

    .ach-card {
        gap: 10px;
        padding: 11px 12px;
    }

    .ach-icon-wrap {
        width: 40px;
        height: 40px;
        font-size: 20px;
        border-radius: 10px;
        margin-top: 1px;
    }

    .ach-title {
        font-size: 13.5px;
    }

    .ach-desc {
        font-size: 12px;
    }

    .ach-action {
        min-width: 82px;
        max-width: 100px;
    }

    .ach-btn-claim {
        padding: 7px 10px;
        font-size: 12px;
        gap: 4px;
    }

    .ach-status {
        padding: 5px 9px;
        font-size: 11px;
    }

    .ach-claim-popup {
        max-width: 94vw !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS — SISTEMA COMPLETO
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 360px: Teléfonos muy pequeños ─────────────────────────────────────── */
@media (max-width: 360px) {
    body {
        padding: 6px;
    }

    .header {
        padding: 8px 10px;
        gap: 8px;
        border-radius: 12px;
    }

    .logo-img {
        height: 36px;
    }

    .main-content {
        padding: 12px;
        border-radius: 12px;
    }

    .lesson-card {
        padding: 12px 10px;
    }

    .login-card-container {
        width: calc(100% - 16px);
        padding: 20px 16px;
        border-radius: 24px;
        margin: 8px auto;
    }
}

/* ── 1024px: Tablets landscape / laptops pequeños ──────────────────────── */
@media (max-width: 1024px) {
    .logo-img {
        height: 72px;
    }

    .stats {
        gap: 6px;
    }

    .stat {
        flex-shrink: 1;
        padding: 5px 10px;
    }

    .stat-value {
        font-size: 16px;
    }

    .duo-stat-svg,
    .duo-energy-svg {
        width: 26px !important;
        height: 26px !important;
    }
}

/* ── 1280px+: Escritorios estándar ──────────────────────────────────────── */
@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }
}

/* ── 1440px+: Pantallas grandes y ultra-anchas ──────────────────────────── */
@media (min-width: 1440px) {
    .container {
        max-width: 1300px;
    }
}
}