/* Tribunal27 · estilo institucional: azul marino, grises fríos e Inter en todo. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #1e3a5f;
  --brand-ink: #ffffff;
  --brand-soft: #eaf0f7;
  --accent: #2563eb;
  --ok: #166534;
  --ok-soft: #e7f5ec;
  --warn: #92400e;
  --warn-soft: #fdf3e2;
  --danger: #b91c1c;
  --danger-soft: #fdeeee;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --campo-borde: #b8c1cc;
  color-scheme: light; /* siempre en versión clara, aunque el sistema esté en modo oscuro */
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: clamp(1.55rem, 3.5vw, 2rem); line-height: 1.2; margin: 2rem 0 .5rem; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
small { color: var(--muted); font-weight: 400; }
a { color: var(--accent); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.lead { color: var(--muted); font-size: 1rem; margin-top: 0; max-width: 680px; }
[hidden] { display: none !important; }
.num, .crono, .nota-grande, .nota-media, .criterio-nota strong, .nota-miembro, .metricas span, .precio strong { font-variant-numeric: tabular-nums; }

/* Cabecera */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.logo .marca { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--brand); color: var(--brand-ink); font-size: .78rem; font-weight: 700; letter-spacing: 0; }
.logo small { font-weight: 500; font-size: .8rem; margin-left: 2px; }
.pasos { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; font-size: .82rem; counter-reset: p; flex-wrap: wrap; }
.pasos li { counter-increment: p; color: var(--muted); padding: 5px 10px; border-radius: 6px; font-weight: 500; }
.pasos li::before { content: counter(p) "  "; font-weight: 600; margin-right: 4px; }
.pasos li.activo { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.pasos li.hecho { color: var(--text); }

.banner { background: var(--brand-soft); color: var(--brand); border-bottom: 1px solid var(--line); padding: 8px 0; font-size: .87rem; }

/* Bloques */
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin: 16px 0; }
.aviso-privacidad { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--radius); padding: 14px 18px; font-size: .9rem; color: var(--muted); }
.aviso-privacidad strong { color: var(--text); }

