/* ===== VARIABLES Y RESET ===== */
:root {
    --pizarra-dark: #1a3a2a;
    --pizarra-main: #2d5a45;
    --pizarra-light: #3d7a5f;
    --tiza-amarilla: #f4d35e;
    --tiza-naranja: #ee8959;
    --tiza-blanca: #f5f5dc;
    --tiza-rosa: #ffb5ba;
    --acento-verde: #7cb342;
    --sombra: rgba(0, 0, 0, 0.3);
    --borde-madera: #8b4513;
    --madera-clara: #deb887;
    --error: #ff6b6b;
    --exito: #51cf66;
}

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

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Montserrat:wght@400;500;600;700&display=swap');

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--pizarra-dark) 0%, var(--pizarra-main) 50%, var(--pizarra-light) 100%);
    min-height: 100vh;
    color: var(--tiza-blanca);
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.pizarra-bg {
    position: relative;
    background: linear-gradient(135deg, var(--pizarra-dark) 0%, var(--pizarra-main) 50%, var(--pizarra-light) 100%);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.pizarra-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(ellipse at 20% 30%, rgba(255,255,255,0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255,255,255,0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* ===== BANDERINES ===== */
.banderines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5px;
    z-index: 1;
    overflow: hidden;
    width: 100%;
}

.banderin {
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-top: 35px solid var(--tiza-amarilla);
    margin: 0 6px;
    position: relative;
    animation: swing 3s ease-in-out infinite;
}

.banderin::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -22px;
    width: 44px;
    height: 6px;
    background: rgba(255,255,255,0.4);
}

.banderin:nth-child(even) { border-top-color: var(--tiza-naranja); animation-delay: 0.5s; }
.banderin:nth-child(3n) { border-top-color: var(--tiza-rosa); animation-delay: 1s; }
.banderin:nth-child(4n+1) { border-top-color: var(--acento-verde); animation-delay: 1.5s; }

@keyframes swing {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* ===== CONTENEDOR ===== */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* ===== TIPOGRAFÍA ===== */
.titulo-tiza {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--tiza-amarilla);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 20px rgba(244, 211, 94, 0.3);
}

.texto-tiza {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    color: var(--tiza-blanca);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* ===== TARJETAS ===== */
.card {
    background: rgba(45, 90, 69, 0.9);
    border: 4px solid var(--borde-madera);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.1);
    padding: 30px;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--madera-clara), var(--borde-madera), var(--madera-clara));
    border-radius: 8px 8px 0 0;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: var(--tiza-blanca);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid var(--borde-madera);
    border-radius: 8px;
    color: #333;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--tiza-amarilla);
    box-shadow: 0 0 15px rgba(244, 211, 94, 0.4);
}

/* ===== BOTONES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--tiza-naranja), #d97848);
    color: white;
    box-shadow: 0 4px 15px rgba(238, 137, 89, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 137, 89, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--tiza-amarilla), #e5c44f);
    color: var(--pizarra-dark);
    box-shadow: 0 4px 15px rgba(244, 211, 94, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 211, 94, 0.6);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--tiza-blanca);
    color: var(--tiza-blanca);
}

.btn-outline:hover {
    background: var(--tiza-blanca);
    color: var(--pizarra-dark);
}

.btn-block { width: 100%; max-width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== NAVEGACIÓN ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(26, 58, 42, 0.95);
    border-bottom: 4px solid var(--borde-madera);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    flex-shrink: 0;
    z-index: 1002;
}

.navbar-brand img { 
    height: 50px;
    border-radius: 8px;
}

.navbar-brand span {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--tiza-amarilla);
}

/* Contenedor derecho del navbar */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1002;
}

/* Menú Hamburguesa */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
    position: relative;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--tiza-amarilla);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.navbar-menu a {
    color: var(--tiza-blanca);
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.navbar-menu a:hover, .navbar-menu a.active {
    background: rgba(255,255,255,0.1);
    color: var(--tiza-amarilla);
}

/* ===== AUTH ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
    padding: 40px 20px;
    width: 100%;
}

.auth-card { 
    width: 100%; 
    max-width: 500px; 
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: var(--tiza-amarilla);
    margin-bottom: 10px;
}

.auth-header p {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    opacity: 0.9;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--tiza-blanca);
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: var(--tiza-amarilla);
    color: var(--pizarra-dark);
}

.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.3s ease; }

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

.auth-links {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.auth-links a {
    color: var(--tiza-amarilla);
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
}

/* ===== LOGOS EN AUTH ===== */
.logos-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.logo-auth {
    height: 80px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.logo-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.logo-circle img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.logo-header {
    text-align: center;
    margin-bottom: 25px;
}

/* ===== ALERTAS ===== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    width: 100%;
    word-wrap: break-word;
}

.alert-error { background: rgba(255, 107, 107, 0.2); border: 2px solid var(--error); color: #ff8a8a; }
.alert-success { background: rgba(81, 207, 102, 0.2); border: 2px solid var(--exito); color: #72e88a; }
.alert-info { background: rgba(244, 211, 94, 0.2); border: 2px solid var(--tiza-amarilla); color: var(--tiza-amarilla); }

/* ===== CURSO ===== */
.curso-header {
    text-align: center;
    padding: 100px 20px 40px;
    width: 100%;
}

.curso-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    color: var(--tiza-amarilla);
    margin-bottom: 10px;
    word-wrap: break-word;
}

.curso-header h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.5rem;
    opacity: 0.9;
    word-wrap: break-word;
}

