/* =========================================================================
   1. RESETEO BÁSICO Y VARIABLES GLOBALES
   ========================================================================= */
:root {
    --color-navy: #303c49;
    --color-primary: #52677d;
    --color-primary-hover: #405365;
    --color-blue-soft: #e8edf2;
    --color-teal: #326657;
    --color-teal-soft: #e0f1e8;
    --color-amber: #79521e;
    --color-amber-soft: #fff0dc;
    --color-lavender-soft: #eee8f8;
    --color-lavender: #665180;
    --color-bg: #f7f8fc;
    --color-ink: #28334a;
    --color-muted: #59667b;
    --color-border: #d5ddeb;
    --color-focus: #5d7186;
    --color-error: #9a3535;
    --color-surface: #fff;
    --radius-panel: 12px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-ink);
}

/* =========================================================================
   2. ESTRUCTURA PRINCIPAL (Header, Footer y Navegación)
   ========================================================================= */
header {
    background-color: var(--color-navy);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

footer {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--color-navy);
    color: white;
}

/* =========================================================================
   3. BOTONES GENÉRICOS
   ========================================================================= */
.btn-login {
    background-color: var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn-login:hover {
    background-color: var(--color-primary-hover);
}

.btn-start {
    margin-top: 1.5rem;
    padding: 0.7rem 1rem;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}

.btn-start:hover {
    background-color: var(--color-primary-hover);
}

/* =========================================================================
   4. PANTALLA DE INICIO (Index)
   ========================================================================= */
.hero {
    background-color: #292929;
    color: white;
    text-align: center;
    padding: 4rem 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.exam-panel {
    padding: 3rem 5%;
    text-align: center;
}

.grid-categorias {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap; /* Para que se adapte a celulares */
}

/* =========================================================================
   5. TARJETAS (Dashboard y Categorías)
   ========================================================================= */
.card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 300px;
    text-align: left;
}

.card h3 {
    color: #202020;
    margin-bottom: 1rem;
}






/* =========================================================================
   6. FORMULARIOS DE LOGIN / REGISTRO
   ========================================================================= */

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    color: #202020;
    margin-bottom: 0.5rem;
}

.input-group {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
}

.input-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    background: #fff;
    color: #202020;
    color-scheme: light;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-submit {
    margin-top: 2rem;
    padding: 0.8rem;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    width: 100%;
    font-size: 1rem;
    cursor: pointer;
}

