/* === Hombro a Hombro — Estilos base === */

@layer base {
    *, *::before, *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Contenedor ───────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* ── Navbar ────────────────────────────────────────── */
.navbar {
    background: #d81b60;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
}

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

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9em;
}

.navbar-user a {
    color: #fff;
    text-decoration: none;
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 4px;
    font-size: 0.85em;
}

.navbar-user a:hover {
    background: rgba(255,255,255,.15);
}

/* ── Botones ──────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.btn-primary   { background: #d81b60; color: #fff; }
.btn-primary:hover { background: #b21550; }

.btn-secondary { background: #546e7a; color: #fff; }
.btn-secondary:hover { background: #37474f; }

.btn-link { background: none; color: #d81b60; padding: 5px; }
.btn-link:hover { text-decoration: underline; }

.btn-block { display: block; width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 0.85em; }

.btn-group { display: flex; gap: 10px; margin: 15px 0; }

/* ── Alertas / Flash messages ─────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 20px;
    font-size: 0.9em;
}

.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #2e7d32; }
.alert-error   { background: #fce4ec; color: #c62828; border-left: 4px solid #c62828; }
.alert-info    { background: #e3f2fd; color: #1565c0; border-left: 4px solid #1565c0; }

/* ── Formularios ──────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #d81b60;
    outline: none;
    box-shadow: 0 0 0 2px rgba(216, 27, 96, 0.15);
}

.form-group input[readonly] {
    background: #f0f0f0;
    color: #777;
}

/* ── Login ────────────────────────────────────────── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    max-width: 420px;
    width: 100%;
}

.login-box h1 {
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #333;
}

.login-logo {
    display: block;
    max-width: 200px;
    margin: 0 auto 20px;
}

/* ── Modal ────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
}

.modal-content h2 {
    color: #d81b60;
    margin-bottom: 15px;
}

.modal-content ol {
    margin: 10px 0 20px 20px;
}

/* ── Errores ──────────────────────────────────────── */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-page h1 {
    font-size: 4em;
    color: #d81b60;
}

.error-page p {
    font-size: 1.2em;
    margin: 10px 0 30px;
    color: #666;
}

/* ── Footer ───────────────────────────────────────── */
.footer {
    background: #333;
    color: #aaa;
    text-align: center;
    padding: 0;
    font-size: 0.85em;
    margin-top: auto;
}
#footerdefault {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 20px;
    background: #333;
    position: relative;
    min-height: 30px;
}
#footerdefault .botoniniciohah {
    flex: 1;
    min-width: 190px;
}
#footerdefault .botoniniciohah a {
    background: #d61b6c;
    color: #fff;
    padding: 0 24px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 0;
    left: 0;
    height: 56px;
    z-index: 10;
    line-height: normal;
    transition: background-color 0.2s ease;
}
#footerdefault .botoniniciohah a:hover {
    background: #b8155a;
}
#progreso-footer {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
#footerdefault span:last-child {
    flex: 1;
    text-align: right;
}
#footerdefault span:last-child a {
    color: #ccc;
    text-decoration: none;
    margin-left: 16px;
    font-size: 0.8rem;
}
#footerdefault span:last-child a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ── Dashboard del estudiante ─────────────────────── */
.progress-header {
    background: linear-gradient(135deg, #d81b60 0%, #880e4f 100%);
    color: #fff;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.progress-header .avatar {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: 700;
    flex-shrink: 0;
}

.progress-header h1 {
    font-size: 1.5em;
    margin-bottom: 4px;
}

.progress-header p {
    opacity: .85;
    font-size: 0.9em;
}

/* ── Barra de progreso ────────────────────────────── */
.stepper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.step-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    border: 2px solid transparent;
    transition: all .2s;
    position: relative;
}

.step-card.completado {
    border-color: #4caf50;
    background: #f1f8f1;
}

.step-card.actual {
    border-color: #d81b60;
    box-shadow: 0 4px 16px rgba(216,27,96,.18);
}

.step-card .step-icon {
    font-size: 2em;
    margin-bottom: 10px;
    display: block;
}

