/* Misma identidad que el kiosco: verde y dorado del escudo real. */
:root {
  --bg: #F7F7F3;
  --primario: #1B6B45;
  --primario-hover: #134F33;
  --primario-suave: #E1EFE6;
  --radio-hover: #EEF6F1;
  --radio-borde: #A9A9A0;
  --acento: #D99A1F;
  --acento-hover: #B87F15;
  --acento-suave: #F6E7C8;
  --exito: #1FAA69;
  --exito-suave: #E3F6EC;
  --info: #2E6FED;
  --info-suave: #E3ECFD;
  --alerta: #C77E00;
  --alerta-suave: #FDF1DC;
  --peligro: #E5484D;
  --peligro-suave: #FBE6E7;
  --texto: #1C1C1A;
  --texto-suave: #6B6B63;
  --borde: #E4E4DE;
  --zoom: 1;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--texto);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

button { font: inherit; }

.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

/* ---------- Panel lateral ---------- */
.lateral {
  flex: 0 0 36%;
  background: var(--primario);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 40px;
  box-shadow: inset -14px 0 18px -14px rgba(0, 0, 0, .45);
  text-align: center;
}

.app.en-examen .lateral { display: none; }

.escudo {
  width: min(260px, 32vh);
  height: auto;
  display: block;
  margin: 0 auto 28px;
}

.colegio { font-size: 24px; font-weight: 700; margin: 0; }
.proceso { font-size: 13px; font-weight: 700; color: var(--acento-suave); margin: 4px 0 30px; letter-spacing: .02em; }
.lema { font-size: clamp(18px, 2.4vw, 30px); font-weight: 700; margin: 0; text-transform: uppercase; line-height: 1.2; }
.lema .resaltado { color: var(--acento); }
.lema-sub { font-size: 15px; color: var(--acento-suave); margin: 10px auto 0; max-width: 34ch; line-height: 1.45; }

/* ---------- Contenido ---------- */
.contenido {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.barra-acento { height: 8px; background: var(--acento); flex: none; }

.pantalla {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

/* ---------- Pasos ---------- */
.pasos {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 28px 40px 0;
  flex-wrap: nowrap;
}
.paso { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--texto-suave); white-space: nowrap; }
.paso .circulo {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--borde); color: var(--texto-suave); font-weight: 700;
}
.paso.hecho { color: var(--texto); }
.paso.hecho .circulo { background: var(--primario); color: #fff; }
.paso.actual { font-weight: 700; }
.conector { width: 28px; height: 2px; background: var(--borde); flex: none; }
.conector.hecho { background: var(--primario); }

/* ---------- Bloques centrados ---------- */
.centro {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.titulo-grande { font-size: 38px; font-weight: 700; margin: 0 0 14px; }
.subrayado { width: 64px; height: 5px; border-radius: 3px; background: var(--acento); margin: 0 auto 18px; }
.bajada { font-size: 16px; color: var(--texto-suave); margin: 0 0 36px; }

.campo-cedula {
  width: min(380px, 100%);
  height: 60px;
  font-size: 21px;
  text-align: center;
  border: 2px solid var(--borde);
  border-radius: 16px;
  background: #fff;
  color: var(--texto);
  outline: none;
  letter-spacing: .04em;
}
.campo-cedula:focus { border-color: var(--primario); box-shadow: 0 0 0 4px var(--primario-suave); }

.mensaje { min-height: 22px; font-size: 14px; margin: 12px 0; }
.mensaje.error { color: var(--peligro); }
.mensaje.info { color: var(--texto-suave); }

/* ---------- Botones ---------- */
.btn {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 700;
  font-size: 18px;
  padding: 0 28px;
  height: 58px;
  min-width: 200px;
  transition: filter .15s, transform .05s, background-color .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--acento); outline-offset: 3px; }

.btn-degradado {
  color: #fff;
  background: linear-gradient(90deg, var(--primario), var(--acento));
}
.btn-degradado:hover:not(:disabled) { filter: brightness(1.08); }

.btn-primario {
  color: #fff;
  background: var(--primario);
  border-radius: 12px;
  font-size: 15px;
  height: 48px;
  min-width: 160px;
}
.btn-primario:hover:not(:disabled) { background: var(--primario-hover); }

.btn-contorno {
  color: var(--primario);
  background: transparent;
  border: 2px solid var(--primario);
  border-radius: 12px;
  font-size: 15px;
  height: 48px;
  min-width: 140px;
}
.btn-contorno:hover { background: var(--primario-suave); }

.btn:disabled {
  background: var(--borde);
  color: var(--texto-suave);
  cursor: not-allowed;
  filter: none;
}

.btn-ancho { width: min(380px, 100%); height: 60px; }

/* ---------- Pastillas y chips ---------- */
.pastilla {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--primario-suave);
  color: var(--primario);
  font-weight: 700;
  font-size: 15px;
}
.chips { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--borde); background: #fff;
  font-size: 14px; font-weight: 700; color: var(--texto);
}
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--color, var(--primario)); }

