:root {
  --fondo: #F7F5F0;
  --superficie: #FFFFFF;
  --tinta: #1C2130;
  --sutil: #535A6B;
  --linea: #DEDBD2;
  --borde: #C3BFB4;
  --acento: #2E4BA0;
  --acento-oscuro: #223980;
  --acento-suave: #E7ECF8;
  --nota: #EFEDE6;
  --bien-fondo: #E2F2E8; --bien-tinta: #145233; --bien-barra: #2E9960;
  --atento-fondo: #FDF1D6; --atento-tinta: #6B4600; --atento-barra: #E0A21B;
  --mal-fondo: #FBE4E2; --mal-tinta: #8C1D17; --mal-barra: #C9372C;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  background: #E4E0D6;
  color: var(--tinta);
  font: 16px/1.45 'Atkinson Hyperlegible', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

button, input, textarea { font: inherit; color: inherit; }
a { color: var(--acento); }
h1, h2, .h2 { margin: 0; text-wrap: balance; }
h1 { font: 600 28px/1.15 'Fraunces', Georgia, serif; letter-spacing: -0.01em; }
h2, .h2 { font-size: 18px; font-weight: 700; }
p { margin: 0; }

.aviso-prototipo {
  width: 100%;
  padding: 8px 12px;
  background: #3D4354;
  color: #FFFFFF;
  font-size: 13px;
  text-align: center;
}
.i-muestra {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: #FFFFFF; color: #3D4354; font-weight: 700; font-size: 12px;
}

.telefono {
  width: 100%;
  max-width: 430px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
}
@media (min-width: 600px) {
  .telefono { margin-top: 20px; flex: none; height: 820px; border-radius: 28px; overflow: hidden; box-shadow: 0 20px 50px rgba(28, 33, 48, .18); }
}

.barra-app {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: var(--superficie);
  border-bottom: 1px solid var(--linea);
}
.marca-app { font: 600 20px 'Fraunces', Georgia, serif; color: var(--tinta); text-decoration: none; }
.hoy { font-size: 13px; color: var(--sutil); }
.hoy.simulado { background: var(--atento-fondo); color: var(--atento-tinta); padding: 2px 8px; border-radius: 999px; font-weight: 700; }

.vista {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 32px;
  display: flex; flex-direction: column; gap: 24px;
  outline: none;
}

.navegacion {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--superficie);
  border-top: 1px solid var(--linea);
}
.navegacion a {
  padding: 14px 4px; text-align: center;
  color: var(--sutil); text-decoration: none; font-size: 14px; font-weight: 700;
  border-top: 3px solid transparent;
}
.navegacion a[aria-current] { color: var(--acento); border-top-color: var(--acento); }

/* Utilidades */
.pila { display: flex; flex-direction: column; gap: 12px; }
.pila-4 { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.negrita { font-weight: 700; }
.sutil { color: var(--sutil); }
.chico { font-size: 14px; }
.bloque { display: block; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--acento); }
.garantia { font-weight: 700; color: var(--bien-tinta); }
.garantia::before { content: '🔒 '; }

.volver { font-weight: 700; text-decoration: none; margin-bottom: -12px; }