/* Formularios */
label { display: block; font-weight: 500; font-size: .9rem; }
input, select, textarea { width: 100%; margin-top: 6px; font: inherit; font-size: .95rem; color: var(--text); background: #ffffff; border: 1.5px solid var(--campo-borde); border-radius: 6px; padding: 9px 12px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #8a96a3; }
::placeholder { color: #9aa3ad; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 58, 95, .18); }
textarea { resize: vertical; line-height: 1.55; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; margin: 18px 0; }

.zona-archivo { border: 1.5px dashed #c5cbd3; border-radius: var(--radius); padding: 28px 16px; text-align: center; cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s; }
.zona-archivo:hover, .zona-archivo.encima { border-color: var(--brand); background: var(--brand-soft); }
.zona-archivo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.zona-archivo.lleno { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }

.modalidad { border: 0; padding: 0; margin: 0 0 16px; }
.modalidad legend { font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.opcion { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.opcion:hover { border-color: #c5cbd3; }
.opcion:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opcion input { width: auto; margin: 4px 0 0; accent-color: var(--brand); }
.opcion > span:nth-of-type(1) { flex: 1; }
.minutos span { display: flex; align-items: center; gap: 8px; }
.minutos input { width: 90px; }
.nota-campo { display: block; margin: -6px 0 16px; }
.precio { flex: none; text-align: right; white-space: nowrap; }
.precio strong { display: block; font-size: 1rem; font-weight: 600; color: var(--text); }
.precio .ahorro { display: block; font-size: .74rem; color: var(--ok); white-space: normal; max-width: 140px; }

/* Botones */
.btn { font: 600 .95rem Inter, sans-serif; background: var(--brand); color: var(--brand-ink); border: 1.5px solid var(--brand); border-radius: 6px; padding: 11px 20px; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); transition: background .15s, box-shadow .15s; }
.btn:hover { background: #2a4d78; border-color: #2a4d78; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(30, 58, 95, .3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sec { background: #ffffff; color: var(--brand); border-color: var(--brand); box-shadow: none; }
.btn-sec:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn-peq { padding: 6px 12px; font-size: .85rem; }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.acciones.centro { justify-content: center; }
.error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: 6px; font-size: .92rem; }

/* Ficha de la programación */
.datos, .avisos { list-style: none; padding: 0; margin: 0 0 8px; }
.datos li { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.datos li:last-child { border-bottom: 0; }
.avisos li { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 8px 12px; margin-top: 8px; font-size: .9rem; }

/* Cronómetros */
.crono-tarjeta { text-align: center; }
.crono { font-size: clamp(3.4rem, 13vw, 5.5rem); font-weight: 600; letter-spacing: -.02em; line-height: 1; color: var(--text); }
.crono.aviso { color: var(--warn); }
.crono.fin { color: var(--danger); }
.crono-estado { color: var(--muted); margin: 8px 0 16px; font-size: .9rem; }
.barra { height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.barra div { height: 100%; width: 0; background: var(--brand); transition: width .5s linear; }
.mic { color: var(--muted); font-size: .87rem; margin: 12px 0 0; }
.mic.grabando::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; animation: latido 1.2s infinite; }
@keyframes latido { 50% { opacity: .25; } }
.provisional { color: var(--muted); font-style: italic; min-height: 1.5em; margin: 6px 0 0; }
.crono-peq { font-variant-numeric: tabular-nums; color: var(--muted); margin-left: auto; }
.contador { color: var(--muted); font-size: .87rem; margin: 6px 0 0; }
.contador.excede { color: var(--danger); font-weight: 600; }

/* Sorteo */
.opciones-sorteo { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.opcion-ud { display: flex; gap: 12px; align-items: center; text-align: left; font: 500 .95rem Inter, sans-serif; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, background .15s; }
.opcion-ud:hover { border-color: var(--brand); background: var(--brand-soft); }
.opcion-ud .num { flex: none; width: 36px; height: 36px; border-radius: 6px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 600; }

/* Turno de preguntas */
.tribunal .progreso { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-bottom: 12px; }
.pregunta-caja { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 6px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 600; }
.pregunta { font-size: 1.08rem; margin: 4px 0 0; line-height: 1.55; }

.velo { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 85%, transparent); display: grid; place-content: center; justify-items: center; z-index: 20; text-align: center; padding: 16px; color: var(--muted); }
.cargando { text-align: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: gira .9s linear infinite; margin: 0 auto 12px; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Informe */
.inf-cabecera { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.nota-grande { font-size: 3.2rem; font-weight: 600; color: var(--brand); line-height: 1; letter-spacing: -.03em; }
.nota-grande small { font-size: 1.05rem; color: var(--muted); letter-spacing: 0; }
.etiqueta-orientativa { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; font-size: .7rem; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.subnotas { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-top: 6px; }
.subnotas strong { color: var(--text); }
.descargo { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 12px; margin: 14px 0 0; }
.aviso-nota { background: var(--danger-soft); color: var(--danger); padding: 8px 12px; border-radius: 6px; font-size: .92rem; }
.ok { background: var(--ok-soft); color: var(--ok); padding: 8px 12px; border-radius: 6px; font-weight: 600; font-size: .92rem; }
.apartado-cab { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.nota-media { font-size: 1.5rem; font-weight: 600; color: var(--brand); }
.mini-barra { height: 4px; background: var(--surface-2); border-radius: 99px; margin: 6px 0 10px; overflow: hidden; }
.mini-barra div { height: 100%; background: var(--brand); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.cols ul { margin: 4px 0 0; padding-left: 18px; }
.cols li { margin-bottom: 4px; font-size: .93rem; }
.cols h4 { margin: 0 0 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.metricas div { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.metricas span { display: block; font-size: 1.1rem; font-weight: 600; }
.metricas small { display: block; line-height: 1.3; font-size: .8rem; }
.rubrica-tit { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; }
.rubrica-tit span { color: var(--brand); }
.criterio { border-top: 1px solid var(--line); padding: 10px 0; font-size: .93rem; }
.criterio summary { cursor: pointer; list-style: none; }
.criterio summary::-webkit-details-marker { display: none; }
.criterio summary > span:first-child::before { content: "›"; display: inline-block; width: 1em; color: var(--muted); font-weight: 600; transition: transform .15s; }
.criterio[open] summary > span:first-child::before { transform: rotate(90deg); }
.criterio-cab { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.criterio-nota { display: flex; gap: 10px; align-items: baseline; white-space: nowrap; }
.criterio-nota strong { font-size: 1rem; font-weight: 600; color: var(--brand); min-width: 2.2em; text-align: right; }
.criterio.no-eval { color: var(--muted); }
.rango { font-size: .78rem; color: var(--muted); }
.badge-subj { font-size: .68rem; font-weight: 600; letter-spacing: .03em; background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 1px 6px; vertical-align: 1px; }
.aspectos { list-style: none; padding: 0; margin: 8px 0; font-size: .9rem; }
.aspectos li { display: flex; gap: 8px; padding: 2px 0; }
.aspectos li span { flex: none; width: 1.2em; font-weight: 700; }
.aspectos .presente span { color: var(--ok); }
.aspectos .parcial span { color: var(--warn); }
.aspectos .ausente { color: var(--muted); }
.aspectos .ausente span { color: var(--danger); }
blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--line); color: var(--muted); font-style: italic; font-size: .9rem; }
.por-evaluador { display: grid; gap: 6px; font-size: .87rem; background: var(--surface-2); border-radius: 6px; padding: 10px 12px; }
.miembro { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.miembro p { margin: .3rem 0 0; font-size: .9rem; }
.nota-miembro { font-size: 1.1rem; font-weight: 600; color: var(--brand); }
.estado { font-size: .75rem; font-weight: 600; border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
.estado.cumple { background: var(--ok-soft); color: var(--ok); }
.estado.no-cumple { background: var(--danger-soft); color: var(--danger); }
.estado.no-verificable { background: var(--surface-2); color: var(--muted); }
.fila-formal { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; border-top: 1px solid var(--line); padding: 10px 0; font-size: .93rem; }
.fila-formal:first-of-type { border-top: 0; }
.norma { border-top: 1px solid var(--line); padding: 10px 0; font-size: .93rem; }
.norma:first-of-type { border-top: 0; }
.norma a { font-weight: 600; text-decoration: none; }
.norma a:hover { text-decoration: underline; }
.preg { border-top: 1px solid var(--line); padding: 12px 0; font-size: .93rem; }
.preg:first-of-type { border-top: 0; }
.preg .q { font-weight: 600; }
.mejorada { background: var(--brand-soft); border-radius: 6px; padding: 8px 12px; margin-top: 6px; }
.coste { font-size: .85rem; color: var(--muted); }

.pie { color: var(--muted); font-size: .8rem; padding-top: 24px; padding-bottom: 32px; text-align: center; }

@media print {
  .top, .banner, .pie, .acciones, .velo { display: none !important; }
  body { background: #fff; color: #000; }
  .tarjeta { box-shadow: none; break-inside: avoid; }
}

/* Beta: código y opinión */
.campo-codigo { margin-bottom: 18px; max-width: 320px; }
.escala { display: flex; gap: 6px; margin: 6px 0 16px; }
.escala label { flex: none; }
.escala input { position: absolute; opacity: 0; width: 1px; }
.escala span { display: grid; place-items: center; width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-weight: 600; }
.escala input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.escala input:focus-visible + span { outline: 2px solid var(--accent); }
#form-opinion > label { margin-top: 12px; }
.info-nota { background: var(--surface-2); color: var(--muted); padding: 8px 12px; border-radius: 6px; font-size: .9rem; }

/* Formulario: rejillas alineadas y bloques */
.rejilla { align-items: end; }
.rejilla-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .rejilla-2, .rejilla-3 { grid-template-columns: 1fr; } }
.campo-codigo { margin-top: 18px; }
.bloque { border: 0; border-top: 1px solid var(--line); padding: 16px 0 0; margin: 18px 0 0; min-width: 0; }
.bloque legend { font-weight: 600; font-size: .95rem; padding: 0 0 4px; }
.bloque .rejilla { margin: 8px 0 12px; }
.casilla-simple { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .92rem; margin: 6px 0 10px; cursor: pointer; }
.casilla-simple input { width: auto; margin: 3px 0 0; accent-color: var(--brand); flex: none; }
#form-config > .btn { margin-top: 12px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select { height: 40px; }

/* Versión clara con controles bien definidos */
.tarjeta { border-color: #dde2e8; }
.opcion { border: 1.5px solid #cfd6de; background: #ffffff; }
.opcion:hover { border-color: #8a96a3; }
.opcion:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.opcion input[type=radio], .opcion input[type=checkbox], .casilla-simple input { width: 18px; height: 18px; }
.zona-archivo { border: 2px dashed #9aa6b2; background: #f8fafc; }
.zona-archivo:hover, .zona-archivo.encima, .zona-archivo.lleno { border-color: var(--brand); background: var(--brand-soft); }
.opcion-ud { border: 1.5px solid #cfd6de; }
.escala span { border: 1.5px solid #cfd6de; background: #ffffff; }
.escala span:hover { border-color: #8a96a3; }
.bloque { border-top-color: #dde2e8; }

/* Marca Aprobaos (igual que la landing): logo, títulos en Plus Jakarta Sans, botones en píldora y CTA verde */
:root { --green: #15803d; --green-ink: #ffffff; --green-logo: #16a34a; --green-soft: #e7f5ec; }
h1, h2, h3 { font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; font-weight: 700; }
.marca-grupo { display: flex; align-items: baseline; gap: 10px; }
.logo { font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; text-decoration: none; color: var(--brand); }
.logo .os { color: var(--green-logo); }
.producto { font-size: .82rem; font-weight: 600; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.btn { border-radius: 999px; padding: 11px 22px; }
.btn-peq { padding: 6px 14px; }
.btn-green { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.btn-green:hover { background: #166534; border-color: #166534; }
.btn-green:focus-visible { box-shadow: 0 0 0 3px rgba(21, 128, 61, .3); }
.logo { display: inline; gap: 0; }
.etiqueta-lanzamiento { display: inline-block; margin-left: 8px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); vertical-align: 2px; }

/* Desplegables uniformes y accesibles */
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231e3a5f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
select:invalid { color: #8a939d; } /* «Elige…» en gris hasta que se elige algo */
select option, select optgroup { color: var(--text); }
.campo { display: flex; flex-direction: column; }
.campo > label { font-weight: 500; font-size: .9rem; }
.campo > input[hidden] { display: none; }
.campo > input { margin-top: 8px; }
.rejilla-2 { align-items: start; }
select:disabled { background-color: var(--surface-2); color: #9aa3ad; cursor: not-allowed; }

/* Exposición: aviso de examen, transcripción plegada y aviso de texto escrito */
.aviso-examen { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 12px 16px; font-size: .92rem; margin: 0 0 16px; }
.aviso-examen strong { color: inherit; }
.plegable > summary { cursor: pointer; font-weight: 600; font-size: .95rem; list-style: none; }
.plegable > summary::-webkit-details-marker { display: none; }
.plegable > summary::before { content: "›"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.plegable[open] > summary::before { transform: rotate(90deg); }
.plegable[open] > summary { margin-bottom: 10px; }
.aviso-escrito { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 8px 12px; font-size: .9rem; }

/* Avisos sonoros */
.campo-avisos { margin: 6px 0 4px; }
.campo-avisos > label { font-weight: 500; font-size: .9rem; }
.fila-avisos { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.fila-avisos select { flex: 1 1 260px; max-width: 360px; margin-top: 0; }
.campo-avisos .nota-campo { margin: 6px 0 12px; }