.tematica-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.tematica-texto {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.8;
    word-wrap: break-word;
}

.tematica-texto h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--tiza-amarilla);
    margin-bottom: 15px;
    word-wrap: break-word;
}

.tematica-imagen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.tematica-imagen img {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 8px;
    display: block;
    object-fit: contain;
}

/* ===== EVALUACIÓN ===== */
.evaluacion-container { 
    margin-top: 40px; 
    width: 100%;
}

.evaluacion-header {
    text-align: center;
    margin-bottom: 30px;
}

.evaluacion-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: var(--tiza-naranja);
    word-wrap: break-word;
}

.pregunta-card {
    background: rgba(61, 122, 95, 0.8);
    border: 3px solid var(--tiza-amarilla);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 100%;
}

.pregunta-numero {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--tiza-naranja);
    margin-bottom: 10px;
}

.pregunta-texto {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    margin-bottom: 20px;
    word-wrap: break-word;
}

.opciones-respuesta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.opcion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.opcion:hover { background: rgba(255,255,255,0.2); border-color: var(--tiza-amarilla); }
.opcion.selected { background: rgba(244, 211, 94, 0.3); border-color: var(--tiza-amarilla); }
.opcion.correct { background: rgba(81, 207, 102, 0.3); border-color: var(--exito); }
.opcion.incorrect { background: rgba(255, 107, 107, 0.3); border-color: var(--error); }

.opcion input { display: none; }

.opcion-radio {
    width: 24px;
    height: 24px;
    border: 3px solid var(--tiza-blanca);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.opcion.selected .opcion-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--tiza-amarilla);
    border-radius: 50%;
}

.opcion-texto {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    flex: 1;
    word-wrap: break-word;
}

/* ===== PROGRESO ===== */
.progreso-bar {
    width: 100%;
    height: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progreso-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--acento-verde), var(--tiza-amarilla));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progreso-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 70px;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 3px solid var(--tiza-blanca);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.step.completed .step-circle { background: var(--exito); border-color: var(--exito); }
.step.active .step-circle {
    background: var(--tiza-amarilla);
    border-color: var(--tiza-amarilla);
    color: var(--pizarra-dark);
    transform: scale(1.1);
}

.step-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
    word-wrap: break-word;
}

/* ===== MODAL RESULTADO ===== */
.resultado-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.resultado-modal.show { opacity: 1; visibility: visible; }

.resultado-content {
    background: var(--pizarra-main);
    border: 4px solid var(--borde-madera);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.resultado-modal.show .resultado-content { transform: scale(1); }

.resultado-icon { font-size: 80px; margin-bottom: 20px; }

.resultado-titulo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 15px;
    word-wrap: break-word;
}

.resultado-titulo.aprobado { color: var(--exito); }
.resultado-titulo.reprobado { color: var(--error); }

.resultado-puntuacion {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    margin-bottom: 25px;
    word-wrap: break-word;
}

/* ===== CERTIFICADO ===== */
.certificado-container {
    padding: 40px 20px;
    max-width: 1000px; 
    width: 100%;
    margin: 0 auto;
}

