/* =============================================================================================================
   Aspecto del examen teórico de la DGT para los tests (ZonaAlumno/Test y la corrección; en la app, Test y Resultado).
   Imita la pantalla del examen de verdad (simulador oficial de la sede de la DGT): letra Arial, barra de datos
   arriba, imagen a la izquierda sobre gris, número de la pregunta grande en azul, enunciado en negrita, respuestas
   con círculos A/B/C (amarillo al marcar; verde o rojo al corregir), botones claros «◀ / SIGUIENTE ▶ / FINALIZAR
   TEST», casillas 01–30 y la barra de leyenda o de resultado. En el móvil se apila y se agranda lo que se toca.
   ⚠️ La app (AutoescuelaApp/wwwroot/examen-dgt.css) tiene una copia: cambiar las dos.
   ============================================================================================================= */

.ex {
    --ex-azul: #134D7D;
    --ex-azul-claro: #0063A6;
    --ex-casilla: #6A93B7;
    --ex-fondo: #F5F3F3;
    --ex-panel: #F1F1F1;
    --ex-gris: #E9E9E9;
    --ex-borde: #CACACA;
    --ex-amarillo: #F2C400;
    --ex-verde: #3AA935;
    --ex-rojo: #E1343B;
    font-family: Arial, Helvetica, sans-serif;
    color: #000;
    background: #fff;
    border: 1px solid #DCDCDC;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
    margin-bottom: 1rem;
}

