:root {
    /* Default to dark; overridden by data-theme when set */
    color-scheme: dark;
}

:root[data-theme='light'] {
    color-scheme: light;
}

        * {
            box-sizing: border-box;
        }

        html, body {
            overflow-x: hidden;
        }

        /*
         * Evita el "font boosting" en algunos navegadores móviles (especialmente Android/Chrome)
         * que hace que se rompan layouts en pantallas pequeñas.
         */
        html {
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }

        body {
            margin: 0;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
                         "Segoe UI", sans-serif;
            background: radial-gradient(circle at top left, #020617, #020617 45%, #020617);
            color: #e5e7eb;
            overflow-x: hidden;
        }

        a {
            color: inherit;
        }

        nav {
            position: sticky;
            top: 0;
            z-index: 40;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(16px);
            border-bottom: 1px solid rgba(148, 163, 184, 0.2);
        }

        .nav-left {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .logo {
            font-weight: 700;
            letter-spacing: 0.04em;
            font-size: 18px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .logo::before {
            content: "";
            width: 10px;
            height: 10px;
            border-radius: 999px;
            background: radial-gradient(circle, #22c55e, #16a34a);
            box-shadow: 0 0 8px rgba(34, 197, 94, 0.85);
            display: inline-block;
        }

        
        .nav-right {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .lang-switch {
            display: flex;
            align-items: center;
        }

        .lang-switch form {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .lang-btn {
            background: #111827;
            border: 1px solid #1f2937;
            color: #e5e7eb;
            font-size: 13px;
            padding: 4px 12px;
            border-radius: 9999px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            line-height: 1.2;
        }

        .lang-btn.active {
            background: #22c55e;
            border-color: #22c55e;
            color: #020617;
        }

        .lang-btn span.flag {
            font-size: 14px;
        }

        .lang-btn span.code {
            font-weight: 500;
        }

        @media (max-width: 768px) {
            .nav-right {
                gap: 8px;
                flex-wrap: wrap;
            }
        }

        .menu {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .menu a {
            text-decoration: none;
            font-size: 14px;
            color: #e5e7eb;
            padding: 4px 0;
        }

        .menu a:hover {
            color: #ffffff;
        }

        /* Logout por POST (seguridad): estilizar botones como links */
        .menu form.logout-form {
            display: inline;
            margin: 0;
        }

        .menu form.logout-form button {
            background: none;
            border: none;
            padding: 4px 0;
            font: inherit;
            font-size: 14px;
            color: #e5e7eb;
            cursor: pointer;
        }

        .menu form.logout-form button:hover {
            color: #ffffff;
        }

        /* User menu (desktop) */

        .user-menu {
            position: relative;
            display: inline-flex;
            align-items: center;
            cursor: pointer;
        }

        .user-name {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
        }

        .user-initial {
            width: 26px;
            height: 26px;
            border-radius: 999px;
            background: #3b82f6;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 600;
        }

        .user-dropdown {
            position: absolute;
            top: calc(100% + 6px);
            right: 0;
            min-width: 160px;
            border-radius: 10px;
            background: #020617;
            border: 1px solid #1f2937;
            box-shadow: 0 16px 35px rgba(0, 0, 0, 0.7);
            padding: 4px;
            display: none;
            z-index: 50;
        }

        .user-menu.open .user-dropdown {
            display: block;
        }

        .user-dropdown a {
            display: block;
            padding: 7px 10px;
            font-size: 14px;
            color: #e5e7eb;
            text-decoration: none;
            border-radius: 6px;
        }

        .user-dropdown a.logout {
            color: #fecaca;
        }

        .user-dropdown a:hover {
            background: #0b1120;
        }

        .user-dropdown form.logout-form {
            margin: 0;
        }

        .user-dropdown form.logout-form button {
            display: block;
            width: 100%;
            text-align: left;
            padding: 7px 10px;
            font-size: 14px;
            color: #e5e7eb;
            text-decoration: none;
            border-radius: 6px;
            background: none;
            border: none;
            cursor: pointer;
        }

        .user-dropdown form.logout-form button.logout {
            color: #fecaca;
        }

        .user-dropdown form.logout-form button:hover {
            background: #0b1120;
        }
        /* Nav toggle (mobile) */

        .nav-toggle {
            display: none;
            border: none;
            background: none;
            color: #e5e7eb;
            cursor: pointer;
            padding: 4px;
        }

        .nav-toggle-lines {
            display: inline-flex;
            flex-direction: column;
            gap: 3px;
        }

        .nav-toggle-lines span {
            width: 18px;
            height: 2px;
            border-radius: 999px;
            background: #e5e7eb;
        }

        .nav-toggle-initial {
            width: 26px;
            height: 26px;
            border-radius: 999px;
            background: #3b82f6;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 600;
        }

        /* Menú móvil */

        .mobile-menu {
            display: none;
        }

        .mobile-menu.open {
            display: block;
        }

        .mobile-menu {
            position: fixed;
            top: 56px; /* altura aproximada del nav */
            left: 0;
            right: 0;
            background: #020617;
            border-bottom: 1px solid rgba(31, 41, 55, 0.9);
            box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
        }

        .mobile-menu-inner {
            max-width: 960px;
            margin: 0 auto;
            padding: 10px 16px 12px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .mobile-menu a {
            display: block;
            padding: 8px 10px;
            border-radius: 8px;
            text-decoration: none;
            font-size: 14px;
        }

        .mobile-menu a:hover {
            background: #0b1120;
        }

        .mobile-menu form.logout-form {
            margin: 0;
        }

        .mobile-menu form.logout-form button {
            display: block;
            width: 100%;
            padding: 8px 10px;
            border-radius: 8px;
            background: none;
            border: none;
            font: inherit;
            font-size: 14px;
            color: #e5e7eb;
            text-align: left;
            cursor: pointer;
        }

        .mobile-menu form.logout-form button:hover {
            background: #0b1120;
        }

        .mobile-user-section {
            
        }

        .mobile-user-toggle {
            width: 100%;
            display: inline-flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 10px;
            border-radius: 10px;
            border: 1px solid rgba(75, 85, 99, 0.7);
            background: #020617;
            color: #e5e7eb;
            cursor: pointer;
            font-size: 14px;
        }

        .mobile-user-name {
            margin-left: 8px;
            margin-right: auto;
        }

        .mobile-user-arrow {
            font-size: 10px;
            margin-left: 6px;
        }

        .mobile-user-dropdown {
            margin-top: 6px;
            border-radius: 10px;
            border: 1px solid rgba(75, 85, 99, 0.7);
            background: #020617;
            padding: 4px;
            display: none;
        }

        .mobile-user-dropdown a {
            padding: 6px 8px;
            border-radius: 8px;
            display: block;
            font-size: 14px;
        }

        .mobile-user-dropdown a:hover {
            background: #0b1120;
        }

        .mobile-user-dropdown.open {
            display: block;
        }

        /* CONTENEDOR PRINCIPAL */

        .container {
            max-width: 960px;
            margin: 32px auto 40px;
            padding: 0 16px 40px;
        }

        /* Mensajes */

        .messages {
            margin-bottom: 16px;
        }

        .message {
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 14px;
            margin-bottom: 6px;
        }

        .message.success {
            background: rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.6);
            color: #a7f3d0;
        }

        .message.error {
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.6);
            color: #fecaca;
        }

        .message.info {
            background: rgba(59, 130, 246, 0.15);
            border: 1px solid rgba(59, 130, 246, 0.6);
            color: #bfdbfe;
        }

        /* Botón genérico */

        .btn {
            display: inline-block;
            margin-top: 12px;
            padding: 8px 14px;
            border-radius: 999px;
            background: #4f46e5;
            border: none;
            color: #f9fafb;
            cursor: pointer;
            text-decoration: none;
            font-size: 14px;
        }

        .btn:hover {
            background: #6366f1;
        }

        .btn-secondary {
            background: #6b7280;
        }

        .btn-secondary:hover {
            background: #4b5563;
        }

        .btn-danger {
            background: #ef4444;
        }

        .btn-danger:hover {
            background: #f87171;
        }

        .btn-link {
            background: none;
            border: none;
            color: #93c5fd;
            text-decoration: underline;
            cursor: pointer;
            padding: 0;
            font-size: 14px;
        }

        .btn-link:hover {
            color: #bfdbfe;
        }

        .btn-link.small {
            font-size: 12px;
        }

        .btn-link.danger {
            color: #fca5a5;
        }

        .btn-link.danger:hover {
            color: #fecaca;
        }

        /* Tarjeta genérica (dashboard/otras páginas) */

        .dashboard-card {
            background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.25), transparent 55%),
                        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.20), transparent 55%),
                        #020617;
            border-radius: 20px;
            padding: 24px 22px 22px;
            border: 1px solid rgba(148, 163, 184, 0.25);
            box-shadow:
                0 18px 45px rgba(15, 23, 42, 0.9),
                0 0 0 1px rgba(15, 23, 42, 0.8);
        }

        .dashboard-card h1 {
            margin-top: 0;
        }

        .dashboard-description {
            margin-top: 4px;
            color: #9ca3af;
            font-size: 14px;
        }

        .dashboard-grid {
            margin-top: 18px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 14px;
        }

        .dashboard-item {
            border-radius: 14px;
            padding: 12px 12px 10px;
            background: #020617;
            border: 1px solid rgba(31, 41, 55, 0.9);
        }

        .dashboard-item h2 {
            margin: 0 0 4px 0;
            font-size: 16px;
        }

        .dashboard-item p {
            margin: 0;
            font-size: 13px;
            color: #9ca3af;
        }

        .dashboard-item .btn {
            margin-top: 10px;
        }

        /* AUTH FORMS */

        .auth-wrapper {
            max-width: 960px;
            margin: 40px auto 40px;
            padding: 0 16px;
            display: flex;
            justify-content: center;
        }

        .auth-card {
            width: 100%;
            max-width: 480px;
            background: #020617;
            border-radius: 20px;
            padding: 24px 22px 26px;
            border: 1px solid rgba(148, 163, 184, 0.25);
            box-shadow:
                0 18px 45px rgba(15, 23, 42, 0.9),
                0 0 0 1px rgba(15, 23, 42, 0.8);
        }

        .auth-card h1 {
            margin-top: 4px;
            margin-bottom: 14px;
            font-size: 24px;
        }

        .auth-card p {
            margin-top: 0;
            color: #9ca3af;
        }

        /* GRID DE CURSOS */

        .course-grid {
            margin-top: 20px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 20px;
        }

        .course-card {
            border-radius: 16px;
            padding: 16px 14px 14px;
            background: #020617;
            border: 1px solid rgba(31, 41, 55, 0.9);
        }

        .course-card h2 {
            margin-top: 0;
            margin-bottom: 6px;
            font-size: 18px;
        }

        .course-card p {
            margin: 0;
            font-size: 14px;
            color: #9ca3af;
        }

        .course-card .course-meta {
            margin-top: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 14px;
        }

        .course-card .price {
            font-weight: 600;
        }

        .course-card .status-pill {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }

        .status-pill {
            display: inline-block;
            padding: 2px 10px;
            border-radius: 999px;
        }

        .status-active {
            background: rgba(16, 185, 129, 0.15);
            color: #6ee7b7;
        }

        .status-inactive {
            background: rgba(239, 68, 68, 0.1);
            color: #fecaca;
        }

        /* TABLAS DE ADMIN */

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }

        th, td {
            padding: 8px 10px;
            text-align: left;
        }

        thead tr {
            border-bottom: 1px solid #111827;
        }

        tbody tr + tr {
            border-top: 1px solid #111827;
        }

        .actions-cell {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .inline-form {
            display: inline-block;
            margin: 0;
        }

        /* Responsive */

        @media (max-width: 768px) {
            .menu.desktop-menu {
                display: none;
            }

            .nav-toggle {
                display: inline-flex;
            }

            .container {
                margin-top: 24px;
            }
        }

        @media (min-width: 769px) {
            .mobile-menu {
                display: none !important;
            }
        }

        /*
         * Ajustes extra para móviles pequeños.
         * No afecta a escritorio/tablet.
         */
        @media (max-width: 420px) {
            nav {
                padding: 10px 12px;
            }

            .nav-right {
                gap: 10px;
                flex-wrap: nowrap;
            }

            .logo {
                font-size: 17px;
                min-width: 0;
                white-space: nowrap;
            }

            .lang-switch form {
                gap: 6px;
            }

            .lang-btn {
                font-size: 12px;
                padding: 4px 10px;
            }

            .nav-toggle-initial {
                width: 24px;
                height: 24px;
                font-size: 12px;
            }

            .container {
                margin-top: 20px;
                padding: 0 12px 32px;
            }

            .dashboard-card,
            .auth-card,
            .course-card {
                max-width: 100%;
                padding: 20px 16px 18px;
                border-radius: 16px;
            }

            .dashboard-card h1 {
                font-size: 22px;
                line-height: 1.15;
                word-break: break-word;
            }

            .course-grid {
                grid-template-columns: 1fr;
                gap: 14px;
            }

            /* Tablas: permitir scroll horizontal en móvil */
            table {
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            .actions-cell {
                flex-wrap: wrap;
            }
        }

        @media (max-width: 360px) {
            .logo {
                font-size: 16px;
            }

            .lang-btn {
                padding: 4px 8px;
            }
        }

        /*
         * Ajustes SOLO para móviles pequeños.
         * (Desktop y tablet se mantienen igual.)
         */
        @media (max-width: 420px) {
            nav {
                padding: 10px 12px;
            }

            .nav-right {
                gap: 10px;
            }

            .logo {
                font-size: 17px;
                min-width: 0;
            }

            .lang-switch form {
                gap: 6px;
            }

            .lang-btn {
                font-size: 12px;
                padding: 4px 10px;
            }

            .container {
                margin-top: 20px;
                padding: 0 12px 32px;
            }

            .dashboard-card,
            .auth-card {
                padding: 20px 16px 18px;
                border-radius: 16px;
                max-width: 100%;
            }

            .dashboard-card h1 {
                font-size: 22px;
                line-height: 1.15;
                word-break: break-word;
            }

            /* Grids a 1 columna en pantallas pequeñas */
            .dashboard-grid {
                grid-template-columns: 1fr;
            }

            .course-grid {
                grid-template-columns: 1fr;
                gap: 14px;
            }

            /* Tablas: scroll horizontal en móvil */
            table {
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            th, td {
                white-space: nowrap;
            }

            .actions-cell {
                flex-wrap: wrap;
            }
        }

        @media (max-width: 360px) {
            .logo {
                font-size: 16px;
            }

            .lang-btn {
                padding: 4px 8px;
            }

            .user-initial,
            .nav-toggle-initial {
                width: 24px;
                height: 24px;
                font-size: 12px;
            }

            .dashboard-card h1 {
                font-size: 20px;
            }
        }



/* ===========================
   Modern course cards – Option 1 (glassmorphism, final)
   =========================== */
.course-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    justify-items: center;
    justify-content: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}


/* Glass card */.course-card {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 18px 18px 20px;

    border-radius: 22px;
    background-image:
        linear-gradient(135deg, rgba(148,163,184,0.4), rgba(59,130,246,0.5)),
        linear-gradient(135deg, rgba(15,23,42,0.96), rgba(15,23,42,0.92));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border: 1px solid transparent;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

/* Shimmer / highlight */
.course-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(248,250,252,0.04) 40%,
        rgba(248,250,252,0.16) 50%,
        rgba(248,250,252,0.04) 60%,
        transparent 100%
    );
    transform: translateX(-60%);
    opacity: 0;
    pointer-events: none;
}

.course-card:hover::before {
    opacity: 1;
    transform: translateX(60%);
    transition: transform 0.9s ease-out, opacity 0.25s ease-out;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 1);
}

/* Typography */
.course-card h2,
.course-card h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 18px;
}