.certificado {
    background: linear-gradient(135deg, #fefefe 0%, #f5f5f0 100%);
    border: 12px solid;
    border-image: linear-gradient(135deg, #d4af37, #f5d061, #d4af37) 1;
    padding: 60px 80px;  /* Cambiado: más padding horizontal */
    text-align: center;
    position: relative;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 100%;
    min-height: 700px;  /* Agregado: altura mínima */
}

.certificado::before, .certificado::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border: 3px solid #d4af37;
}

.certificado::before { top: 20px; left: 20px; border-right: none; border-bottom: none; }
.certificado::after { bottom: 20px; right: 20px; border-left: none; border-top: none; }

.certificado-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.certificado-logo { 
    width: 100px; 
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.certificado-titulo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: #1a3a2a;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.certificado-subtitulo {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 3px;
    word-wrap: break-word;
}

.certificado-nombre {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    color: #d4af37;
    border-bottom: 2px solid #d4af37;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 20px;
    word-wrap: break-word;
    max-width: 100%;
}

.certificado-cedula {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: #666;
    margin-bottom: 30px;
    word-wrap: break-word;
}

.certificado-curso {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 40px;
    line-height: 1.6;
    word-wrap: break-word;
}

.certificado-footer {
    display: flex;
    justify-content: space-around;
    margin-top: 40px;
    flex-wrap: wrap;
    gap: 30px;
}

.certificado-firma { text-align: center; }
.certificado-firma-linea { 
    width: 200px; 
    max-width: 100%;
    border-top: 2px solid #333; 
    margin-bottom: 10px; 
}
.certificado-firma-nombre { 
    font-family: 'Poppins', sans-serif; 
    font-size: 0.9rem; 
    color: #333; 
}

.certificado-codigo {
    position: absolute;
    bottom: 10px;  /* ← Cambiar de 30px a 10px */
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;  /* ← Reducir tamaño de fuente */
    color: #999;
    max-width: 90%;
    word-wrap: break-word;
    text-align: center;  /* ← Agregar centrado */
}

/* ===== ADMIN ===== */
.admin-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 80px);
    width: 100%;
}

.admin-sidebar {
    background: rgba(26, 58, 42, 0.95);
    border-right: 4px solid var(--borde-madera);
    padding: 20px;
}

.admin-menu { list-style: none; }
.admin-menu li { margin-bottom: 10px; }

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--tiza-blanca);
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    word-wrap: break-word;
}

.admin-menu a:hover, .admin-menu a.active {
    background: rgba(255,255,255,0.1);
    color: var(--tiza-amarilla);
}

.admin-content {
    padding: 30px;
    overflow-y: auto;
    width: 100%;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
}

.admin-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: var(--tiza-amarilla);
    word-wrap: break-word;
}

/* ===== TABLAS ===== */
.tabla-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 3px solid var(--borde-madera);
    width: 100%;
    max-width: 100%;
}

.tabla {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    background: rgba(45, 90, 69, 0.9);
}

.tabla th, .tabla td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-family: 'Poppins', sans-serif;
    word-wrap: break-word;
}

.tabla th {
    background: rgba(26, 58, 42, 0.9);
    color: var(--tiza-amarilla);
    font-weight: 600;
    font-size: 1rem;
}

.tabla td { 
    font-weight: 400;
    font-size: 0.95rem; 
}

.tabla tr:hover { background: rgba(255,255,255,0.05); }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-activo { background: rgba(81, 207, 102, 0.3); color: var(--exito); border: 1px solid var(--exito); }
.badge-inactivo { background: rgba(255, 107, 107, 0.3); color: var(--error); border: 1px solid var(--error); }
.badge-admin, .badge-administrador { background: rgba(244, 211, 94, 0.3); color: var(--tiza-amarilla); border: 1px solid var(--tiza-amarilla); }
.badge-asesor { background: rgba(238, 137, 89, 0.3); color: var(--tiza-naranja); border: 1px solid var(--tiza-naranja); }

.acciones-btn { 
    display: flex; 
    gap: 8px;
    flex-wrap: wrap;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-icon.edit { background: var(--tiza-amarilla); color: var(--pizarra-dark); }
.btn-icon.delete { background: var(--error); color: white; }
.btn-icon.view { background: var(--acento-verde); color: white; }
.btn-icon:hover { transform: scale(1.1); }

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal.show { opacity: 1; visibility: visible; }

.modal-content {
    background: var(--pizarra-main);
    border: 4px solid var(--borde-madera);
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal.show .modal-content { transform: scale(1); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    flex-wrap: wrap;
    gap: 10px;
}

.modal-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--tiza-amarilla);
    word-wrap: break-word;
}

.modal-close {
    background: none;
    border: none;
    color: var(--tiza-blanca);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}

.modal-close:hover { color: var(--error); }

/* ===== ESTADÍSTICAS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.stat-card {
    background: rgba(61, 122, 95, 0.8);
    border: 3px solid var(--tiza-amarilla);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    width: 100%;
}

.stat-numero {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--tiza-amarilla);
    word-wrap: break-word;
}

.stat-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    opacity: 0.9;
    word-wrap: break-word;
}

/* ===== PAGINACIÓN ===== */
.paginacion {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.paginacion button {
    padding: 10px 16px;
    background: rgba(255,255,255,0.1);
    border: 2px solid var(--tiza-blanca);
    border-radius: 8px;
    color: var(--tiza-blanca);
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.paginacion button:hover, .paginacion button.active {
    background: var(--tiza-amarilla);
    border-color: var(--tiza-amarilla);
    color: var(--pizarra-dark);
}

/* ===== SPINNER ===== */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: var(--tiza-amarilla);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 58, 42, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 4000;
}

.loading-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    margin-top: 20px;
}