/* Listas de filas */
.lista-empresas, .lista-derechos, .lista-simple { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fila {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: 14px;
  color: inherit; text-decoration: none;
}
.fila:hover, .fila:focus-visible { border-color: var(--acento); }
.flecha { font-size: 24px; color: var(--acento); line-height: 1; }
.vacio { text-align: center; }
.lista-simple li { padding: 4px 0; }

/* Formularios */
input[type=search], input[type=text], input[type=email], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  background: var(--superficie);
}
input:focus, textarea:focus { outline: 3px solid var(--acento-suave); border-color: var(--acento); }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-weight: 700; }
.opciones { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.opciones legend { margin-bottom: 8px; }
.opcion {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: 12px;
}
.opcion input { margin-top: 3px; accent-color: var(--acento); width: 18px; height: 18px; flex: none; }
.opcion:has(input:checked) { border-color: var(--acento); background: var(--acento-suave); }

/* Botones */
.boton {
  display: inline-flex; justify-content: center; align-items: center;
  min-height: 48px; padding: 12px 18px;
  background: var(--acento); color: #FFFFFF;
  border: 0; border-radius: 12px;
  font-weight: 700; text-decoration: none; text-align: center;
  cursor: pointer;
}
.boton:hover { background: var(--acento-oscuro); }
.boton.secundario { background: var(--superficie); color: var(--acento); border: 1.5px solid var(--acento); }
.boton.secundario:hover { background: var(--acento-suave); }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.acciones .boton { flex: 1 1 140px; }
.enlace-peligro { background: none; border: 0; color: var(--mal-tinta); text-decoration: underline; cursor: pointer; align-self: flex-start; padding: 4px 0; }

/* Tarjetas y estados */
.tarjeta { padding: 16px; background: var(--superficie); border: 1px solid var(--linea); border-radius: 14px; }
.tono-bien { background: var(--bien-fondo); color: var(--bien-tinta); border-color: transparent; }
.tono-atento { background: var(--atento-fondo); color: var(--atento-tinta); border-color: transparent; }
.tono-mal { background: var(--mal-fondo); color: var(--mal-tinta); border-color: transparent; }
.tarjeta.tono-mal .boton { background: var(--mal-tinta); }

.chip { flex: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chip-bien { background: var(--bien-fondo); color: var(--bien-tinta); }
.chip-atento { background: var(--atento-fondo); color: var(--atento-tinta); }
.chip-mal { background: var(--mal-fondo); color: var(--mal-tinta); }
.chip-neutro { background: var(--nota); color: var(--sutil); }

.fila-titulo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

/* Reloj de plazo */
.reloj { padding: 18px 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 6px; }
.reloj .cifra { font: 600 44px/1 'Fraunces', Georgia, serif; }
.reloj .cifra span { font: 700 18px 'Atkinson Hyperlegible', sans-serif; }
.barra { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, .08); overflow: hidden; margin-top: 6px; }
.barra span { display: block; height: 100%; border-radius: inherit; }
.reloj.tono-bien .barra span { background: var(--bien-barra); }
.reloj.tono-atento .barra span { background: var(--atento-barra); }

.hitos { list-style: none; margin: 0; padding: 0 0 0 4px; display: flex; flex-direction: column; }
.hitos li {
  position: relative;
  display: grid; grid-template-columns: 104px 1fr; gap: 10px;
  padding: 0 0 14px 20px;
  border-left: 2px solid var(--linea);
}
.hitos li:last-child { border-left-color: transparent; padding-bottom: 0; }
.hitos li::before {
  content: ''; position: absolute; left: -7px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--fondo); border: 2px solid var(--borde);
}
.hitos li.pasado::before { background: var(--acento); border-color: var(--acento); }
.hito-fecha { font-size: 14px; font-weight: 700; color: var(--sutil); }

/* Textos legales */
details.tarjeta summary { cursor: pointer; }
details.tarjeta[open] summary { margin-bottom: 8px; }
.texto-legal {
  margin: 8px 0 0;
  padding: 14px;
  background: var(--nota);
  border-radius: 10px;
  font: 14px/1.5 'Atkinson Hyperlegible', sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Tablas */
.tabla-simple { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabla-simple th, .tabla-simple td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--linea); vertical-align: top; }
.tabla-simple th { font-weight: 400; color: var(--sutil); width: 48%; }
.tabla-envoltura { overflow-x: auto; background: var(--superficie); border: 1px solid var(--linea); border-radius: 14px; }
.tabla-indice { width: 100%; border-collapse: collapse; font-size: 15px; }
.tabla-indice th, .tabla-indice td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--linea); }
.tabla-indice th[scope=row], .tabla-indice thead th:first-child { text-align: left; font-weight: 400; }
.tabla-indice thead th { font-size: 13px; color: var(--sutil); }
.tabla-indice tbody tr:last-child > * { border-bottom: 0; }
.porcentaje { font-weight: 700; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.porcentaje.tono-bien { background: var(--bien-fondo); }
.porcentaje.tono-atento { background: var(--atento-fondo); }
.porcentaje.tono-mal { background: var(--mal-fondo); }

/* Notas «i» */
.con-nota { display: flex; align-items: center; gap: 8px; }
.con-nota.ancho > :first-child { flex: 1; }
.marca-nota {
  flex: none;
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--acento-suave); color: var(--acento);
  border: 1.5px solid var(--acento);
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.dialogo-nota { max-width: 360px; border: 0; border-radius: 18px; padding: 20px; display: none; }
.dialogo-nota[open] { display: flex; flex-direction: column; gap: 14px; }
.dialogo-nota::backdrop { background: rgba(28, 33, 48, .45); }

/* Controles del prototipo */
.simulador {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px;
  width: 100%; max-width: 430px;
  padding: 10px 12px;
  font-size: 13px; color: var(--sutil);
}
.simulador button { padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--sutil); background: transparent; cursor: pointer; font-size: 13px; }
.comentar { font-size: 14px; padding: 0 12px 20px; }

.aviso {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--tinta); color: #FFFFFF;
  padding: 10px 16px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.navegacion { position: sticky; bottom: 0; z-index: 1; }