.course-card p {
    margin: 0;
    font-size: 14px;
    color: #e5e7eb;
}

/* Logo container: fixed size to prevent huge logos */
.course-card-logo {
    margin: 10px 0 12px 0;
    width: 128px;
    height: 128px;
    border-radius: 999px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 20%, rgba(248,250,252,0.16), transparent 55%),
        radial-gradient(circle at 70% 80%, rgba(129,140,248,0.25), transparent 55%),
        #020617;
    box-shadow:
        0 0 0 1px rgba(148,163,184,0.45),
        0 14px 32px rgba(15,23,42,0.9);
}

.course-card-logo::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: conic-gradient(
        from 180deg,
        #6366f1,
        #ec4899,
        #22c55e,
        #6366f1
    );
    opacity: 0.45;
    filter: blur(4px);
    z-index: -1;
    animation: course-logo-orbit 18s linear infinite;
}

.course-card-logo img {
    max-width: 75%;
    max-height: 75%;
    width: auto;
    height: auto;
    display: block;
    border-radius: 16px;
    object-fit: contain;
}

/* Placeholder icon when a course has no logo */
.course-card-logo .course-logo-placeholder {
    font-size: 72px;
    line-height: 1;
    color: rgba(235, 238, 255, 0.92);
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.85));
}

