:root {
    --primary-color: #1e4620;
    --primary-light: #2d5a30;
    --primary-dark: #143216;
    --secondary-color: #2e8b57;
    --secondary-hover: #246e44;
    --accent-orange: #d97706;
    --accent-orange-hover: #b45309;
    --bg-light: #f4f6f4;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --success: #15803d;
    --warning: #b45309;
    --danger: #b91c1c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ============================================================ */
/* RESET & MOBILE-FIRST BASE RULES                              */
/* ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6, p, span, a, label, li, td, th {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* ============================================================ */
/* HEADER & NAVIGATION (MOBILE-FIRST)                           */
/* ============================================================ */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.75rem 1rem;
    border-bottom: 4px solid var(--secondary-color);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

@media (min-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.85rem 1.5rem;
    }
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--white);
}

.logo-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    display: block;
    transition: transform 0.2s ease;
}

.logo-container:hover .logo-img {
    transform: scale(1.05);
}

.logo-badge {
    background: var(--secondary-color);
    color: var(--white);
    font-weight: 800;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.88rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.auth-logo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    box-shadow: var(--shadow-md);
    margin: 0 auto 0.85rem;
    display: block;
    border: 2px solid #e2e8f0;
}

.cert-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    margin: 0 auto 0.6rem;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-text h1 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-text span {
    font-size: 0.7rem;
    color: #a7f3d0;
    display: block;
}

nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    width: 100%;
}

@media (min-width: 768px) {
    nav {
        width: auto;
        gap: 0.6rem;
    }
}

nav a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

nav a:hover, nav a.active {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.15);
}

nav a.nav-btn-highlight {
    background-color: var(--secondary-color);
    color: var(--white);
    font-weight: 600;
}

/* ============================================================ */
/* MAIN CONTAINER & HERO                                        */
/* ============================================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0.75rem;
    flex: 1;
}

@media (min-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }
}

.hero {
    text-align: center;
    padding: 1.75rem 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #dcfce7;
}

.hero h2 {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    line-height: 1.25;
}

@media (min-width: 768px) {
    .hero h2 { font-size: 1.85rem; }
}

.hero p {
    color: #4b5563;
    font-size: 0.92rem;
    max-width: 750px;
    margin: 0 auto 1rem;
    font-style: italic;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.stat-item {
    text-align: center;
    min-width: 90px;
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================ */
/* FILTERS & SEARCH                                             */
/* ============================================================ */
.filter-bar {
    background: var(--white);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    width: 100%;
}

.filter-input {
    padding: 0.55rem 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.88rem;
    width: 100%;
    flex: 1;
}

/* ============================================================ */
/* COURSE GRID & CARDS                                          */
/* ============================================================ */
.grid-cursos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
}

@media (min-width: 640px) {
    .grid-cursos { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid-cursos { grid-template-columns: repeat(3, 1fr); }
}

.card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    height: 160px;
    background: #e2e8f0;
    overflow: hidden;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(30, 70, 32, 0.92);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.4rem;
    line-height: 1.35;
    font-weight: 700;
}

.card-content p {
    font-size: 0.84rem;
    color: #4b5563;
    margin-bottom: 1rem;
    flex-grow: 1;
    line-height: 1.4;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.65rem;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
    gap: 0.5rem;
}

.card-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-color);
    white-space: nowrap;
}

.card-price span {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* ============================================================ */
/* BUTTONS & CONTROLS                                           */
/* ============================================================ */
.btn {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--white);
    text-align: center;
    padding: 0.55rem 0.95rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    max-width: 100%;
}

.btn:hover {
    background-color: var(--secondary-hover);
    color: var(--white);
}

