/* Identidad UPV (design system "UPV": tokens.json y components/bundle.css).
   Fuentes servidas por el propio servidor: no se envía nada a terceros. */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(/static/fuentes/inter-400.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(/static/fuentes/inter-600.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url(/static/fuentes/poppins-700.woff2) format("woff2"); }

:root {
  --gray-upv: #5b6770; --grey-upv-light: #5c6368; --grey-upv: #424a50; --grey-upv-dark: #3f4444;
  --red-dark: #d73333; --red-darkest: #a40e0e; --blue-darkest: #054d82;
  --grey-dark: #5b5b5b; --grey-medium: #cfcfcf; --grey-light: #f1f1f1; --grey-darkest: #363636;
  --black: #111111; --white: #ffffff; --template-dark: #262626;
  --surface: var(--white); --surface-alt: var(--grey-light); --ink: var(--black); --ink-muted: var(--grey-dark);
  --action: var(--red-dark); --action-hover: var(--red-darkest); --border: var(--grey-medium);
  --border-strong: var(--grey-upv-light); --focus: var(--grey-upv-dark);
  --font-display: "Poppins", "Inter", sans-serif; --font-sans: "Inter", Arial, sans-serif;
  --gap-xs: .5rem; --gap: 1rem; --logo-height: 52px; --header-separator: 64px; --border-radius: 24px;
  --box-shadow-sm: 0 2px 6px rgba(0,0,0,.15);
  /* estados (sin verde en la paleta UPV: correcto en gris oscuro con texto, error en rojo) */
  --ok-bg: var(--grey-upv-dark); --mal-bg: var(--red-dark);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--surface); font-family: var(--font-sans); font-size: 16px; line-height: 1.3; }
:focus-visible { outline: 2px dashed var(--focus); outline-offset: 3px; }

/* Cabecera (WebHeader, web de entidad: marca + línea vertical + nombre) */
.cabecera { display: flex; align-items: center; gap: 24px; min-height: 88px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cabecera .marca-upv { display: block; height: var(--logo-height); width: auto; }
.cabecera .sep { width: 1px; height: var(--header-separator); background: var(--border); }
.cabecera .entidad { font-size: 16px; font-weight: 600; color: var(--grey-upv); line-height: 1.2; }
.cabecera .entidad small { display: block; font-weight: 400; color: var(--ink-muted); font-size: 14px; margin-top: 2px; }
.cabecera .derecha { margin-left: auto; display: flex; gap: var(--gap-xs); flex-wrap: wrap; align-items: center; }
.miga { padding: 6px 24px; background: var(--grey-upv-dark); color: var(--white); font-size: 12px; min-height: 1.6em; }

.ind { padding: .2rem .7rem; border-radius: 99px; font-size: 12px; background: var(--grey-light); color: var(--ink); }
.ind.bien { background: var(--ok-bg); color: var(--white); }
.ind.bien::before { content: "✓ "; }
.ind.mal { background: var(--mal-bg); color: var(--white); }
.ind.mal::before { content: "✗ "; }

main { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.2; margin: 0 0 1rem; color: var(--ink); }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.2; }
p, li { font-size: 16px; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--red-dark); }
.oculto { display: none !important; }

/* Botones (Button) */
button { font-family: var(--font-sans); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 20px; border: 0; border-radius: 0; cursor: pointer; transition: all ease .3s .05s;
  background: transparent; color: var(--red-dark); box-shadow: inset 0 0 0 1px var(--red-dark); }
button:hover { background: var(--red-dark); color: var(--white); }
button.primario, button.peligro { background: var(--action); color: var(--white); box-shadow: none; font-size: 16px; padding: 16px 28px; }
button.primario:hover, button.peligro:hover { background: var(--action-hover); }
button.recurso { background: var(--grey-darkest); color: var(--white); box-shadow: none; }
button.recurso:hover { background: var(--red-darkest); }
button:disabled, button:disabled:hover { background: transparent; color: var(--grey-darkest); box-shadow: inset 0 0 0 1px var(--grey-darkest); cursor: not-allowed; opacity: .6; }

label { display: block; font-weight: 600; margin-top: .5rem; }
input[type=email], input[type=text], input[type=password], input[type=number], input[type=datetime-local], input:not([type]), textarea, select {
  font: inherit; padding: .6rem .7rem; width: 100%; max-width: 30rem; border: 1px solid var(--border-strong); border-radius: 0; display: block; margin: .3rem 0 1rem; background: var(--white); color: var(--ink); }
textarea { max-width: none; min-height: 8rem; }
label.check { display: flex; gap: .6rem; align-items: flex-start; margin: 1.2rem 0; font-weight: 400; }
label.check input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; }

/* Nota destacada */
.consentimiento, .destacado { background: var(--surface-alt); padding: 20px 24px; margin: 1rem 0; }
.consentimiento { white-space: pre-wrap; max-height: 18rem; overflow: auto; font-size: 14px; }
.destacado { font-size: 18px; line-height: 1.4; border-left: 4px solid var(--grey-upv-dark); }

.aviso { padding: 14px 18px; margin-bottom: 1rem; font-size: 16px; }
.aviso.alerta { background: var(--red-dark); color: var(--white); }
.aviso.alerta button { background: var(--white); color: var(--red-darkest); box-shadow: none; }
.aviso.info { background: var(--surface-alt); color: var(--ink); border-left: 4px solid var(--blue-darkest); }
.aviso button { margin-top: .7rem; display: block; }
.alerta { color: var(--red-dark); font-weight: 600; }
.ayuda { color: var(--ink-muted); font-size: 14px; }
.lista-pasos li { margin: 1.2rem 0; }
.estado { margin-left: .7rem; color: var(--grey-upv-dark); font-weight: 600; }