:root[data-theme="light"] .course-card-logo .course-logo-placeholder {
    color: var(--six-text);
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.18));
}

@keyframes course-logo-orbit {
    to {
        transform: rotate(360deg);
    }
}

/* Owned courses: slightly larger presence and glow */
.course-card.owned {
    max-width: 340px;
    box-shadow:
        0 26px 70px rgba(15, 23, 42, 1),
        0 0 0 1px rgba(129, 140, 248, 0.55);
}

.course-card.owned::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -32px;
    height: 60px;
    background: radial-gradient(ellipse at center, rgba(96, 165, 250, 0.45), transparent 65%);
    opacity: 0.9;
    z-index: -2;
}

/* Actions */
.course-card-actions {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.course-card-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 190px;
    padding: 8px 18px;
    font-size: 14px;
    border-radius: 9999px;
}

/* Mobile */
@media (max-width: 640px) {
    .course-grid {
        gap: 16px;
    }

    .course-card {
        max-width: 230px;
        padding: 16px 14px 18px;
        box-shadow: 0 14px 32px rgba(15,23,42,0.9);
    }

    .course-card h2,
    .course-card h3 {
        font-size: 16px;
    }

    .course-card-logo {
        width: 104px;
        height: 104px;
    }

    .course-card-logo .course-logo-placeholder {
        font-size: 56px;
    }

    .course-card-actions .btn {
        font-size: 13px;
        padding: 7px 16px;
        max-width: 170px;
    }
}