/* ---- Barra de datos de arriba ---- */
.ex-cabecera {
    display: grid;
    grid-template-columns: 1fr auto auto;
    background: #fff;
    border-bottom: 1px solid #E2E2E2;
    font-size: 12px;
    font-weight: bold;
    color: var(--ex-azul-claro);
}
.ex-cabecera > div {
    padding: 8px 10px;
    border-left: 1px solid #E2E2E2;
    display: flex;
    align-items: center;
    gap: .35rem;
    min-height: 34px;
}
.ex-cabecera > div:first-child { border-left: 0; display: block; }
.ex-cabecera .ex-dato { white-space: nowrap; }
.ex-cabecera .ex-dato { color: var(--ex-azul); }
.ex-reloj { font-size: 16px; color: var(--ex-azul); font-variant-numeric: tabular-nums; }
.ex-reloj.ex-poco { color: var(--ex-rojo); }
.ex-marcar {
    border: 1px solid var(--ex-borde);
    background: linear-gradient(#fff, #EDECE6);
    border-radius: 4px;
    font: bold 12px Arial, Helvetica, sans-serif;
    color: #4D4D4D;
    padding: 4px 8px;
}
.ex-marcar.ex-on { background: #FFF3BF; border-color: var(--ex-amarillo); }

/* ---- Cuerpo: imagen a la izquierda, pregunta a la derecha ---- */
.ex-cuerpo { display: flex; min-height: 340px; }
.ex-imagen {
    flex: 0 0 33%;
    background: var(--ex-panel);
    border-right: 1px solid #E2E2E2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.ex-imagen img {
    width: 100%;
    max-width: 340px;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    border: 6px solid #E4E4E4;
    border-radius: 6px;
    background: #fff;
}
.ex-pregunta { flex: 1 1 auto; padding: 14px 18px 12px 18px; display: flex; flex-direction: column; min-width: 0; }
.ex-enunciado { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.ex-num { font-size: 43px; font-weight: bold; color: var(--ex-azul); line-height: 1; flex: 0 0 auto; padding-top: 4px; }
.ex-texto { font-size: 20px; font-weight: bold; line-height: 1.5; padding-top: 2px; }

/* ---- Respuestas ---- */
.ex-respuestas { display: flex; flex-direction: column; gap: 6px; padding-left: 4px; }
.ex-resp {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    background: none;
    border: 0;
    padding: 6px 6px;
    text-align: left;
    font: 19px/1.6 Arial, Helvetica, sans-serif;
    color: #000;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}
.ex-resp:hover:not(:disabled) { background: #F7F7F4; }
.ex-resp:disabled { cursor: default; color: #000; opacity: 1; }
.ex-resp:focus-visible { outline: 2px solid var(--ex-azul-claro); outline-offset: 2px; }
.ex-radio {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #E6E6E6;
    background: radial-gradient(circle at 50% 40%, #FDFDFD 0, #EDEDED 60%, #DADADA 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 17px;
    color: #C9C9C9;
    position: relative;
    margin-top: -4px;
}
/* Marcada: anillo amarillo con su señal. */
.ex-resp.ex-elegida .ex-radio { border-color: var(--ex-amarillo); background: #FFFBE6; color: transparent; }
.ex-resp.ex-elegida .ex-radio::after { content: "✓"; position: absolute; color: #8F8F8F; font-size: 24px; font-weight: bold; }
/* Corrección: la buena en verde; la elegida mala en rojo. */
.ex-resp.ex-buena .ex-radio { border-color: var(--ex-verde); background: #fff; color: transparent; }
.ex-resp.ex-buena .ex-radio::after { content: "✓"; position: absolute; color: var(--ex-verde); font-size: 24px; font-weight: bold; }
.ex-resp.ex-mala .ex-radio { border-color: var(--ex-rojo); background: #fff; color: transparent; }
.ex-resp.ex-mala .ex-radio::after { content: "✕"; position: absolute; color: var(--ex-rojo); font-size: 22px; font-weight: bold; }
/* Varias correctas: cuadros en vez de círculos. */
.ex-respuestas.ex-multiple .ex-radio { border-radius: 8px; }

.ex-aviso { font-size: 14px; color: #555; margin: 6px 0 0 4px; }
.ex-explicacion {
    margin: 12px 0 0 4px;
    padding: 10px 12px;
    border-left: 4px solid var(--ex-verde);
    background: #F2F9F1;
    font-size: 15px;
    line-height: 1.5;
}
.ex-explicacion.ex-fallo { border-left-color: var(--ex-rojo); background: #FDF2F2; }
.ex-explicacion strong { display: block; margin-bottom: 2px; }
.ex-duda { margin: 12px 0 0 4px; font-size: 14px; }

/* ---- Botones «◀ / SIGUIENTE ▶ / FINALIZAR TEST» ---- */
.ex-nav { display: flex; gap: 10px; margin-top: auto; padding-top: 18px; flex-wrap: wrap; }
.ex-btn {
    background: linear-gradient(#FFFFFF, #EDECE5);
    border: 1px solid #D2D2D2;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    font: bold 17px Arial, Helvetica, sans-serif;
    color: #4D4D4D;
    text-transform: uppercase;
    min-height: 52px;
    padding: 6px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.ex-btn:hover:not(:disabled) { background: linear-gradient(#FFFFFF, #E4E2D8); }
.ex-btn:disabled { opacity: .45; }
.ex-btn .ex-flecha { color: var(--ex-amarillo); font-size: 26px; text-shadow: 0 1px 0 #B58F00; }
.ex-btn.ex-ant { min-width: 88px; }
.ex-btn.ex-sig { min-width: 300px; }
.ex-btn.ex-fin { font-size: 14px; line-height: 1.15; text-align: left; }
.ex-btn.ex-fin .ex-flecha { font-size: 24px; }

/* ---- Casillas 01–30 ---- */
.ex-casillas {
    background: #F0F0F0;
    border-top: 1px solid #E2E2E2;
    padding: 26px 18px 22px;
    display: grid;
    grid-template-columns: repeat(15, 52px);
    gap: 10px;
    justify-content: center;
}
.ex-cas {
    width: 52px;
    height: 50px;
    border: 1px solid #C6C6C6;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    font: bold 22px Arial, Helvetica, sans-serif;
    color: var(--ex-casilla);
    position: relative;
    padding: 0;
}
.ex-cas.ex-contestada { background: #DADADA; }
.ex-cas.ex-acertada { background: #B8DFC2; }
.ex-cas.ex-fallada { background: #F4C7C9; }
.ex-cas.ex-actual { border: 2px solid #2E6CA4; box-shadow: 0 0 0 1px #2E6CA4 inset, 0 1px 3px rgba(0, 0, 0, .18); }
.ex-cas.ex-revisar::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    border: 6px solid transparent;
    border-top-color: var(--ex-amarillo);
    border-right-color: var(--ex-amarillo);
}

/* ---- Barra de abajo: leyenda o resultado ---- */
.ex-pie {
    background: var(--ex-gris);
    color: #696969;
    font: bold 12px Arial, Helvetica, sans-serif;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    align-items: center;
}
.ex-pie .ex-muestra { display: inline-block; width: 40px; height: 10px; border: 1px solid #BDBDBD; vertical-align: middle; margin-right: 6px; }
.ex-pie b { color: #000; }

/* ---- Ventana «¿Está seguro de que desea finalizar el examen?» ---- */
.ex-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}
.ex-modal[hidden] { display: none; }
.ex-modal-caja {
    background: #fff;
    max-width: 460px;
    width: 100%;
    border: 1px solid #CFCFCF;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
    padding: 26px 22px 20px;
}
.ex-modal-caja p { font-size: 18px; font-weight: bold; margin: 0 0 8px; }
.ex-modal-caja .ex-modal-detalle { font-size: 14px; font-weight: normal; color: #555; margin-bottom: 18px; }
.ex-modal-caja .ex-btn { min-width: 130px; margin: 0 6px; }

/* =============================================================================================================
   Variantes para el resto de la teórica (mismo aspecto, otro contexto):
   · .ex-incrustada: la pregunta de un juego o del trivial, dentro de su caja (sin sombra ni alto mínimo).
   · .ex-ficha: una pregunta suelta en una lista o una ficha (dudas, revisión, banco, correcciones), más pequeña.
   · .ex-categoria: la etiqueta de color de la categoría (trivial) en la barra de arriba.
   · .ex-etiqueta: notas pequeñas junto a una respuesta («tu respuesta», «1.ª prioridad»…).
   · .ex-oculta: respuesta que no le sale al alumno (tachada y gris).
   ============================================================================================================= */
.ex [hidden] { display: none !important; }
.ex-cabecera.ex-dos { grid-template-columns: 1fr auto; }
.ex-cabecera.ex-una { grid-template-columns: 1fr; }
.ex-categoria { display: inline-flex; align-items: center; gap: .4rem; color: #fff; border-radius: 3px; padding: 3px 9px; font-size: 13px; }
.ex-incrustada { box-shadow: none; margin-bottom: 0; }
.ex-incrustada .ex-cuerpo { min-height: 0; }
.ex-incrustada .ex-imagen { flex-basis: 38%; padding: 16px; }
.ex-incrustada .ex-imagen img { max-height: 260px; }
.ex-incrustada .ex-nav { padding-top: 14px; }
.ex-ficha { box-shadow: none; }
.ex-ficha .ex-cuerpo { min-height: 0; }
.ex-ficha .ex-imagen { flex-basis: 28%; padding: 14px; }
.ex-ficha .ex-imagen img { max-height: 200px; border-width: 4px; }
.ex-ficha .ex-pregunta { padding: 12px 14px 10px; }
.ex-ficha .ex-enunciado { gap: 12px; margin-bottom: 10px; }
.ex-ficha .ex-num { font-size: 30px; }
.ex-ficha .ex-texto { font-size: 17px; line-height: 1.45; }
.ex-ficha .ex-resp { font-size: 16px; line-height: 1.45; gap: 14px; padding: 4px 6px; }
.ex-ficha .ex-radio { width: 34px; height: 34px; font-size: 14px; margin-top: -3px; border-width: 2px; }
.ex-ficha .ex-resp.ex-elegida .ex-radio::after,
.ex-ficha .ex-resp.ex-buena .ex-radio::after { font-size: 19px; }
.ex-ficha .ex-resp.ex-mala .ex-radio::after { font-size: 17px; }
.ex-ficha .ex-explicacion, .ex-ficha .ex-duda { font-size: 14px; }
.ex-ficha .ex-resp:disabled, .ex-ficha div.ex-resp { cursor: default; }
.ex-etiqueta { display: inline-block; font: bold 11px Arial, Helvetica, sans-serif; margin-left: .5rem; padding: 2px 6px; border-radius: 3px; background: #EEE; color: #555; white-space: nowrap; vertical-align: middle; }
.ex-etiqueta.ex-e-buena { background: #E3F3E1; color: #22751F; }
.ex-etiqueta.ex-e-mala { background: #FBE3E4; color: #A8232A; }
.ex-etiqueta.ex-e-tuya { background: #FFF3BF; color: #6B5600; }
.ex-resp.ex-oculta > span:last-child { color: #8A8A8A; text-decoration: line-through; }
.ex-pie.ex-pie-claro { background: #F6F6F6; }
.ex-ficha div.ex-resp:hover { background: none; }
/* Una ficha estrecha (dos columnas, móvil): la imagen encima de la pregunta. */
.ex-ficha { container-type: inline-size; }
@container (max-width: 560px) {
    .ex-ficha .ex-cuerpo { flex-direction: column; }
    .ex-ficha .ex-imagen { flex: none; border-right: 0; border-bottom: 1px solid #E2E2E2; padding: 10px; }
}

/* Respuestas dentro de una tabla (Teorica/ImportarRevisar): el círculo pequeño, verde la correcta. */
.ex-mini { display: flex; gap: 6px; align-items: flex-start; font-family: Arial, Helvetica, sans-serif; margin-bottom: 3px; }
.ex-mini .ex-radio-mini { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #E6E6E6; background: #F4F4F4; font: bold 10px/16px Arial, Helvetica, sans-serif; text-align: center; color: #9A9A9A; }
.ex-mini.ex-buena { font-weight: bold; }
.ex-mini.ex-buena .ex-radio-mini { border-color: #3AA935; background: #fff; color: #3AA935; }

/* ---- Móvil y tablet pequeña ---- */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .ex-casillas { grid-template-columns: repeat(10, 52px); }
}

@media (max-width: 767.98px) {
    .ex { border-left: 0; border-right: 0; margin-left: -12px; margin-right: -12px; }
    .ex-cabecera { grid-template-columns: 1fr auto; font-size: 11px; }
    .ex-cabecera .ex-aspirante { display: none; }
    .ex-cuerpo { flex-direction: column; min-height: 0; }
    .ex-imagen { flex: none; border-right: 0; border-bottom: 1px solid #E2E2E2; padding: 12px; }
    .ex-imagen img { max-width: 260px; max-height: 220px; border-width: 4px; }
    .ex-pregunta { padding: 12px 12px 10px; }
    .ex-enunciado { gap: 10px; margin-bottom: 12px; }
    .ex-num { font-size: 32px; padding-top: 2px; }
    .ex-texto { font-size: 17px; line-height: 1.45; }
    .ex-resp { gap: 14px; font-size: 17px; line-height: 1.45; padding: 8px 4px; }
    .ex-radio { width: 38px; height: 38px; font-size: 15px; margin-top: -3px; }
    .ex-nav { gap: 8px; }
    .ex-btn { font-size: 15px; min-height: 50px; padding: 6px 10px; gap: 8px; }
    .ex-btn.ex-ant { min-width: 58px; flex: 0 0 auto; }
    .ex-btn.ex-sig { min-width: 0; flex: 1 1 auto; }
    .ex-btn.ex-fin { flex: 0 0 auto; font-size: 12px; }
    .ex-casillas { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; padding: 12px 8px; }
    .ex-cas { width: auto; height: 38px; font-size: 15px; }
    .ex-pie { font-size: 11px; gap: 4px 14px; }
    .ex-incrustada, .ex-ficha { margin-left: 0; margin-right: 0; border-left: 1px solid #DCDCDC; border-right: 1px solid #DCDCDC; }
    .ex-incrustada .ex-imagen img, .ex-ficha .ex-imagen img { max-height: 200px; }
    .ex-ficha .ex-num { font-size: 26px; }
    .ex-ficha .ex-texto { font-size: 16px; }
    .ex-ficha .ex-resp { font-size: 15px; gap: 12px; padding: 6px 4px; }
    .ex-ficha .ex-radio { width: 32px; height: 32px; }
}