.btn-primary { background-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-dark); }
.btn-orange { background-color: var(--accent-orange); }
.btn-orange:hover { background-color: var(--accent-orange-hover); }
.btn-secondary { background-color: #4b5563; }
.btn-secondary:hover { background-color: #374151; }
.btn-outline {
    background-color: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}
.btn-outline:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}
.btn-block {
    display: block;
    width: 100%;
}

/* Alerts & Badges */
.alert {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.86rem;
    line-height: 1.45;
    width: 100%;
}
.alert-success { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background-color: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-danger { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background-color: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

.badge {
    display: inline-block;
    padding: 0.18rem 0.48rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}
.badge-activo { background-color: #dcfce7; color: #15803d; }
.badge-pendiente { background-color: #fef3c7; color: #b45309; }
.badge-terminado { background-color: #dbeafe; color: #1d4ed8; }

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    height: 10px;
    overflow: hidden;
    margin: 0.4rem 0;
}
.progress-bar {
    height: 100%;
    background-color: var(--secondary-color);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

/* ============================================================ */
/* AULA VIRTUAL (STRICT MOBILE-FIRST LAYOUT)                    */
/* ============================================================ */
.aula-header-bar {
    background: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
}

@media (min-width: 768px) {
    .aula-header-bar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1.25rem 1.5rem;
    }
}

.aula-progress-info {
    width: 100%;
}

@media (min-width: 768px) {
    .aula-progress-info {
        max-width: 320px;
    }
}

/* ============================================================ */
/* BODY: ESPACIO PARA LA BARRA INFERIOR EN MÓVIL               */
/* ============================================================ */
@media (max-width: 959px) {
    body {
        /* Reservar espacio inferior para la barra de navegación fija */
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
}

/* ============================================================ */
/* BARRA DE NAVEGACIÓN FIJA (FOOTER TABS) — solo móvil < 960px */
/* ============================================================ */
.mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.10);
    height: 64px;
    align-items: stretch;
    /* iPhone safe area */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 960px) {
    .mobile-bottom-nav {
        display: none; /* Oculto en desktop — usa el sidebar lateral */
    }
}

/* Cada tab de sección */
.mbnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    padding: 6px 2px 4px;
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.6rem;
    text-align: center;
    cursor: pointer;
    border-top: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.mbnav-item:hover { background: #f8fafc; }

/* Ícono emoji grande */
.mbnav-icon {
    font-size: 1.25rem;
    line-height: 1;
    display: block;
}

/* Número pequeño debajo del ícono */
.mbnav-num {
    font-size: 0.55rem;
    font-weight: 700;
    color: inherit;
    line-height: 1.2;
    opacity: 0.75;
}

/* Label de texto (solo visible en item activo) */
.mbnav-label {
    font-size: 0.58rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: var(--primary-color);
    display: block;
    line-height: 1.1;
}

/* Estado: Activo */
.mbnav-activo {
    color: var(--primary-color);
    border-top-color: var(--primary-color);
    background: #f0fdf4;
}
.mbnav-activo .mbnav-num { opacity: 1; color: var(--primary-color); }

/* Estado: Completado */
.mbnav-done {
    color: var(--secondary-color);
}
.mbnav-done .mbnav-num { color: var(--secondary-color); opacity: 1; }

/* Estado: Bloqueado */
.mbnav-locked {
    color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================================ */
/* AULA LAYOUT GRID                                             */
/* ============================================================ */
.aula-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    width: 100%;
}

@media (min-width: 960px) {
    .aula-layout {
        grid-template-columns: 300px 1fr;
    }
}

.sidebar-secciones {
    display: none; /* Oculto en móvil — el stepper cumple su rol */
    background: var(--white);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    width: 100%;
    height: fit-content;
}

@media (min-width: 960px) {
    .sidebar-secciones {
        display: block; /* Visible solo en desktop */
    }
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seccion-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.35rem;
    font-size: 0.84rem;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    width: 100%;
}

.seccion-item:hover { background-color: #f8fafc; }
.seccion-item.activo {
    background-color: #e8f5e9;
    color: var(--primary-color);
    font-weight: 600;
    border-color: #a7f3d0;
}
.seccion-item.completada { color: var(--secondary-color); }
.seccion-item.bloqueada {
    color: #9ca3af;
    cursor: not-allowed;
    background-color: #f9fafb;
}

.sec-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    flex-shrink: 0;
}
.seccion-item.activo .sec-num { background: var(--primary-color); color: #fff; }
.seccion-item.completada .sec-num { background: var(--secondary-color); color: #fff; }

.status-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.contenido-principal {
    background: var(--white);
    padding: 1.25rem 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    width: 100%;
}

@media (min-width: 768px) {
    .contenido-principal {
        padding: 2rem;
        border-radius: 10px;
    }
}

.module-header {
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.85rem;
    margin-bottom: 1.25rem;
}

.module-tag {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.module-title {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .module-title { font-size: 1.45rem; }
}

.callout-box {
    background-color: #f0fdf4;
    border-left: 4px solid var(--secondary-color);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    margin: 1.25rem 0;
    width: 100%;
}

/* ============================================================ */
/* COMPONENTE 3: REPRODUCTOR DE VIDEO VERTICAL (9:16 NATIVO)    */
/* ============================================================ */
.video-playlist-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 1.25rem 0;
    width: 100%;
}

@media (min-width: 840px) {
    .video-playlist-container {
        display: grid;
        grid-template-columns: 340px 1fr;
        align-items: start;
    }
}

.video-player-box {
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    color: #fff;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.video-player-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 520px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player-screen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.video-meta-bar {
    padding: 0.85rem;
    background: #1e293b;
    border-top: 1px solid #334155;
}

.playlist-scroll {
    max-height: 480px;
    overflow-y: auto;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.playlist-item {
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.playlist-item:hover {
    background: #f0fdf4;
    border-color: var(--secondary-color);
}

.playlist-item.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    border-color: var(--primary-color);
}

.playlist-item.watched {
    border-left: 3px solid var(--secondary-color);
}

/* ============================================================ */
/* COMPONENTE 4: FLASHCARDS 3D RESPONSIVE                       */
/* ============================================================ */
.flashcards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.25rem 0;
    width: 100%;
}

@media (min-width: 600px) {
    .flashcards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 990px) {
    .flashcards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.flashcard-scene {
    perspective: 1000px;
    min-height: 220px;
    cursor: pointer;
    width: 100%;
}

.flashcard-card {
    width: 100%;
    height: 100%;
    min-height: 220px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.flashcard-card.is-flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 10px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.flashcard-front {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border: 2px solid var(--secondary-color);
    color: var(--primary-color);
}

.flashcard-back {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: 2px solid var(--accent-orange);
    color: #ffffff;
    transform: rotateY(180deg);
}

.flashcard-tag {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.flashcard-body {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    margin: auto 0;
}

.flashcard-hint {
    font-size: 0.72rem;
    opacity: 0.8;
    text-align: right;
    font-style: italic;
}

/* ============================================================ */
/* COMPONENTE 5: CHATBOT SIMULADOR RESPONSIVE                   */
/* ============================================================ */
.chatbot-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin: 1.25rem 0;
    width: 100%;
}

.chatbot-header {
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.chatbot-character {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.chatbot-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    border: 2px solid #fff;
    flex-shrink: 0;
}

.chatbot-messages {
    padding: 1rem;
    max-height: 320px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.chat-bubble {
    max-width: 88%;
    padding: 0.75rem 0.95rem;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.4;
}

.chat-bubble-bot {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1f2937;
    border-bottom-left-radius: 2px;
}

.chat-bubble-user {
    align-self: flex-end;
    background: var(--primary-color);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.chat-bubble-system {
    align-self: center;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.78rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    text-align: center;
}

.chatbot-input-bar {
    padding: 0.75rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.4rem;
    width: 100%;
}

.chatbot-input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.88rem;
}

/* ============================================================ */
/* QUIZ & EXAM CARDS                                            */
/* ============================================================ */
.quiz-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

.quiz-question {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.92rem;
    margin-bottom: 0.75rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--white);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.86rem;
    width: 100%;
}

.quiz-option:hover {
    background-color: #f0fdf4;
    border-color: var(--secondary-color);
}

.quiz-option input[type="radio"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

/* ============================================================ */
/* CERTIFICATE STYLES (LANDSCAPE & PRINT)                       */
/* ============================================================ */
.certificate-wrapper {
    background: #525659;
    padding: 1.5rem 0.5rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.certificate {
    background: #ffffff;
    width: 100%;
    max-width: 900px;
    padding: 1.75rem 1.25rem;
    border: 8px solid var(--primary-color);
    outline: 3px solid var(--accent-orange);
    outline-offset: -5px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    text-align: center;
    color: #1f2937;
    background-image: radial-gradient(#f0fdf4 10%, transparent 10%);
    background-size: 20px 20px;
}

@media (min-width: 768px) {
    .certificate {
        padding: 2.5rem 3rem;
        border-width: 12px;
        outline-width: 4px;
        outline-offset: -8px;
    }
}

.cert-header h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

@media (min-width: 768px) {
    .cert-header h2 { font-size: 1.6rem; letter-spacing: 1px; }
}

.cert-header p {
    font-size: 0.82rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.cert-title {
    font-size: 1.1rem;
    color: var(--accent-orange);
    letter-spacing: 1.5px;
    font-weight: 700;
    margin: 0.75rem 0;
    text-transform: uppercase;
}

.cert-recipient {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-orange);
    display: inline-block;
    padding: 0 1rem 0.25rem;
    margin: 0.4rem 0 0.75rem;
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .cert-recipient { font-size: 1.8rem; padding: 0 2rem 0.3rem; }
}

.cert-dni {
    font-size: 0.88rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 1rem;
}

.cert-course {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0.6rem 0;
}

@media (min-width: 768px) {
    .cert-course { font-size: 1.35rem; }
}

.cert-text {
    font-size: 0.85rem;
    color: #4b5563;
    max-width: 650px;
    margin: 0 auto 1.25rem;
    line-height: 1.45;
}

.cert-footer {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.cert-signature {
    text-align: center;
    width: 160px;
}

.signature-line {
    border-top: 1px solid #4b5563;
    margin-top: 0.35rem;
    padding-top: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
}

.cert-code {
    margin-top: 1.25rem;
    font-size: 0.7rem;
    color: #9ca3af;
    letter-spacing: 0.5px;
}

@media print {
    body * { visibility: hidden; }
    header, nav, .btn, .no-print, footer { display: none !important; }
    .certificate-wrapper { background: transparent !important; padding: 0 !important; margin: 0 !important; }
    .certificate, .certificate * { visibility: visible; }
    .certificate {
        position: absolute;
        left: 0;
        top: 0;
        width: 100% !important;
        max-width: 100% !important;
        border-width: 8px !important;
        box-shadow: none !important;
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    @page { size: landscape A4; margin: 1cm; }
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: #d1fae5;
    text-align: center;
    padding: 1.25rem 1rem;
    margin-top: auto;
    font-size: 0.8rem;
    border-top: 3px solid var(--secondary-color);
    width: 100%;
}