/* Logo tilt hover for course logo (subtle 3D wobble) */
.course-card-logo {
    perspective: 1100px;
}

.course-card-logo img {
    transform-origin: center center;
    backface-visibility: hidden;
    transform: rotateX(10deg) rotateY(-12deg) scale(0.98);
    transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Suave balanceo 3D al pasar el ratón */
.course-card:hover .course-card-logo img,
.course-card-logo:hover img {
    transform: rotateX(-6deg) rotateY(8deg) scale(1.03);
}


/* Ensure CTA buttons align at the bottom of each course card */
.course-grid .course-card {
    display: flex;
    flex-direction: column;
}

.course-grid .course-card > div:last-child {
    margin-top: auto;
    width: 100%;
    display: flex;
    justify-content: center;
}

.course-grid .course-card > div:last-child .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 190px;
}

/* On small screens, show two cards per row instead of three */
@media (max-width: 640px) {
    .course-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}


/* Ensure mobile nav & profile menu appear above page content */
@media (max-width: 960px) {
    .mobile-menu {
        z-index: 60;
    }
    .mobile-user-dropdown {
        position: relative;
        z-index: 70;
    }
}


/* Remove underline from brand logo link */
.logo,
.logo:link,
.logo:visited,
.logo:hover,
.logo:active {
    text-decoration: none;
    color: inherit;
}