.btn-submit:hover {
    background-color: var(--color-primary-hover);
}
.account-message { color: #444; padding: 0.5rem 0; overflow-wrap: anywhere; }
.input-group input:-webkit-autofill { -webkit-text-fill-color: #202020; caret-color: #202020; }
button:disabled { cursor: default; opacity: 0.65; }
#btn-cerrar-login { border: 0; background: transparent; padding: 0.25rem; }

.toggle-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #555;
}

.toggle-text a {
    color: #303030;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.toggle-text a:hover {
    color: #101010;
    text-decoration: underline;
}

/* =========================================================================
   7. DASHBOARD DE USUARIO (Panel Principal)
   ========================================================================= */
.dashboard-main {
    padding: 3rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}




/* =========================================================================
   8. PANTALLAS DE PRÁCTICA (Modos A, B y C)
   ========================================================================= */

/* Selector de Modos */
.modos-container { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
    margin-top: 1.5rem; 
}
.course-modes { padding: clamp(1.25rem, 4vw, 2.5rem); }
.course-modes h2 { color: #292929; margin-bottom: 0.5rem; }
.course-modes > p { color: #666; }
.course-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.course-tabs button {
    min-height: 44px; padding: 0.6rem 1.2rem; border: 1px solid #ccc;
    border-radius: 8px; background: #fff; color: #303030; font-weight: 600; cursor: pointer;
}
.course-tabs button[aria-pressed="true"] { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.bookmark-button {
    display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px;
    border: 1px solid #bdbdbd; border-radius: 8px; padding: 0.5rem 0.75rem;
    margin: 0 0.75rem 1rem 0; background: #fff; color: #303030; cursor: pointer;
}
.bookmark-button[hidden] { display: none; }
.bookmark-button[aria-pressed="true"] { background: var(--color-amber-soft); border-color: var(--color-amber); color: var(--color-amber); }
.bookmark-button[aria-pressed="true"] svg { fill: currentColor; }
#pantalla-progreso { background: #fff; border: 1px solid #dedede; border-radius: 10px; }
#pantalla-progreso h3 { margin: 1.5rem 0 1rem; }
.progress-total { font-size: 1.15rem; font-weight: 700; margin: 1rem 0; }
.progress-topic { padding: 0.6rem 0; }
.progress-topic progress { display: block; width: 100%; height: 12px; accent-color: var(--color-teal); margin-top: 0.4rem; }
.progress-topic progress::-webkit-progress-bar { background: #e1e9ed; border-radius: 6px; }
.progress-topic progress::-webkit-progress-value { background: var(--color-teal); border-radius: 6px; }
.progress-topic progress::-moz-progress-bar { background: var(--color-teal); border-radius: 6px; }
.progress-entry { padding: 1rem; border: 1px solid #ddd; border-radius: 10px; margin-bottom: 0.75rem; overflow-wrap: anywhere; }
.progress-entry p:first-child { font-weight: 600; margin-bottom: 0.5rem; }
.progress-entry .figure-tab { margin: 1rem 0.5rem 0 0; }
.exam-review { text-align: left; margin-bottom: 1.5rem; }
.exam-review h3 { margin-bottom: 1rem; }
.exam-attempt { border: 1px solid #ddd; border-radius: 10px; margin-bottom: 1rem; padding: 1rem; overflow-wrap: anywhere; }
.exam-attempt summary { cursor: pointer; font-weight: 600; line-height: 1.6; }
.exam-attempt[open] summary { margin-bottom: 1rem; }
#btn-resultados-progreso { display: block; margin: 0 auto 1.5rem; }
.course-modes .modo-desc { display: block; }

.modo-card { 
    background: white; 
    border: 2px solid #e0e0e0; 
    border-radius: 8px; 
    padding: 1.2rem 1.5rem; 
    cursor: pointer; 
    text-align: left; 
    transition: all 0.2s; 
}

.modo-card:hover { 
    border-color: var(--color-primary); 
    background: var(--color-blue-soft); 
    transform: translateY(-2px); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.05); 
}

.modo-titulo { 
    font-size: 1.15rem; 
    color: var(--color-primary); 
    font-weight: bold; 
    margin-bottom: 0.4rem; 
    display: flex; 
    align-items: center; 
    gap: 10px;
}

.modo-desc { 
    font-size: 0.9rem; 
    color: #666666; 
    margin: 0; 
    line-height: 1.4; 
}

/* Área del Examen / Práctica */

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.timer {
    background-color: #454545;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 1.1rem;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 2rem;
    color: #292929;
}

/* Opciones de respuesta */

.option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #cccccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.4s ease; 
}

.option:hover {
    background-color: #fafafa;
    border-color: #606060;
}

/* Clases dinámicas para Modo C (Añadidas vía JavaScript) */
.option.selectable { 
    cursor: pointer; 
    transition: background 0.2s, border-color 0.2s; 
}
.option.selectable:hover { 
    background: #f5f5f5; 
}
.option.selected { 
    background: var(--color-blue-soft) !important; 
    border-color: var(--color-primary) !important; 
}

/* Caja de Explicaciones (Modo A y B) */
.explicacion-box {
    background-color: var(--color-blue-soft); 
    border-left: 5px solid var(--color-primary); 
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    animation: aparecerSuave 0.3s ease-out;
}

.explicacion-box h4 {
    color: #292929;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.explicacion-box p {
    color: #454545;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.referencia-tag {
    background-color: #f7faff;
    color: #484848;
    padding: 0.6rem;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px dashed var(--color-focus);
}

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

/* =========================================================================
   9. VENTANAS EMERGENTES (Modales de Pago)
   ========================================================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.activo {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    position: relative;
    animation: aparecer 0.3s ease-out;
}

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

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    font-weight: bold;
    color: #666666;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #454545;
}

.modal-content .login-box {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    max-width: 100%;
}

/* Acabado compartido: fondos neutros y acentos de color para acciones y estados. */
body { line-height: 1.5; }
button, input { font: inherit; }
input { accent-color: var(--color-primary); }
a, button, input { -webkit-tap-highlight-color: transparent; }
:is(a, button, input):focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 4px;
}
header { gap: 1.5rem; flex-wrap: wrap; }
nav ul { flex-wrap: wrap; gap: 0.75rem 1.5rem; }
nav a { display: inline-flex; align-items: center; min-height: 44px; }
.hero {
    background: linear-gradient(125deg, var(--color-blue-soft), var(--color-lavender-soft) 65%, var(--color-teal-soft));
    color: var(--color-navy);
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.2; }
.card, .login-box, .modal-content {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.045);
}
.card { max-width: 100%; }
.btn-start, .btn-submit, .btn-login {
    border-radius: 8px;
    min-height: 44px;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}
.btn-start:hover, .btn-submit:hover { filter: brightness(0.85); }
.input-group input { min-width: 0; border-radius: 8px; min-height: 44px; }
.option.selected { box-shadow: inset 3px 0 var(--color-primary); }
.timer { background: var(--color-blue-soft); color: var(--color-primary); }
#tiempo-simulacro { background: var(--color-amber-soft); color: var(--color-amber); }
#num-practica {
    flex-shrink: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--color-border);
}
.practice-card {
    display: flex;
    flex-direction: column;
    height: clamp(490px, 72dvh, 700px);
    padding: clamp(1rem, 3vw, 2rem);
    box-sizing: border-box;
}
.practice-content { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding-right: 8px; }
.practica-actions {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 54px 60px;
    grid-template-areas: 'back next' 'bookmark reveal';
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 2px solid #e0e0e0;
}
.practica-actions .btn-start, .practica-actions .bookmark-button {
    width: 100%; height: 100%; min-width: 0; min-height: 0;
    padding: 8px; margin: 0; box-sizing: border-box;
    justify-content: center; font-size: clamp(.8rem, 2.5vw, 1rem);
    line-height: 1.25; transform: none;
}
.practica-actions .bookmark-button svg { flex-shrink: 0; }
#btn-anterior { grid-area: back; }
#btn-siguiente { grid-area: next; }
#btn-marcar-pregunta { grid-area: bookmark; }
#btn-revelar, #btn-explicacion { grid-area: reveal; }
#estado-marcador { flex-shrink: 0; display: block; height: 3.6em; overflow-y: auto; margin: 8px 0 0; font-size: .85rem; line-height: 1.2; }
#tiempo-simulacro, .result-duration { font-variant-numeric: tabular-nums; font-weight: 700; }
.result-duration { margin-bottom: 1.5rem; }
.exam-verdict { margin-top: 1rem; padding: 0.6rem 1rem; border-radius: 8px; font-weight: 700; }
.exam-verdict.passed { color: var(--color-teal); background: var(--color-teal-soft); }
.exam-verdict.failed { color: #873e3e; background: #fbeaea; }
.exam-pass-mark { margin-top: 0.5rem; font-size: 0.9rem; color: var(--color-muted); }
.exam-score-panel { background: var(--color-blue-soft); border: 1px solid var(--color-border); border-radius: 10px; padding: clamp(1rem, 4vw, 2rem); margin-bottom: 2rem; }
.score-ring {
    --score-percent: 0%;
    --score-color: var(--color-primary);
    position: relative; isolation: isolate; display: grid; place-items: center;
    width: min(190px, 100%); aspect-ratio: 1; margin: 1.25rem auto 0.75rem;
    border-radius: 50%; background: conic-gradient(var(--score-color) var(--score-percent), var(--color-border) 0);
}
.score-ring::before { content: ''; position: absolute; inset: 14px; z-index: -1; border-radius: 50%; background: #fff; }
.score-ring.passed { --score-color: var(--color-teal); }
.score-ring-value { color: var(--color-navy); font-size: clamp(1.5rem, 6vw, 2.3rem); font-weight: 700; }
.score-count { color: var(--color-muted); font-size: 1.1rem; font-weight: 600; }
.course-summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
.course-stat { padding: 0.85rem 1rem; border: 1px solid var(--color-border); border-radius: 12px; background: rgba(255,255,255,0.8); }
.course-summary dt { color: var(--color-muted); font-size: 0.9rem; }
.course-summary dd { margin: 0.25rem 0 0; color: var(--color-navy); font-weight: 700; overflow-wrap: anywhere; }
.option[aria-disabled='true'] { cursor: default; }
.option:focus-visible { outline: 2px solid #454545; outline-offset: 3px; }
.practica-actions button:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }
.study-method {
    margin-bottom: 1.5rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    background: var(--color-blue-soft);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: #454545;
}
.study-method > p { font-size: 0.95rem; }
.study-method .btn-start { margin-top: 0.75rem; }
body.study-method-open { overflow: hidden; }
.figure-tab {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid #bdbdbd;
    border-radius: 8px;
    color: var(--color-primary);
    background: var(--color-blue-soft);
    font-weight: 600;
    cursor: pointer;
}
.figure-tab[hidden] { display: none; }
#modal-figura {
    background: #fff;
    color-scheme: light;
    margin: auto;
    width: min(1000px, calc(100% - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: clamp(1rem, 3vw, 2rem);
    overflow: auto;
    border: 1px solid #d4d4d4;
    border-radius: 10px;
    color: #303030;
}
#modal-figura::backdrop { background: rgba(0,0,0,0.65); }
#contenido-figura img { display: block; max-width: 100%; height: auto; margin: 1rem auto; }
#contenido-figura img[hidden] { display: none; }
#contenido-figura a { display: block; color: #303030; text-decoration: underline; min-height: 44px; }
.figure-close { min-width: 44px; min-height: 44px; border: 1px solid #ccc; border-radius: 8px; background: #f5f5f5; color: #303030; font-size: 1.5rem; cursor: pointer; }
#guia-metodo-estudio {
    margin: auto;
    width: min(720px, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(1.25rem, 4vw, 2rem);
    color: #454545;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.25);
}
#guia-metodo-estudio::backdrop { background: rgba(0,0,0,0.6); }
.study-method-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.study-method-header h2 { flex: 1; color: #292929; font-size: 1.4rem; }
#btn-cerrar-metodo {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    background: #f5f5f5;
    color: #292929;
    font-size: 1.5rem;
    cursor: pointer;
}
#guia-metodo-estudio h3 { color: #292929; margin-bottom: 1rem; }
#guia-metodo-estudio ol { padding-left: 1.4rem; }
#guia-metodo-estudio li { padding-left: 0.25rem; margin-bottom: 1rem; }
.study-method-note { margin-top: 1rem; font-size: 0.9rem; color: #606060; }
.radio-group { display: flex; flex-direction: column; gap: 0.8rem; }
.radio-label {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 60px;
    padding: 1rem;
    border: 2px solid #d4d4d4;
    border-radius: 10px;
    background: #fff;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color 150ms, border-color 150ms, color 150ms;
}
.radio-label input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.radio-label:hover { background: var(--color-blue-soft); border-color: var(--color-focus); }
.radio-label:has(input:checked) { background: var(--color-blue-soft); border-color: var(--color-primary); color: var(--color-navy); }
.radio-label:has(input:checked):hover { background: #d8e5f6; }
.radio-label:has(input:focus-visible) { outline: 3px solid var(--color-focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    .radio-label { transition: none; }
}
.modal-content { max-height: calc(100dvh - 2rem); overflow-y: auto; }

/* Dashboard: las tarjetas ocupan su columna incluso después de desbloquear. */
.dashboard-body .container-dashboard {
    padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 3rem);
}
.dashboard-title {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.2;
    letter-spacing: -0.035em;
    color: #242424;
    margin-bottom: 2rem;
}
.dashboard-courses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
}
.dashboard-courses .card {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: clamp(1.25rem, 3vw, 2rem);
    overflow-wrap: anywhere;
}
.dashboard-courses .card-activo { border-top: 3px solid var(--color-primary); }
.dashboard-courses .card-activo { background: linear-gradient(150deg, var(--color-blue-soft), #fff 65%); }
.dashboard-courses .card-activo:nth-child(2) { border-top-color: var(--color-teal); background: linear-gradient(150deg, var(--color-teal-soft), #fff 65%); }
.dashboard-courses .card-activo:nth-child(3) { border-top-color: var(--color-lavender); background: linear-gradient(150deg, var(--color-lavender-soft), #fff 65%); }
.dashboard-courses .card h3 { font-size: 1.2rem; line-height: 1.35; }
.dashboard-courses .card-desc { color: #606060; margin-bottom: 1.5rem; }
.dashboard-courses .card > .btn-estudio { margin-top: auto; }
.dashboard-courses .btn-start { padding: 0.9rem 1rem; }

/* Cuenta del dashboard: desplegable y ventanas de perfil. */
.profile-menu { position: relative; }
.profile-trigger { display: flex; align-items: center; gap: 12px; min-height: 52px; max-width: min(320px, 100%); padding: 6px 12px 6px 6px; border: 1px solid #ffffff45; border-radius: 10px; background: #ffffff0d; color: #fff; font: inherit; text-align: left; cursor: pointer; }
.profile-trigger:hover, .profile-trigger[aria-expanded="true"] { background: #ffffff1a; border-color: #ffffff80; }
.profile-trigger:focus-visible { outline-color: #e8eff5; }
.profile-avatar { flex: 0 0 38px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--color-blue-soft); color: var(--color-navy); font-size: .85rem; font-weight: 700; }
.profile-trigger-copy { min-width: 0; display: grid; gap: 2px; }
.profile-caption { color: #d0dfef; font-size: .6rem; font-weight: 600; letter-spacing: .12em; }
#usuario-nombre { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; font-size: .9rem; font-weight: 600; }
.profile-chevron { flex-shrink: 0; }
.profile-trigger[aria-expanded="true"] .profile-chevron { transform: rotate(180deg); }
.profile-dropdown { position: absolute; top: calc(100% + 12px); right: 0; z-index: 20; width: min(296px, calc(100vw - 32px)); padding: 8px; color: var(--color-ink); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; box-shadow: 0 18px 48px #29384633; }
.profile-dropdown[hidden], .profile-dialog section[hidden] { display: none; }
.profile-summary { display: flex; align-items: center; gap: 12px; padding: 12px 8px 16px; border-bottom: 1px solid var(--color-border); }
.profile-summary > div { min-width: 0; }
.profile-summary strong { display: block; font-size: .95rem; overflow-wrap: anywhere; }
.profile-summary p { color: var(--color-muted); font-size: .75rem; margin-top: 4px; }
.profile-links { display: grid; gap: 4px; padding: 8px 0; }
.profile-links button, .profile-signout { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 8px; color: var(--color-ink); background: transparent; font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.profile-links button > span { width: 20px; text-align: center; color: var(--color-primary); font-size: 1.15rem; }
.profile-links button:hover { background: var(--color-blue-soft); }
.profile-signout { justify-content: space-between; color: var(--color-error); border-top: 1px solid var(--color-border); border-radius: 0 0 8px 8px; }
.profile-signout:hover { background: #fff0f0; }
.profile-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: clamp(20px, 5vw, 32px); overflow-y: auto; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); color: var(--color-ink); color-scheme: light; box-shadow: 0 24px 80px #29384633; }
.profile-dialog::backdrop { background: #22303db3; }
.profile-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.profile-dialog h2 { font-size: 1.45rem; letter-spacing: -.03em; }
.profile-dialog .eyebrow { margin-bottom: 6px; }
.profile-close { flex-shrink: 0; width: 44px; height: 44px; border: 1px solid var(--color-border); border-radius: 12px; color: var(--color-muted); background: var(--color-bg); font-size: 1.7rem; cursor: pointer; }
.profile-close:hover { background: var(--color-blue-soft); }
.profile-intro { color: var(--color-muted); line-height: 1.6; font-size: .9rem; }
.profile-help { color: var(--color-muted); line-height: 1.5; font-size: .78rem; margin-top: 8px; }
.profile-dialog input[readonly] { color: var(--color-muted); background: var(--color-bg); }
.profile-dialog .btn-submit { margin-top: 24px; }
.profile-status { display: inline-block; padding: 6px 10px; border-radius: 8px; background: var(--color-teal-soft); color: var(--color-teal); font-size: .8rem; font-weight: 600; margin-bottom: 16px; }
#panel-facturacion h3 { margin-bottom: 12px; }
.profile-setting { display: flex; align-items: center; gap: 16px; padding: 16px; margin-top: 16px; border: 1px solid var(--color-border); border-radius: 12px; cursor: pointer; }
.profile-setting > span { flex: 1; }
.profile-setting strong { font-size: .9rem; }
.profile-setting span span { display: block; color: var(--color-muted); font-size: .8rem; line-height: 1.5; margin-top: 4px; }
.profile-setting input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--color-primary); }
.profile-message { color: var(--color-teal); font-size: .85rem; line-height: 1.5; }
.profile-message:not(:empty) { margin-top: 16px; }
.profile-message.is-error { color: var(--color-error); }
.reduced-dashboard-motion *, .reduced-dashboard-motion *::before, .reduced-dashboard-motion *::after { animation: none !important; transition: none !important; }
.reduced-dashboard-motion .dashboard-courses .card:hover { transform: none; }
@media (max-width: 600px) {
    .dashboard-body > header nav[aria-label="Mi cuenta"] { width: auto; margin-left: auto; max-width: 100%; }
    .profile-trigger { max-width: 100%; }
    #usuario-nombre { max-width: 170px; }
}

@media (max-width: 600px) {
    header { padding: 1rem; gap: 1rem; }
    header nav { width: 100%; }
    header nav ul { justify-content: space-between; gap: 0.5rem 1rem; }
    .dashboard-body header .logo { font-size: 1.375rem; }
    .dashboard-body .dashboard-title { margin-bottom: 1.5rem; }
    .dashboard-courses { gap: 1rem; }
    .modal-content { padding: 1.5rem; }
    .exam-header { flex-wrap: wrap; gap: 1rem; }
}

/* =========================================================================
   10. EXPERIENCIA ASJ03: portada, panel y espacio de estudio
   ========================================================================= */
.skip-link { position: absolute; top: 8px; left: 16px; z-index: 2000; padding: 12px 16px; background: white; color: var(--color-navy); border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.brand-link { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; white-space: nowrap; font-size: 1.75rem; }
/* Logotipo KAPTAN (K de franjas y letras con cortes), del mismo color que el texto del header. */
.brand-logo { display: block; flex: none; height: 26px; width: auto; aspect-ratio: 790 / 100; fill: currentColor; }
.brand-code { font-weight: 400; opacity: .8; }
.landing-body, .dashboard-body, .study-body { background: #f5f7fa; }
:is(.landing-body, .dashboard-body, .study-body) > header { padding: 20px max(24px, calc((100% - 1184px) / 2)); background: #293846; border-bottom: 1px solid #3f4f60; }
header .btn-login { color: #293846; background: #e5ebf1; border: 0; padding: 12px 20px; font-weight: 700; cursor: pointer; }
header .btn-login:hover { background: #fff; }
.eyebrow { font-size: .72rem; font-weight: 750; letter-spacing: .14em; color: var(--color-primary); margin-bottom: 12px; }
.landing-body .hero { max-width: 1280px; margin: auto; padding: 80px 48px 72px; display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 64px; text-align: left; background: transparent; }
.hero-copy { min-width: 0; }
.landing-body .hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.7rem); font-weight: 750; letter-spacing: -.055em; line-height: 1.09; color: #293846; margin: 16px 0 24px; }
.hero h1 span { color: #4c688d; }
.hero-description { font-size: 1.08rem; color: var(--color-muted); line-height: 1.8; max-width: 510px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 28px 0 16px; }
.action-primary, .action-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 48px; border-radius: 10px; padding: 14px 20px; text-decoration: none; font-weight: 650; cursor: pointer; }
.action-primary { background: #3d5268; color: white; border: 1px solid #3d5268; }
.action-primary:hover { background: #293846; }
.action-secondary { color: #344e70; border: 1px solid #cbd5e3; background: transparent; }
.action-secondary:hover { background: #e6edf7; }
.hero-caption { font-size: .77rem; color: #5a687b; }
.flight-plan { position: relative; padding: 28px; border: 1px solid #445668; border-radius: var(--radius-panel); color: #fff; background: linear-gradient(145deg, #34495c, #293846); box-shadow: 0 24px 48px -30px #29384680; }
.flight-plan-top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: .7rem; letter-spacing: .08em; color: #c4d6ee; }
.plan-indicator { color: #d8f1e5; border: 1px solid #5b7e75; border-radius: 30px; padding: 4px 10px; letter-spacing: 0; }
.flight-route { display: flex; align-items: center; gap: 16px; padding: 36px 0 28px; font-size: .65rem; letter-spacing: .12em; color: #c4d6ee; }
.route-line { flex: 1; text-align: center; font-size: 30px; line-height: .1; border-bottom: 1px dashed #8da7c9; color: #fff; }
.flight-plan h2 { font-size: 1.45rem; letter-spacing: -.025em; }
.flight-plan > p { color: #c4d6ee; font-size: .86rem; margin-top: 8px; }
.plan-steps { list-style: none; padding: 0; margin-top: 24px; }
.plan-steps li { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid #3c536f; }
.plan-steps li > span { font-size: .75rem; color: #acc3e1; padding-top: 3px; font-variant-numeric: tabular-nums; }
.plan-steps strong { font-size: .93rem; font-weight: 600; }
.plan-steps p { font-size: .8rem; color: #c4d6ee; margin-top: 3px; }
.landing-body .exam-panel { max-width: 1280px; margin: auto; padding: 32px 48px 64px; text-align: left; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading h2, .method-panel h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.25; letter-spacing: -.035em; color: #293846; }
.section-heading > p { color: var(--color-muted); font-size: .88rem; }
.landing-body .grid-categorias { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0; }
.catalog-card { display: flex; flex-direction: column; width: auto; padding: 28px; border-radius: var(--radius-panel); box-shadow: none; border-top: 3px solid #52677d; }
.catalog-card:nth-child(2) { border-top-color: var(--color-teal); }
.catalog-card:nth-child(3) { border-top-color: var(--color-lavender); }
.catalog-card:nth-child(4) { border-top-color: var(--color-amber); }
.course-code { display: block; color: var(--color-primary); font-size: .7rem; font-weight: 750; letter-spacing: .12em; margin-bottom: 24px; }
.catalog-card h3 { font-size: 1.35rem; letter-spacing: -.025em; margin-bottom: 12px; color: var(--color-navy); }
.catalog-card > p { color: var(--color-muted); font-size: .9rem; line-height: 1.7; margin-bottom: 24px; }
.course-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-bottom: 24px; }
.course-tags span { border-radius: 6px; background: #f0f4f9; padding: 5px 8px; color: #53627a; font-size: .7rem; }
.catalog-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-top: 1px solid var(--color-border); background: transparent; color: #344e70; width: 100%; min-height: 50px; padding: 18px 0 0; text-align: left; font-weight: 700; font-size: .88rem; cursor: pointer; }
.catalog-entry:hover { color: #293846; text-decoration: underline; }
.method-panel { padding: 56px max(24px, calc((100% - 1184px) / 2)); background: #eaf0f6; border-top: 1px solid #d5ddeb; }
.method-panel > div > p:last-child { color: var(--color-muted); margin-top: 12px; }
.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 32px; }
.method-number { color: var(--color-primary); font-size: .75rem; font-weight: 700; }
.method-grid h3 { font-size: 1rem; color: #243b58; margin: 12px 0 8px; }
.method-grid p { color: var(--color-muted); font-size: .88rem; max-width: 320px; }
.landing-body footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px max(24px, calc((100% - 1184px) / 2)); background: #293846; text-align: left; font-size: .75rem; color: #c4d6ee; }
.footer-brand { font-weight: 700; letter-spacing: .1em; color: white; }
.landing-body footer a { color: #e5ebf1; padding: 10px 0; }
.modal-overlay { padding: 16px; backdrop-filter: blur(5px); }
.modal-content { max-width: 440px; }
.login-box .eyebrow { text-align: center; margin-top: 12px; }
#login-modal .modal-content { padding: 44px clamp(20px, 5vw, 40px) 28px; }
#login-modal .input-group { min-width: 0; }
#login-modal .input-group input { font-size: 1rem; }
#login-modal #btn-cerrar-login { top: 8px; right: 8px; width: 36px; height: 36px; line-height: 1; }
.dashboard-body .container-dashboard { max-width: 1280px; padding: 40px 48px 64px; }
.dashboard-section-heading h2 { font-size: 1.3rem; }
.dashboard-courses .card-activo { background: #fff; box-shadow: none; border-radius: var(--radius-panel); }
.dashboard-courses .card-activo:nth-child(2), .dashboard-courses .card-activo:nth-child(3) { background: #fff; }
/* Vigencia del acceso sobre el título, como texto simple: sin píldora ni indicador de color. */
.dashboard-courses .course-vigencia { color: var(--color-muted); font-size: .75rem; line-height: 1.25rem; min-height: 1.25rem; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
/* Con tarjetas lado a lado (2 × 280 px + separación y márgenes), la que no tiene fecha reserva su espacio
   si otra la muestra, para alinear los títulos. En una sola columna no hace falta y dejaría un hueco. */
@media (min-width: 632px) {
    .dashboard-courses:has(.course-vigencia:not([hidden])) .course-vigencia[hidden] { display: block; visibility: hidden; }
}
.dashboard-courses .card h3 { font-size: 1.4rem; letter-spacing: -.025em; color: #293846; }
.dashboard-courses .card-desc { font-size: .88rem; line-height: 1.7; color: var(--color-muted); }
.dashboard-courses .course-stat { border: 0; border-radius: 0; background: #f3f6fa; padding: 12px 14px; }
.dashboard-courses .course-summary dt { font-size: .75rem; }
.dashboard-courses .course-summary dd { font-size: 1rem; }
.dashboard-courses .btn-estudio { display: block; }
.dashboard-tip { display: flex; align-items: flex-start; gap: 20px; padding: 24px; border: 1px solid var(--color-border); border-radius: 10px; margin-top: 32px; }
.tip-symbol { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; color: var(--color-primary); background: #e0e9f6; font-size: 1.5rem; }
.dashboard-tip h2 { font-size: 1rem; margin-bottom: 6px; }
.dashboard-tip p { color: var(--color-muted); font-size: .85rem; }
.courses-empty { padding: 24px; border: 1px dashed var(--color-border); border-radius: 10px; }
.study-main { display: flex; justify-content: center; padding: 24px 32px; max-width: 1600px; }
.study-workspace { max-width: 1440px; width: 100%; min-width: 0; }
.study-heading { margin-bottom: 24px; }
.study-heading h1 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -.035em; color: #293846; }
.study-body .course-tabs { padding: 5px; display: inline-flex; background: #e5ebf3; border-radius: 12px; gap: 4px; }
.study-body .course-tabs button { border: 0; background: transparent; color: #40516a; }
.study-body .course-tabs button[aria-pressed="true"] { background: #fff; color: #293846; box-shadow: 0 2px 6px #29384610; }
.study-body #pantalla-modos { border-top: 3px solid var(--color-primary); }
.study-body .modos-container { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.study-body .modo-card { padding: 24px; border: 1px solid var(--color-border); border-radius: 10px; transition: background-color 150ms, border-color 150ms; }
.study-body .modo-card:hover { transform: none; border-color: var(--color-primary); box-shadow: none; }
.mode-number { display: block; font-size: .65rem; letter-spacing: .1em; color: #526680; margin-bottom: 24px; }
.study-body .modo-titulo { font-size: 1.35rem; color: #243b58; margin-bottom: 12px; }
.study-body .modo-desc { color: var(--color-muted); line-height: 1.7; }
.tema-btn { display: block; width: 100%; padding: 20px; margin-bottom: 12px; background: white; border: 1px solid var(--color-border); border-radius: 12px; font-size: 1rem; color: var(--color-navy); font-weight: 650; text-align: left; cursor: pointer; transition: background-color 150ms, border-color 150ms; }
.tema-btn:hover { border-color: var(--color-primary); background: var(--color-blue-soft); }
.config-section { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 12px; padding: 20px; margin-bottom: 24px; text-align: left; }
.config-title { margin: 0 0 16px; font-weight: 700; color: var(--color-navy); font-size: 1rem; border-bottom: 1px solid var(--color-border); padding-bottom: 8px; }
@media (max-width: 1000px) {
    .landing-body .hero { gap: 32px; padding: 56px 24px; }
    .landing-body .exam-panel { padding: 24px 24px 48px; }
    .dashboard-body .container-dashboard { padding: 32px 24px; }
    .catalog-card { padding: 24px; }
    .landing-body .grid-categorias { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .landing-body .hero { grid-template-columns: 1fr; padding-top: 40px; }
    .hero-description { max-width: 100%; }
    .flight-plan { padding: 24px; }
    .landing-body .grid-categorias, .method-grid { grid-template-columns: 1fr; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
    .method-grid { gap: 24px; }
    .method-grid article { border-top: 1px solid #cbd5e3; padding-top: 20px; }
    .method-grid p { max-width: none; }
    .landing-body footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
    :is(.landing-body, .dashboard-body, .study-body) > header { padding: 16px; gap: 16px; }
    header .brand-logo { height: 20px; }
    .landing-body header nav ul { gap: 8px; font-size: .8rem; }
    header .btn-login { padding: 10px 14px; }
    .landing-body .hero, .landing-body .exam-panel { padding-left: 16px; padding-right: 16px; }
    .hero-actions { align-items: stretch; flex-direction: column; }
    .hero-caption { font-size: .7rem; }
    .dashboard-body .container-dashboard { padding: 24px 16px; }
    .dashboard-body header nav ul { font-size: .8rem; }
    .dashboard-body header nav li:first-child { flex: 1; min-width: 0; }
    .dashboard-tip { padding: 20px; gap: 12px; }
    .study-main { padding: 24px 16px; }
    .study-body .modos-container { grid-template-columns: 1fr; }
    .mode-number { margin-bottom: 16px; }
}
/* Ambientación exclusiva de la portada. Estudio y simulacro conservan fondo liso. */
.landing-body .hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    max-width: none;
    padding-right: max(48px, calc((100% - 1184px) / 2));
    padding-left: max(48px, calc((100% - 1184px) / 2));
    padding-bottom: 88px;
    background: #2a3c4c;
}
.hero-sky { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.landing-body .hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(90deg, #22303deb 0%, #263746b8 52%, #26374680 100%);
}
.landing-body .hero h1 { color: #fff; }
.landing-body .hero h1 span { color: #c3dcf6; }
.landing-body .hero .eyebrow { color: #c3dcf6; }
.landing-body .hero-description { color: #e0eaf5; }
.landing-body .hero-caption { color: #d0dfef; }
.landing-body .hero .action-primary { color: #293846; background: #e8eff5; border-color: #e8eff5; }
.landing-body .hero .action-primary:hover { background: #fff; }
.landing-body .hero .action-secondary { color: #fff; border-color: #819bb6; background: #2a3c4c80; }
.landing-body .hero .action-secondary:hover { background: #42586b; }
.landing-body .flight-plan { background: #293846d9; border-color: #647e9b; }
.landing-body .hero-copy { animation: section-arrival 700ms ease-out both; }
.landing-body .flight-plan { animation: section-arrival 850ms ease-out both; }
.landing-body .section-arrived { animation: section-arrival 600ms ease-out both; }
.landing-body .catalog-card:nth-child(2).section-arrived { animation-delay: 70ms; }
.landing-body .catalog-card:nth-child(3).section-arrived { animation-delay: 140ms; }
.landing-body .catalog-card:nth-child(4).section-arrived { animation-delay: 210ms; }
:is(.landing-body .catalog-card, .dashboard-courses .card) { transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease; }
:is(.landing-body .action-primary, .landing-body .action-secondary, .landing-body .btn-login, .dashboard-body .btn-estudio) { transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease; }
.landing-body .action-primary:hover { box-shadow: 0 6px 24px #07132140; }
.landing-body .hero :is(a, button):focus-visible { outline-color: #e8eff5; }
@keyframes section-arrival { from { opacity: .65; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@media (hover: hover) and (pointer: fine) {
    :is(.landing-body .catalog-card, .dashboard-courses .card):hover { transform: translateY(-5px); box-shadow: 0 16px 32px -16px #29384640; }
}
@media (max-width: 1000px) {
    .landing-body .hero { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 600px) {
    .landing-body .hero { padding-left: 16px; padding-right: 16px; padding-bottom: 80px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    :is(.landing-body .catalog-card, .dashboard-courses .card):hover { transform: none; }
}

/* Lectura: aprovechar el ancho y mantener las acciones fuera del desplazamiento. */
.practice-question, .practice-answers { min-width: 0; overflow-wrap: anywhere; }
.practice-question:focus-visible, .practice-answers:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.study-body.question-active #titulo-modo-activo { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.study-body.question-active .study-heading { display: none; }
.study-body #aviso-guardado:empty { display: none; }
.study-body.question-active .study-main { padding-top: 12px; }
.study-body.question-active .exam-header { margin-bottom: 12px; padding-bottom: 8px; gap: 8px 16px; }
.study-body.question-active #btn-salir-estudio { margin-bottom: 0; }
.study-body.question-active .practice-card { background: #fff; border: 1px solid var(--color-border); border-radius: 10px; padding: 20px; }
.study-body.question-active .question-text { font-size: 1.125rem; line-height: 1.5; }
.study-body > header .course-tabs { margin-bottom: 0; width: auto; }
@media (min-width: 960px) {
    .study-body .modos-container { gap: 24px; }
    .study-body #contenedor-temas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .study-body .tema-btn { margin-bottom: 0; }
    .study-body.question-active > header { padding: 10px 32px; }
    .study-body.question-active .course-tabs { margin-bottom: 8px; }
    .study-body.question-active .practica-actions {
        grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr);
        grid-template-rows: 48px;
        grid-template-areas: 'back bookmark reveal next';
        gap: 12px;
        padding-top: 12px;
        margin-top: 12px;
    }
    .study-body.question-active #estado-marcador { height: 1.4em; margin-top: 6px; }
}
@media (min-width: 960px) and (min-height: 600px) {
    .study-body.question-active { height: 100dvh; display: flex; flex-direction: column; }
    .study-body.question-active > header { flex-shrink: 0; }
    .study-body.question-active .study-main { flex: 1; min-height: 0; width: 100%; padding-bottom: 16px; }
    .study-body.question-active .study-workspace { display: flex; flex-direction: column; min-height: 0; }
    .study-body.question-active .course-tabs { flex-shrink: 0; }
    .study-body.question-active #aviso-guardado { flex-shrink: 0; margin: 0 0 8px; }
    .study-body.question-active #pantalla-practica { display: flex !important; flex-direction: column; flex: 1; min-height: 0; }
    .study-body.question-active #btn-salir-estudio { flex-shrink: 0; }
    .study-body.question-active .exam-header { flex-shrink: 0; }
    .study-body.question-active .practice-card { flex: 1; height: auto; min-height: 0; }
    .study-body.question-active .practice-content { overflow-y: auto; scrollbar-gutter: stable; padding-right: 8px; }
}
@media (max-width: 959px) {
    .study-body.question-active .practice-card { height: clamp(490px, calc(100dvh - 260px), 900px); padding: 16px; }
    .study-body.question-active .study-main { padding-left: 12px; padding-right: 12px; }
    .study-body.question-active .practice-content { padding-right: 4px; }
    .study-body.question-active > header { padding: 8px 12px; gap: 8px; }
    .study-body.question-active > header nav { width: auto; margin-left: auto; }
    .study-body.question-active > header nav a { font-size: .8rem; }
}
@media (max-width: 600px) {
    .study-body > header .course-tabs { order: 3; width: 100%; }
    .study-body > header nav:not(.course-tabs) { width: auto; margin-left: auto; }
}

/* Compra de cursos (dashboard) y regreso desde Mercado Pago. */
.dashboard-store { margin-top: 2.5rem; }
.dashboard-courses .card-venta { border-top: 3px solid var(--color-amber); }
.venta-precio { margin: auto 0 1rem; font-size: 1.6rem; font-weight: 700; color: var(--color-navy); }
.venta-precio small { font-size: .85rem; font-weight: 500; color: var(--color-muted); white-space: nowrap; }
.card-venta .btn-estudio { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.card-venta .btn-estudio:disabled { opacity: .6; cursor: not-allowed; }
.pago-main { min-height: calc(100dvh - 80px); display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.pago-resultado { width: min(100%, 460px); padding: clamp(24px, 5vw, 40px); border: 1px solid var(--color-border); border-radius: 12px; background: #fff; text-align: center; box-shadow: 0 24px 80px #29384626; }
.pago-resultado h1 { font-size: clamp(1.3rem, 4vw, 1.7rem); margin: 4px 0 12px; color: var(--color-navy); }
.pago-resultado p:not(.eyebrow) { color: var(--color-muted); line-height: 1.6; }
/* `:not([hidden])`: «Volver al panel» no debe verse mientras se confirma el pago. */
.pago-resultado .btn-submit:not([hidden]) { display: block; margin-top: 24px; text-decoration: none; }
.estado-icono { width: 64px; height: 64px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.8rem; background: var(--color-blue-soft); color: var(--color-primary); }
.estado-icono.ok { background: var(--color-teal-soft); color: var(--color-teal); }
.estado-icono.error { background: #f9e7e7; color: var(--color-error); }

/* Panel maestro y registro. */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 20px 0 4px; border-radius: 12px; background: var(--color-bg); border: 1px solid var(--color-border); }
.auth-tabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--color-muted); font-weight: 600; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: #fff; color: var(--color-navy); box-shadow: 0 1px 4px #2938461f; }
/* Modo invitación: el servidor marca <html data-acceso="invitacion"> (ASJ_ACCESO, ver backend/produccion.py). */
.solo-invitacion { display: none; }
[data-acceso="invitacion"] .solo-invitacion { display: block; }
[data-acceso="invitacion"] .solo-publico { display: none !important; }
.nota-invitacion { margin: 12px 0 4px; }
.input-group .ayuda { color: var(--color-muted); font-size: .78rem; margin-top: 6px; line-height: 1.45; }
.input-group .error { color: var(--color-error); font-size: .78rem; margin-top: 6px; }
.input-group input[aria-invalid="true"] { border-color: var(--color-error); box-shadow: inset 3px 0 var(--color-error); }
.fuerza { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.fuerza span { height: 4px; border-radius: 2px; background: var(--color-border); }
.fuerza span.on { background: var(--color-teal); }
.check-legal { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; font-size: .85rem; color: var(--color-muted); line-height: 1.5; }
.check-legal input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.link-sutil { background: none; border: 0; padding: 0; color: var(--color-primary); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.correo-destacado { display: inline-block; margin: 8px 0 4px; padding: 6px 12px; border-radius: 8px; background: var(--color-bg); border: 1px solid var(--color-border); color: var(--color-ink) !important; font-weight: 600; overflow-wrap: anywhere; }
.pasos-mini { text-align: left; margin: 20px 0 0; padding: 16px 16px 16px 36px; border-radius: 12px; background: var(--color-bg); color: var(--color-muted); font-size: .85rem; line-height: 1.7; }
.select-group select, .input-group select, .input-group textarea { width: 100%; min-height: 44px; padding: .7rem; border: 1px solid #ccc; border-radius: 8px; background: #fff; color: #202020; font: inherit; }
.input-group textarea { min-height: 80px; resize: vertical; }
.adm-body { background: var(--color-bg); }
.adm-header-rol { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; background: #ffffff1a; border: 1px solid #ffffff45; color: #fff; }
.adm-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100dvh - 130px); }
.adm-nav { padding: 24px 12px; border-right: 1px solid var(--color-border); background: #fff; }
.adm-nav ul { list-style: none; display: grid; gap: 4px; }
.adm-nav button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--color-ink); font-size: .9rem; text-align: left; cursor: pointer; }
.adm-nav button:hover { background: var(--color-blue-soft); }
.adm-nav button[aria-current="page"] { background: var(--color-blue-soft); color: var(--color-navy); font-weight: 650; box-shadow: inset 3px 0 var(--color-primary); }
.adm-nav .ico { width: 20px; text-align: center; color: var(--color-primary); }
.adm-nav .contador { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--color-amber-soft); color: var(--color-amber); font-size: .72rem; font-weight: 700; text-align: center; }
.adm-nav .seccion { margin: 18px 12px 6px; font-size: .66rem; letter-spacing: .14em; color: var(--color-muted); font-weight: 700; }
.adm-main { padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 40px) 48px; min-width: 0; }
.adm-main h1 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); letter-spacing: -.03em; color: #293846; }
.adm-sub { color: var(--color-muted); font-size: .9rem; margin: 4px 0 24px; }
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: #fff; border: 1px solid var(--color-border); border-radius: 10px; padding: 16px 18px; }
.kpi span { display: block; color: var(--color-muted); font-size: .78rem; }
.kpi strong { display: block; font-size: 1.6rem; color: var(--color-navy); margin-top: 4px; }
.kpi.aviso { border-left: 3px solid var(--color-amber); }
.adm-filtros { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.adm-filtros input[type="search"] { flex: 1 1 260px; min-height: 44px; padding: 0 14px; border: 1px solid var(--color-border); border-radius: 10px; font: inherit; background: #fff; }
.adm-filtros select { min-height: 44px; padding: 0 12px; border: 1px solid var(--color-border); border-radius: 10px; font: inherit; background: #fff; color: var(--color-ink); }
.tabla-wrap { background: #fff; border: 1px solid var(--color-border); border-radius: 10px; overflow-x: auto; }
table.adm { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.adm th { text-align: left; padding: 12px 16px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); background: var(--color-bg); border-bottom: 1px solid var(--color-border); white-space: nowrap; }
table.adm td { padding: 12px 16px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
table.adm tr:last-child td { border-bottom: 0; }
table.adm tbody tr:hover { background: #fafbfe; }
.persona { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.persona .profile-avatar { flex-basis: 34px; width: 34px; height: 34px; font-size: .78rem; }
.persona small { display: block; color: var(--color-muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--color-teal-soft); color: var(--color-teal); }
.chip.pend { background: var(--color-amber-soft); color: var(--color-amber); }
.chip.off { background: #f9e7e7; color: var(--color-error); }
.chip.neutro { background: var(--color-blue-soft); color: var(--color-primary); }
.chip.rol-prog { background: var(--color-navy); color: #fff; }
.chip.rol-colab { background: var(--color-lavender-soft); color: var(--color-lavender); }
.chip.rol-user { background: var(--color-blue-soft); color: var(--color-primary); }
.btn-tabla { min-height: 36px; padding: 6px 12px; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; color: var(--color-navy); font: inherit; font-size: .82rem; cursor: pointer; white-space: nowrap; }
.btn-tabla:hover { background: var(--color-blue-soft); }
.btn-tabla.primario { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn-tabla.peligro { color: var(--color-error); }
.btn-tabla.peligro:hover { background: #fff0f0; }
td .motivo { display: block; margin-top: 4px; color: var(--color-muted); font-size: .76rem; white-space: nowrap; }
.ficha-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 24px; }
.ficha-cab .profile-avatar { flex-basis: 56px; width: 56px; height: 56px; font-size: 1.1rem; }
.ficha-cab h1 { margin: 0; }
.ficha-cab .adm-sub { margin: 2px 0 0; }
.ficha-cab .acciones { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.volver { display: inline-flex; margin-bottom: 16px; color: var(--color-primary); font-size: .85rem; }
.ficha-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ficha-grid > div { display: grid; gap: 20px; min-width: 0; }
.bloque { background: #fff; border: 1px solid var(--color-border); border-radius: 10px; padding: 18px 20px; min-width: 0; }
.bloque h2 { font-size: 1rem; color: var(--color-navy); display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.datos { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .86rem; }
.datos dt { color: var(--color-muted); }
.datos dd { overflow-wrap: anywhere; }
.curso-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 0; border-top: 1px solid var(--color-border); font-size: .87rem; }
.curso-fila:first-of-type { border-top: 0; }
.curso-fila .nombre { flex: 1 1 180px; min-width: 0; }
.curso-fila .nombre small { display: block; color: var(--color-muted); }
.curso-fila .acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.historial { list-style: none; display: grid; gap: 0; font-size: .84rem; }
.historial li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--color-border); }
.historial li:first-child { border-top: 0; }
.historial time { color: var(--color-muted); font-size: .78rem; }
.historial em { font-style: normal; color: var(--color-muted); }
.soporte-acciones { display: grid; gap: 8px; }
.soporte-acciones .btn-tabla { width: 100%; text-align: left; min-height: 44px; }
.adm-dialogo { position: relative; margin: 24px auto 0; max-width: 520px; background: #fff; border: 1px solid var(--color-border); border-radius: 12px; padding: clamp(20px, 4vw, 28px); box-shadow: 0 24px 80px #29384633; }
.adm-dialogo .fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.adm-dialogo .input-group { margin-top: 16px; }
.resumen-activacion { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--color-teal-soft); color: var(--color-teal); font-size: .85rem; line-height: 1.5; }
.tarjetas-revisor { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.tarjetas-revisor .bloque p { color: var(--color-muted); font-size: .86rem; line-height: 1.55; margin-bottom: 14px; }
.banner-revisor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-radius: 12px; background: var(--color-lavender-soft); color: var(--color-lavender); font-size: .85rem; margin-top: 16px; }
.banner-revisor strong { letter-spacing: .06em; font-size: .75rem; }
@media (max-width: 860px) {
    .adm-layout { grid-template-columns: 1fr; }
    .adm-nav { border-right: 0; border-bottom: 1px solid var(--color-border); padding: 8px 12px; overflow-x: auto; }
    .adm-nav ul { display: flex; gap: 4px; width: max-content; }
    .adm-nav .seccion { display: none; }
    .adm-nav button { white-space: nowrap; }
    .adm-nav button[aria-current="page"] { box-shadow: inset 0 -3px var(--color-primary); }
    .ficha-grid { grid-template-columns: 1fr; }
    .ficha-cab .acciones { margin-left: 0; }
}
@media (max-width: 520px) {
    .adm-dialogo .fila2 { grid-template-columns: 1fr; }
    .historial li { grid-template-columns: 1fr; gap: 2px; }
}

/* Registro, confirmación y recuperación de cuenta. */
.auth-fondo { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: linear-gradient(125deg, var(--color-blue-soft), var(--color-lavender-soft) 65%, var(--color-teal-soft)); }
.auth-tarjeta { width: min(100%, 460px); padding: clamp(24px, 5vw, 40px); border: 1px solid var(--color-border); border-radius: 12px; background: #fff; box-shadow: 0 24px 80px #29384626; }
.auth-centro { text-align: center; }
.auth-centro p:not(.eyebrow) { color: var(--color-muted); line-height: 1.6; font-size: .92rem; }
.auth-centro .btn-submit { display: block; text-decoration: none; margin-top: 20px; }
/* Enlaces con aspecto de botón en tarjetas de cuenta: bloque completo, salvo si están ocultos con `hidden`. */
.auth-tarjeta a.btn-submit:not([hidden]) { display: block; text-align: center; text-decoration: none; }
.auth-tarjeta .brand-link { color: var(--color-navy); display: inline-flex; margin-bottom: 20px; }
.auth-vista[hidden] { display: none !important; }
.fuerza-texto { min-height: 1.2em; }
.adm-body .adm-vista[hidden], .adm-escena[hidden] { display: none !important; }
.adm-dialogo { margin: auto; max-width: min(520px, calc(100% - 32px)); width: 100%; border: 1px solid var(--color-border); }
.adm-dialogo::backdrop { background: #1d2b3a66; backdrop-filter: blur(3px); }
.adm-mensaje { min-height: 1.4em; margin-top: 12px; font-size: .86rem; color: var(--color-teal); }
.adm-mensaje.is-error { color: var(--color-error); }
.adm-vacio { padding: 20px; color: var(--color-muted); font-size: .88rem; text-align: center; }
.adm-qr { display: block; width: 200px; height: 200px; margin: 16px auto; border: 1px solid var(--color-border); border-radius: 12px; background: #fff; padding: 8px; }
.adm-secreto { display: block; padding: 8px 10px; border-radius: 8px; background: var(--color-bg); font-family: ui-monospace, monospace; font-size: .82rem; overflow-wrap: anywhere; text-align: center; }
.adm-codigo { letter-spacing: .4em; text-align: center; font-size: 1.3rem; }
.pregunta-adm { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--color-border); font-size: .88rem; line-height: 1.55; }
.pregunta-adm:first-child { border-top: 0; }
.pregunta-adm ol { list-style: upper-alpha; padding-left: 22px; display: grid; gap: 4px; }
.pregunta-adm li.correcta { color: var(--color-teal); font-weight: 650; }
.pregunta-adm .meta { color: var(--color-muted); font-size: .78rem; }
.pregunta-adm img { max-width: 100%; height: auto; border: 1px solid var(--color-border); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.banner-revisor { margin: 0 auto 12px; max-width: 1200px; }
.profile-links a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 8px; color: var(--color-ink); font-size: .9rem; text-decoration: none; }
.profile-links a > span { width: 20px; text-align: center; color: var(--color-primary); font-size: 1.15rem; }
.profile-links a:hover { background: var(--color-blue-soft); }
/* Un enlace con `hidden` (p. ej., «Panel maestro» sin el rol) no debe reaparecer por el display de arriba. */
.profile-links a[hidden] { display: none; }
.adm-layout[hidden], .auth-fondo[hidden] { display: none !important; }
@media (max-width: 860px) { .adm-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; } }
.tabla-wrap { position: relative; }