/* ---------- Fila de valores (pantalla de cédula) ---------- */
.valores {
  display: flex;
  justify-content: space-around;
  padding: 0 40px 32px;
  gap: 12px;
}
.valores span { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--texto-suave); }
.valores span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--color); }

/* ---------- Confirmación ---------- */
.nombre { font-size: 30px; font-weight: 700; margin: 0 0 14px; }
.slogan { font-size: 16px; font-weight: 700; color: var(--acento); margin: 10px 0 0; }
.logo-fondo {
  position: absolute;
  right: 0;
  bottom: 0;
  width: clamp(220px, 34vmin, 460px);
  opacity: .35;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Instrucciones ---------- */
.instrucciones {
  width: 82%;
  margin: 28px auto 24px;
}
.instrucciones h1 { font-size: 26px; margin: 0 0 16px; }
.instrucciones ol { list-style: none; padding: 0; margin: 0; }
.instrucciones li { display: flex; gap: 12px; align-items: flex-start; font-size: 18px; line-height: 1.4; margin: 0 0 12px; }
.instrucciones .num {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--primario-suave); color: var(--primario);
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.instrucciones .chips { justify-content: flex-start; margin: 20px 0 6px; }
.instrucciones .acciones { text-align: center; }

/* ---------- Examen ---------- */
.examen {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  /* Deja libre la esquina del escudo chico (20px + 104px) a ambos lados. */
  width: min(82%, calc(100% - 280px));
  margin: 0 auto;
  padding: 24px 0 24px;
}
.examen.con-calculadora { width: calc(100% - 160px); margin: 0 24px 0 136px; grid-template-columns: minmax(0, 1fr) 300px; }

.escudo-chico {
  position: absolute;
  top: 8px;
  left: 20px;
  width: 104px;
  height: auto;
}

.columna-pregunta { display: flex; flex-direction: column; min-height: 0; }

.barra-examen {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.barra-examen .espacio { flex: 1; }
.contador { font-size: 13px; color: var(--texto-suave); }

.timer {
  min-width: 90px;
  height: 36px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  padding: 0 12px;
}

.zoom { display: flex; align-items: center; gap: 4px; }
.zoom button, .btn-calc {
  height: 36px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.zoom button { width: 36px; background: var(--primario-suave); color: var(--primario); }
.zoom button:hover { background: var(--borde); }
.zoom span { width: 42px; text-align: center; font-size: 12px; font-weight: 700; color: var(--texto-suave); }
.btn-calc { padding: 0 16px; background: var(--acento); color: #fff; }
.btn-calc:hover { background: var(--acento-hover); }

/* Con la calculadora abierta no entra todo en la barra (igual que el kiosco). */
.con-calculadora .contador { display: none; }

.progreso { height: 8px; border-radius: 4px; background: var(--borde); overflow: hidden; margin-bottom: 24px; flex: none; }
.progreso div { height: 100%; background: var(--primario); border-radius: 4px; }

.cuerpo-pregunta {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-gutter: stable;
}
.cuerpo-pregunta::-webkit-scrollbar { width: 10px; }
.cuerpo-pregunta::-webkit-scrollbar-thumb { background: var(--borde); border-radius: 5px; }

.texto-pregunta {
  font-size: calc(20px * var(--zoom));
  font-weight: 700;
  line-height: 1.4;
  margin: 4px 0 22px;
  white-space: pre-line;
}
.figura { display: block; max-height: min(220px, 28vh); max-width: 100%; margin: 0 0 22px; }

.opciones { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; border: 0; }
.opcion {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 16px;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: calc(17px * var(--zoom));
  line-height: 1.4;
}
/* Hover claro y distinto de "marcada": con un hover oscuro los
   postulantes creían que el examen ya traía respuestas. */
.opcion:hover { background: var(--radio-hover); }
.opcion input {
  appearance: none;
  flex: none;
  width: 24px; height: 24px;
  margin: 1px 0 0;
  border: 2px solid var(--radio-borde);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  display: grid; place-items: center;
}
.opcion input::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--primario); transform: scale(0); transition: transform .1s; }
.opcion input:checked { border-color: var(--primario); }
.opcion input:checked::after { transform: scale(1); }
.opcion input:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }
.opcion:has(input:checked) { background: var(--primario-suave); border-color: var(--primario); }

.navegacion { display: flex; align-items: center; margin-top: 24px; flex: none; }
.navegacion .espacio { flex: 1; }
.navegacion .btn-degradado { height: 48px; font-size: 16px; }

/* ---------- Calculadora ---------- */
.calculadora {
  align-self: start;
  background: var(--bg);
  border: 1px solid var(--borde);
  border-radius: 16px;
  padding: 14px;
  margin-top: 52px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
}
.calculadora .cabecera { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--texto-suave); }
.calculadora .cerrar { border: 0; background: none; font-size: 16px; font-weight: 700; color: var(--texto-suave); cursor: pointer; padding: 4px 8px; }
.calculadora .pantalla-calc {
  background: #fff; border-radius: 10px; height: 56px; margin: 12px 0;
  display: flex; align-items: center; justify-content: flex-end; padding: 0 12px;
  font-size: 22px; font-weight: 700; overflow: hidden; white-space: nowrap; direction: rtl;
}
.calculadora .pantalla-calc span { direction: ltr; unicode-bidi: bidi-override; }
.teclas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.teclas button {
  height: 44px; border-radius: 10px; border: 1px solid var(--borde);
  background: var(--primario-suave); color: var(--texto);
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.teclas button.digito { background: #fff; }
.teclas button.igual { background: var(--acento); color: #fff; border-color: var(--acento); }
.teclas button:hover { filter: brightness(.95); }

/* ---------- Pantallas finales ---------- */
.insignia {
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 40px; font-weight: 700;
  margin: 0 auto 20px;
}
.insignia-exito { background: var(--exito-suave); color: var(--exito); }
.insignia-alerta { background: var(--alerta-suave); color: var(--alerta); }
.insignia-error { background: var(--peligro-suave); color: var(--peligro); }
.final-titulo { font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.final-texto { font-size: 16px; color: var(--texto-suave); margin: 0 0 24px; max-width: 52ch; line-height: 1.45; }

.segunda-parte {
  background: var(--acento-suave);
  border-radius: 16px;
  padding: 20px 28px;
  margin: 16px 0 18px;
  max-width: 580px;
}
.segunda-parte h2 { font-size: 17px; margin: 0 0 6px; }
.segunda-parte p { font-size: 14px; color: var(--texto-suave); margin: 0 0 16px; line-height: 1.45; }
.segunda-parte a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-secundario {
  height: 44px; min-width: 260px; font-size: 14px;
  background: transparent; color: var(--primario); border: 2px solid var(--primario);
}
.btn-secundario:hover { background: var(--primario-suave); }

/* ---------- Avisos ---------- */
.toast {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--info-suave);
  color: var(--info);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 18px;
  z-index: 20;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

.velo {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 26, .45);
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 16px;
}
.velo[hidden], .toast[hidden] { display: none; }
.aviso-salida {
  background: #fff;
  border-radius: 20px;
  padding: 28px 32px;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
}
.aviso-salida h2 { font-size: 20px; margin: 0 0 8px; }
.aviso-salida p { color: var(--texto-suave); font-size: 15px; line-height: 1.45; margin: 0 0 20px; }

/* Pantallas bajitas (1024x768 con barras del navegador): se compacta. */
@media (max-height: 700px) {
  .escudo { width: min(200px, 26vh); margin-bottom: 16px; }
  .proceso { margin-bottom: 18px; }
  .titulo-grande { font-size: 32px; }
  .bajada { margin-bottom: 22px; }
  .instrucciones li { font-size: 16px; margin-bottom: 8px; }
  .pasos { padding-top: 18px; }
  .teclas button { height: 38px; }
  .calculadora .pantalla-calc { height: 46px; margin: 8px 0; }
  .calculadora { margin-top: 44px; }
  .opcion { padding: 9px 14px; }
}

@media (max-width: 800px) {
  .lateral { display: none; }
  .examen, .examen.con-calculadora { width: 100%; padding: 16px; grid-template-columns: 1fr; }
  .escudo-chico { display: none; }
  .instrucciones { width: 100%; padding: 0 16px; }
  .valores { display: none; }
}