/* ===========================
   Light theme overrides & theme toggle (v2)
   Goal: true light mode (no dark surfaces), high contrast, consistent cards.
   =========================== */

:root[data-theme="light"] {
    --six-bg: #f3f4f6;
    --six-surface: #ffffff;
    --six-surface-2: #f8fafc;
    --six-border: #d1d5db;
    --six-border-soft: #e5e7eb;
    --six-text: #0f172a;
    --six-text-muted: #475569;
    --six-text-soft: #64748b;
    --six-primary: #4f46e5;
    --six-primary-hover: #6366f1;
    --six-focus: rgba(79, 70, 229, 0.25);
    --six-shadow: 0 16px 40px rgba(15, 23, 42, 0.10);
    --six-shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.08);
}

/* Global base */
:root[data-theme="light"] body {
    background: var(--six-bg);
    color: var(--six-text);
}

:root[data-theme="light"] h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3,
:root[data-theme="light"] h4,
:root[data-theme="light"] h5,
:root[data-theme="light"] h6 {
    color: var(--six-text);
}

:root[data-theme="light"] p {
    color: var(--six-text-muted);
}

:root[data-theme="light"] .muted,
:root[data-theme="light"] .course-subtitle,
:root[data-theme="light"] .dashboard-description,
:root[data-theme="light"] .auth-card p,
:root[data-theme="light"] .thread-meta,
:root[data-theme="light"] .exam-muted,
:root[data-theme="light"] .exam-k,
:root[data-theme="light"] .cert-subtitle {
    color: var(--six-text-soft) !important;
}