.panel { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
figure { margin: 0; }
video { width: 100%; background: var(--black); aspect-ratio: 16/9; object-fit: contain; display: block; }
figcaption { margin-top: .4rem; font-size: 14px; }
.chip { padding: .15rem .6rem; border-radius: 99px; font-size: 12px; margin-left: .3rem; }
.chip.bien { background: var(--ok-bg); color: var(--white); }
.chip.mal { background: var(--mal-bg); color: var(--white); }
.medidor { margin: 1.2rem 0 .3rem; }
.barra { height: .8rem; background: var(--grey-light); overflow: hidden; margin-top: .4rem; }
.barra.grande { height: 1.2rem; }
.barra > div { height: 100%; width: 0; background: var(--grey-upv-dark); transition: width .2s; }

/* Identificación */
.dni-zona { position: relative; }
.marco { position: absolute; border: 3px dashed var(--white); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); pointer-events: none; }
.marco.ok { border-style: solid; border-color: var(--white); box-shadow: 0 0 0 9999px rgba(0,0,0,.25), 0 0 0 6px var(--grey-upv-dark); }
.guia { position: absolute; left: 0; right: 0; bottom: 1rem; text-align: center; color: var(--white); font-family: var(--font-display); font-weight: 700; font-size: 20px; text-shadow: 0 1px 4px #000; }
#dni-foto { max-width: 100%; border: 1px solid var(--border); display: block; margin-bottom: 1rem; }
.vista { max-height: 50vh; margin-bottom: 1rem; }
.cuenta { color: var(--ink-muted); margin-left: .7rem; }

.resultado { padding: 0; }
.resultado li { margin: .6rem 0; padding: .7rem 1rem; list-style: none; }
.resultado li.bien { background: var(--surface-alt); border-left: 4px solid var(--grey-upv-dark); }
.resultado li.bien::before { content: "✓ "; font-weight: 700; }
.resultado li.mal { background: var(--surface-alt); border-left: 4px solid var(--red-dark); }
.resultado li.mal::before { content: "✗ "; color: var(--red-dark); font-weight: 700; }

/* Ventana flotante del examen */
.flotante { display: flex; flex-direction: column; gap: .6rem; height: 100vh; padding: .7rem; font-family: var(--font-sans); font-size: 14px; background: var(--white); color: var(--ink); }
#hueco-flotante .flotante { height: 26rem; border: 1px solid var(--border); max-width: 28rem; margin-top: 1rem; }
.f-estado { display: flex; align-items: center; gap: .5rem; }
.punto { width: .75rem; height: .75rem; border-radius: 50%; background: var(--red-dark); display: inline-block; }
.f-chat { flex: 1; display: flex; flex-direction: column; border: 1px solid var(--border); min-height: 8rem; }
.f-mensajes { flex: 1; overflow: auto; padding: .5rem; }
.f-mensajes p { margin: .25rem 0; font-size: 14px; }
.m-vig { font-weight: 600; color: var(--blue-darkest); }
.f-form { display: flex; gap: .3rem; padding: .3rem; border-top: 1px solid var(--border); }
.f-form input { margin: 0; flex: 1; max-width: none; }
.f-form button { padding: 8px 12px; font-size: 12px; }
.flotante .f-fin { font-size: 14px; padding: 12px; }

/* Pie */
.pie { margin-top: 3rem; padding: 1.2rem 24px; border-top: 1px solid var(--border); color: var(--ink-muted); font-size: 12px; }

@media (max-width: 700px) {
  .panel { grid-template-columns: 1fr; }
  .cabecera { padding: 10px 16px; }
  .cabecera .sep { display: none; }
}

/* resultado de la prueba: avisos que no impiden el examen */
.resultado li.aviso-leve { background: var(--surface-alt); border-left: 4px solid var(--grey-upv-dark); }
.resultado li.aviso-leve::before { content: "! "; font-weight: 700; }
/* botón con aspecto de enlace (acciones secundarias dentro de un texto) */
button.enlace { background: none; box-shadow: none; border: 0; padding: 0; color: var(--red-dark); text-decoration: underline; font: inherit; cursor: pointer; min-height: 0; }
.dni-saltar { margin-top: 1rem; font-size: 15px; }
.botones { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* normas del examen: la principal, en letra muy grande */
.norma-principal { font-family: Poppins, Inter, sans-serif; font-weight: 700; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.25;
  color: var(--red-dark); border-left: 8px solid var(--red-dark); padding: .6rem 0 .6rem 1.2rem; margin: 1.2rem 0 1.6rem; }
.normas-resto { font-size: 17px; line-height: 1.6; margin-bottom: 1.6rem; }

/* ventana flotante: mensaje nuevo del vigilante sin leer */
@keyframes parpadeo-mensaje { 0%, 100% { box-shadow: inset 0 0 0 6px var(--red-dark); background: #fff3f3; } 50% { box-shadow: inset 0 0 0 6px transparent; background: var(--white); } }
.flotante.mensaje-nuevo { animation: parpadeo-mensaje 0.9s ease-in-out infinite; }
.flotante.mensaje-nuevo::before { content: "Mensaje nuevo del vigilante: léelo abajo"; display: block; background: var(--red-dark); color: var(--white); font-weight: 700; padding: .4rem .6rem; text-align: center; }
.flotante .f-mirada { background: #fff4cc; border-left: 4px solid #b58100; padding: .4rem .6rem; font-weight: 600; }
@keyframes parpadeo-mirada { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.flotante .f-mirada.parpadeo { animation: parpadeo-mirada .6s ease-in-out infinite; font-size: 16px; }