/* ===== FOOTER ===== */
.footer {
    background: rgba(26, 58, 42, 0.95);
    border-top: 4px solid var(--borde-madera);
    padding: 20px;
    text-align: center;
    margin-top: auto;
    width: 100%;
}

.footer-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--tiza-blanca);
    opacity: 0.9;
}

.footer-convenio {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--tiza-amarilla);
    margin-top: 8px;
}

/* ===== ANIMACIONES ===== */
.fade-in { animation: fadeIn 0.5s ease forwards; }
.slide-up { animation: slideUp 0.5s ease forwards; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* ===== USER INFO ===== */
.user-info {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--tiza-blanca);
}

/* ===== RESPONSIVE - TABLETS (MÁXIMO 992PX) ===== */
@media (max-width: 992px) {
    .container {
        padding: 15px;
        width: 100%;
    }

    .banderin {
        border-left-width: 18px;
        border-right-width: 18px;
        border-top-width: 30px;
        margin: 0 4px;
    }

    .banderin::before {
        width: 36px;
        left: -18px;
    }

    .navbar {
        padding: 12px 15px;
    }

    .navbar-brand img {
        height: 40px;
    }

    .navbar-brand span {
        font-size: 1.2rem;
    }

    .navbar-menu {
        gap: 10px;
    }

    .navbar-menu a {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .tematica-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .curso-header h1 {
        font-size: 2.2rem;
    }

    .curso-header h2 {
        font-size: 1.2rem;
    }

    /* Admin con menú hamburguesa */
    .admin-container {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        border-right: 4px solid var(--borde-madera);
        border-bottom: none;
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        display: block !important;
        padding-top: 80px;
    }

    .admin-sidebar.active {
        left: 0;
    }

    /* Mostrar botón hamburguesa en admin */
    body:has(.admin-container) .menu-toggle {
        display: flex;
    }
    
    .menu-toggle {
        display: flex;
    }

    .admin-content {
        padding: 20px 15px;
        width: 100%;
    }

    .logos-container {
        gap: 20px;
    }

    .logo-auth {
        height: 60px;
    }

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

    .stat-numero {
        font-size: 2rem;
    }

    .certificado {
        padding: 30px 20px;
    }

    .certificado-titulo {
        font-size: 2rem;
    }

    .certificado-nombre {
        font-size: 1.8rem;
    }

    .certificado::before, .certificado::after {
        width: 60px;
        height: 60px;
    }

    .step-circle {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .step-label {
        font-size: 0.8rem;
    }
}

/* ===== RESPONSIVE - MÓVILES (MÁXIMO 768PX) ===== */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 15px;
    }

    /* Menú hamburguesa visible */
    .menu-toggle {
        display: flex;
    }

    .navbar-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(26, 58, 42, 0.98);
        flex-direction: column;
        padding: 80px 20px 20px;
        gap: 5px;
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    }

    .navbar-menu.active {
        right: 0;
    }

    .navbar-menu a {
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
        text-align: left;
    }

    .user-info {
        width: 100%;
        padding: 12px 16px;
        text-align: left;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 10px;
    }

    /* Overlay para cerrar menú */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
        display: none;
    }

    .menu-overlay.active {
        display: block;
    }

    .curso-header {
        padding: 80px 15px 30px;
    }

    .curso-header h1 {
        font-size: 1.8rem;
    }

    .curso-header h2 {
        font-size: 1rem;
    }

    .card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .auth-container {
        padding: 20px 15px;
    }

    .auth-header h1 {
        font-size: 1.6rem;
    }

    .logos-container {
        flex-direction: column;
        gap: 15px;
    }

    .logo-auth {
        height: 50px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .evaluacion-header h2 {
        font-size: 1.5rem;
    }

    .pregunta-card {
        padding: 18px 15px;
    }

    .certificado {
        padding: 25px 15px;
        border-width: 8px;
    }

    .certificado-logos {
        flex-direction: column;
        gap: 20px;
    }

    .certificado-logo {
        width: 70px;
    }

    .certificado-titulo {
        font-size: 1.5rem;
    }

    .certificado-nombre {
        font-size: 1.5rem;
    }

    .certificado-footer {
        flex-direction: column;
        gap: 25px;
    }

    .certificado::before, .certificado::after {
        width: 40px;
        height: 40px;
    }

    .step {
        min-width: 65px;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .admin-header h1 {
        font-size: 1.6rem;
    }

    .tabla {
        font-size: 0.85rem;
    }

    .tabla th, .tabla td {
        padding: 10px 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal-content {
        padding: 20px 15px;
        width: 95%;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .footer {
        padding: 15px 10px;
    }

    .footer-text {
        font-size: 0.8rem;
    }

    .footer-convenio {
        font-size: 0.9rem;
    }
}

/* ===== RESPONSIVE - MÓVILES PEQUEÑOS (MÁXIMO 480PX) ===== */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .banderines {
        height: 60px;
    }

    .banderin {
        border-left-width: 14px;
        border-right-width: 14px;
        border-top-width: 24px;
        margin: 0 3px;
    }

    .navbar-brand img {
        height: 35px;
    }

    .navbar-brand span {
        font-size: 1rem;
    }

    .navbar-menu {
        width: 100%;
        max-width: 300px;
    }

    .curso-header {
        padding: 60px 10px 20px;
    }

    .curso-header h1 {
        font-size: 1.5rem;
    }

    .curso-header h2 {
        font-size: 0.9rem;
    }

    .card {
        padding: 15px 12px;
        border-width: 3px;
    }

    .auth-card {
        padding: 20px 15px;
    }

    .auth-header h1 {
        font-size: 1.4rem;
    }

    .auth-tabs {
        flex-direction: column;
    }

    .logo-auth {
        height: 40px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .evaluacion-header h2 {
        font-size: 1.3rem;
    }

    .pregunta-card {
        padding: 15px 12px;
    }

    .opcion {
        padding: 10px 12px;
    }

    .opcion-radio {
        width: 20px;
        height: 20px;
    }

    .opcion-texto {
        font-size: 0.85rem;
    }

    .progreso-bar {
        height: 16px;
    }

    .step {
        min-width: 55px;
    }

    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        border-width: 2px;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .certificado {
        padding: 20px 10px;
        border-width: 6px;
    }

    .certificado-logo {
        width: 60px;
    }

    .certificado-titulo {
        font-size: 1.2rem;
    }

    .certificado-nombre {
        font-size: 1.2rem;
    }

    .certificado-cedula,
    .certificado-curso {
        font-size: 0.85rem;
    }

    .certificado::before, .certificado::after {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }

    .resultado-content {
        padding: 25px 15px;
    }

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

    .resultado-titulo {
        font-size: 1.4rem;
    }

    .admin-content {
        padding: 15px 10px;
    }

    .admin-header h1 {
        font-size: 1.4rem;
    }

    .stat-card {
        padding: 18px 15px;
    }

    .stat-numero {
        font-size: 1.8rem;
    }

    .tabla {
        font-size: 0.75rem;
        min-width: 500px;
    }

    .tabla th, .tabla td {
        padding: 8px 6px;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
    }

    .paginacion button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .alert {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .footer {
        padding: 12px 8px;
    }

    .footer-text {
        font-size: 0.75rem;
    }

    .footer-convenio {
        font-size: 0.8rem;
    }
}

/* ===== ORIENTACIÓN LANDSCAPE EN MÓVILES ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .curso-header {
        padding: 40px 20px 20px;
    }

    .curso-header h1 {
        font-size: 1.5rem;
    }

    .auth-container {
        padding: 20px;
    }

    .certificado {
        padding: 20px;
    }

    .modal-content {
        max-height: 85vh;
    }

    .navbar-menu {
        padding-top: 60px;
    }
}

/* ===== MEJORAS DE ACCESIBILIDAD Y TOUCH ===== */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .opcion {
        min-height: 48px;
    }

    .navbar-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .admin-menu a {
        min-height: 44px;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    .menu-toggle {
        min-width: 44px;
        min-height: 44px;
    }

    .btn:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }

    .opcion:hover {
        background: rgba(255,255,255,0.1);
    }
}

/* ===== IMPRESIÓN ===== */
@media print {
    body { 
        background: white !important; 
    }

    .navbar, 
    .btn, 
    .progreso-steps, 
    .progreso-bar, 
    #alertContainer, 
    .footer, 
    .banderines,
    .menu-toggle,
    .card:first-of-type { 
        display: none !important; 
    }

    .certificado-container { 
        padding: 0 !important; 
        display: block !important; 
    }

    .certificado { 
        box-shadow: none !important;
        border: 3px solid #d4af37 !important;
        page-break-inside: avoid;
    }

    .container { 
        padding: 0 !important; 
    }
}