/* Nav */
:root[data-theme="light"] nav {
    background: rgba(255, 255, 255, 0.96);
    border-bottom-color: var(--six-border-soft);
}

:root[data-theme="light"] .menu a,
:root[data-theme="light"] .menu form.logout-form button {
    color: var(--six-text);
}

:root[data-theme="light"] .menu a:hover,
:root[data-theme="light"] .menu form.logout-form button:hover {
    color: #000000;
}

/* Language pills (fix: no dark pills in light mode) */
:root[data-theme="light"] .lang-btn {
    background: var(--six-surface-2);
    border-color: var(--six-border);
    color: var(--six-text);
}

:root[data-theme="light"] .lang-btn.active {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.55);
    color: #065f46;
}

/* User bubble */
:root[data-theme="light"] .user-initial,
:root[data-theme="light"] .nav-toggle-initial {
    background: var(--six-primary);
    color: #ffffff;
}

:root[data-theme="light"] .user-dropdown {
    background: var(--six-surface);
    border-color: var(--six-border);
    box-shadow: var(--six-shadow);
}

:root[data-theme="light"] .user-dropdown a {
    color: var(--six-text);
}

:root[data-theme="light"] .user-dropdown a:hover,
:root[data-theme="light"] .user-dropdown form.logout-form button:hover {
    background: var(--six-surface-2);
}

:root[data-theme="light"] .mobile-menu,
:root[data-theme="light"] .mobile-user-dropdown {
    background: var(--six-surface);
    border-color: var(--six-border);
    box-shadow: var(--six-shadow);
}

:root[data-theme="light"] .mobile-menu a,
:root[data-theme="light"] .mobile-user-dropdown a,
:root[data-theme="light"] .mobile-menu form.logout-form button {
    color: var(--six-text);
}

:root[data-theme="light"] .mobile-menu a:hover,
:root[data-theme="light"] .mobile-user-dropdown a:hover,
:root[data-theme="light"] .mobile-menu form.logout-form button:hover {
    background: var(--six-surface-2);
}

:root[data-theme="light"] .mobile-user-toggle {
    background: var(--six-surface);
    border-color: var(--six-border);
    color: var(--six-text);
}

/* Buttons & links */
:root[data-theme="light"] .btn {
    background: var(--six-primary);
    color: #ffffff;
}

:root[data-theme="light"] .btn:hover {
    background: var(--six-primary-hover);
}

:root[data-theme="light"] .btn-secondary {
    background: #e5e7eb;
    color: var(--six-text);
}

:root[data-theme="light"] .btn-secondary:hover {
    background: #d1d5db;
}

:root[data-theme="light"] .btn-link,
:root[data-theme="light"] .btn-link.small {
    color: #1d4ed8;
}

:root[data-theme="light"] .btn-link:hover {
    color: #1e40af;
}

:root[data-theme="light"] .btn-link.danger,
:root[data-theme="light"] .btn-link.small.danger {
    color: #b91c1c;
}

:root[data-theme="light"] .btn-link.danger:hover,
:root[data-theme="light"] .btn-link.small.danger:hover {
    color: #7f1d1d;
}