.step-card .step-numero {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ddd;
    color: #777;
    font-size: 0.8em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.step-card.completado .step-numero {
    background: #4caf50;
    color: #fff;
}

.step-card.actual .step-numero {
    background: #d81b60;
    color: #fff;
}

.step-card h3 {
    font-size: 0.9em;
    color: #333;
}

/* ── Tarjeta de acción principal ──────────────────── */
.action-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.action-card .action-icon {
    font-size: 3em;
    flex-shrink: 0;
}

.action-card h2 {
    font-size: 1.2em;
    margin-bottom: 6px;
    color: #222;
}

.action-card p {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 16px;
}

/* ── Reproductor YouTube ──────────────────────────── */
.video-wrapper {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

.video-lock-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.6);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-lock-box {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
}

/* ── Evaluación ───────────────────────────────────── */
.evaluacion-header {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: #fff;
    padding: 28px 32px;
    border-radius: 12px;
    margin-bottom: 28px;
}

.evaluacion-header h1 { font-size: 1.4em; margin-bottom: 6px; }
.evaluacion-header p  { opacity: .85; font-size: 0.9em; }

.pregunta-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.pregunta-card h3 {
    font-size: 1em;
    margin-bottom: 14px;
    color: #222;
    line-height: 1.5;
}

.pregunta-card .opciones {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opcion-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
    font-size: 0.95em;
}

.opcion-label:hover { border-color: #1565c0; background: #e8f0fe; }
.opcion-label input[type="radio"] { accent-color: #1565c0; }
.opcion-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #1565c0;
}

/* ── Resultado evaluación ─────────────────────────── */
.resultado-box {
    text-align: center;
    padding: 48px 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    max-width: 480px;
    margin: 0 auto;
}

.resultado-box .emoji { font-size: 4em; margin-bottom: 16px; }
.resultado-box h1 { font-size: 1.8em; margin-bottom: 8px; }
.resultado-box .puntaje { font-size: 3em; font-weight: 700; margin: 16px 0; }
.resultado-box.aprobado .puntaje { color: #4caf50; }
.resultado-box.desaprobado .puntaje { color: #e53935; }

/* ── Responsive adicional ─────────────────────────── */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 8px; }
    .login-box { padding: 25px; }
    .btn-group { flex-direction: column; }
    .progress-header { flex-direction: column; text-align: center; }
    .stepper { grid-template-columns: repeat(2, 1fr); }
    .action-card { flex-direction: column; text-align: center; }
    #footerdefault {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 0 0 12px 0;
    }
    #footerdefault .botoniniciohah {
        width: 100%;
        flex: none;
    }
    #footerdefault .botoniniciohah a {
        position: static;
        width: 100%;
        height: auto;
        padding: 12px 0;
    }
    #progreso-footer {
        flex: none;
        margin: 8px 0;
    }
    #footerdefault span:last-child {
        margin-left: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: none;
    }
    #footerdefault span:last-child a {
        margin-left: 0;
    }
}

/* ── Botones de retorno/regresar unificados ────────────────── */
/* Estilo unificado oscuro (texto gris oscuro, borde, hover fucsia) */
.btn-back-hah,
.admin-btn-secondary,
.btn-back-dark,
.btn-back-unified {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    gap: 0.5rem !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
    line-height: 1.25 !important;
    min-height: unset !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-sizing: border-box !important;
}

.btn-back-hah:hover,
.admin-btn-secondary:hover,
.btn-back-dark:hover,
.btn-back-unified:hover {
    border-color: #d81b60 !important;
    color: #d81b60 !important;
    background-color: #fdf5f9 !important;
    text-decoration: none !important;
}

/* Estilo unificado claro (para usar dentro de headers oscuros con gradiente) */
.btn-back-light,
.btn-back-header {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    padding: 0.5rem 1.25rem !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
    line-height: 1.25 !important;
    min-height: unset !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-sizing: border-box !important;
}

.btn-back-light:hover,
.btn-back-header:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