/* Generic surfaces (cards) */
:root[data-theme="light"] .dashboard-card,
:root[data-theme="light"] .auth-card,
:root[data-theme="light"] .users-card,
:root[data-theme="light"] .profile-card,
:root[data-theme="light"] .reset-card,
:root[data-theme="light"] .totp-card,
:root[data-theme="light"] .dashboard-item,
:root[data-theme="light"] .course-card,
:root[data-theme="light"] .course-summary-card,
:root[data-theme="light"] .course-description-card,
:root[data-theme="light"] .tab-content,
:root[data-theme="light"] .forum-new-thread,
:root[data-theme="light"] .forum-thread-list,
:root[data-theme="light"] .exam-card,
:root[data-theme="light"] .payment-card,
:root[data-theme="light"] .table-card,
:root[data-theme="light"] .info-card,
:root[data-theme="light"] .history-card,
:root[data-theme="light"] .chart-card {
    background: var(--six-surface) !important;
    border-color: var(--six-border) !important;
    box-shadow: var(--six-shadow-soft) !important;
    color: var(--six-text);
}

:root[data-theme="light"] .course-card {
    background-image: none !important;
}

:root[data-theme="light"] .course-card h2,
:root[data-theme="light"] .course-card h3 {
    color: var(--six-text);
}

:root[data-theme="light"] .course-card p {
    color: var(--six-text-muted);
}

:root[data-theme="light"] .course-card-logo {
    background: var(--six-surface-2);
    box-shadow: 0 0 0 1px var(--six-border), 0 10px 22px rgba(15,23,42,0.10);
}

:root[data-theme="light"] .course-card-logo::before {
    opacity: 0.25;
}

/* Course detail (Sobre este curso) */
:root[data-theme="light"] .course-summary-subtitle {
    color: var(--six-text-soft) !important;
}

:root[data-theme="light"] .course-description-title {
    color: var(--six-text-soft) !important;
}

:root[data-theme="light"] .course-long-description {
    color: var(--six-text-muted) !important;
    border-top-color: var(--six-border-soft) !important;
}

:root[data-theme="light"] .course-long-description pre {
    background: var(--six-surface-2);
    border: 1px solid var(--six-border);
}

:root[data-theme="light"] .course-long-description code {
    color: #0f172a;
}

/* Fix secondary button in course summary */
:root[data-theme="light"] .secondary-btn {
    background: #e5e7eb !important;
    color: var(--six-text) !important;
    border: 1px solid var(--six-border) !important;
}

:root[data-theme="light"] .secondary-btn:hover {
    background: #d1d5db !important;
}

/* Tabs (course classroom) */
:root[data-theme="light"] .course-tabs {
    border-bottom-color: var(--six-border-soft) !important;
}

:root[data-theme="light"] .tab {
    color: var(--six-text) !important;
    background: var(--six-surface) !important;
    border: 1px solid var(--six-border) !important;
}

:root[data-theme="light"] .tab:hover:not(.tab-disabled):not(.tab-active) {
    background: var(--six-surface-2) !important;
}

:root[data-theme="light"] .tab-active {
    background: var(--six-primary) !important;
    border-color: var(--six-primary) !important;
    color: #ffffff !important;
}

/* Course layout sidebar */
:root[data-theme="light"] .course-layout-nav {
    background: var(--six-surface) !important;
    border-color: var(--six-border) !important;
}

/* PDF viewer */
:root[data-theme="light"] .pdf-viewer {
    background: var(--six-surface) !important;
    border-color: var(--six-border) !important;
}

:root[data-theme="light"] .pdf-toolbar {
    background: var(--six-surface-2) !important;
    border-bottom-color: var(--six-border-soft) !important;
}

:root[data-theme="light"] .pdf-page-input {
    background: var(--six-surface) !important;
    border-color: var(--six-border) !important;
    color: var(--six-text) !important;
}

:root[data-theme="light"] .pdf-btn {
    background: var(--six-surface) !important;
    border-color: var(--six-border) !important;
    color: var(--six-text) !important;
}

:root[data-theme="light"] .pdf-btn:hover {
    background: var(--six-surface-2) !important;
}

:root[data-theme="light"] .pdf-sep {
    background: var(--six-border-soft) !important;
}

:root[data-theme="light"] .pdf-stage {
    background: var(--six-surface-2);
}

:root[data-theme="light"] .pdf-viewer .pdf-page {
    background: var(--six-surface) !important;
    border-color: var(--six-border) !important;
}

/* Videos tab */
:root[data-theme="light"] .course-videos-page .videos-sidebar,
:root[data-theme="light"] .course-videos-page .videos-player-box {
    background: var(--six-surface) !important;
    border-color: var(--six-border) !important;
}

:root[data-theme="light"] .course-videos-page .video-card {
    background: var(--six-surface) !important;
    border-color: var(--six-border) !important;
}

:root[data-theme="light"] .course-videos-page .video-card:hover {
    background: var(--six-surface-2) !important;
    border-color: rgba(79, 70, 229, 0.55) !important;
}

:root[data-theme="light"] .course-videos-page .video-card.is-active {
    background: rgba(79, 70, 229, 0.08) !important;
    border-color: rgba(79, 70, 229, 0.85) !important;
}

:root[data-theme="light"] .course-videos-page .video-card-title,
:root[data-theme="light"] .course-videos-page .videos-player-title {
    color: var(--six-text) !important;
}

:root[data-theme="light"] .course-videos-page .empty-state {
    color: var(--six-text-soft) !important;
}

/* Forum */
:root[data-theme="light"] .thread-title {
    color: var(--six-text) !important;
}

:root[data-theme="light"] .thread-excerpt {
    color: var(--six-text-muted) !important;
}

:root[data-theme="light"] .thread-item + .thread-item {
    border-top-color: var(--six-border-soft) !important;
}

:root[data-theme="light"] .field label {
    color: var(--six-text) !important;
}

:root[data-theme="light"] .field input,
:root[data-theme="light"] .field textarea,
:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="email"],
:root[data-theme="light"] input[type="password"],
:root[data-theme="light"] input[type="number"],
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
    background: var(--six-surface) !important;
    border-color: var(--six-border) !important;
    color: var(--six-text) !important;
}

:root[data-theme="light"] input::placeholder,
:root[data-theme="light"] textarea::placeholder {
    color: #94a3b8 !important;
}

:root[data-theme="light"] input:focus,
:root[data-theme="light"] textarea:focus,
:root[data-theme="light"] select:focus {
    outline: none;
    border-color: var(--six-primary) !important;
    box-shadow: 0 0 0 3px var(--six-focus) !important;
}

/* Exam cards */
:root[data-theme="light"] .exam-kv-item {
    background: var(--six-surface-2) !important;
    border-color: var(--six-border) !important;
}

:root[data-theme="light"] .exam-pill {
    background: rgba(148, 163, 184, 0.15) !important;
    border-color: rgba(148, 163, 184, 0.45) !important;
    color: var(--six-text) !important;
}

:root[data-theme="light"] .cert-title {
    color: var(--six-text) !important;
}

/* Tables */
:root[data-theme="light"] thead tr,
:root[data-theme="light"] tbody tr + tr {
    border-color: var(--six-border-soft);
}

/* Status pills & messages */
:root[data-theme="light"] .message.success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.40);
    color: #065f46;
}

:root[data-theme="light"] .message.error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.40);
    color: #7f1d1d;
}

:root[data-theme="light"] .message.info {
    background: rgba(59, 130, 246, 0.10);
    border-color: rgba(59, 130, 246, 0.35);
    color: #1d4ed8;
}

/* Theme toggle buttons */
.theme-toggle-btn {
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.theme-toggle-btn .theme-icon {
    display: none;
}

/* Icon depending on theme */
:root[data-theme="dark"] .theme-toggle-btn .theme-icon-moon {
    display: inline;
}

:root[data-theme="light"] .theme-toggle-btn .theme-icon-sun {
    display: inline;
}

/* Desktop vs mobile placement */
.theme-toggle-desktop {
    margin-left: 4px;
}

.theme-toggle-mobile {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    font-size: 14px;
}

.mobile-theme-label {
    font-size: 14px;
}

.mobile-theme {
    padding: 6px 10px 10px;
}

/* Show desktop toggle on larger screens only */
@media (max-width: 768px) {
    .theme-toggle-desktop {
        display: none;
    }
}

/* Show mobile toggle only on small screens */
@media (min-width: 769px) {
    .theme-toggle-mobile {
        display: none;
    }
}

