/* Test de visión — estilos propios de /test-de-vision.
   Se carga solo en esa página para no engordar el resto del sitio.
   Todo lo demás (colores, botones, tipografías) viene de styles.css. */

/* La herramienta tiene que verse sin bajar: la sección recorta su aire
   superior respecto al resto de secciones del sitio. */
.tv-seccion { padding-top: clamp(1.5rem, 4vw, 2.5rem); }

.tv-head { max-width: 44rem; margin-bottom: 1.5rem; }
.tv-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin-bottom: .5rem; }
.tv-sub { color: var(--ink-soft); max-width: 52ch; margin: 0; }

/* ---------- la tarjeta de la herramienta ---------- */
.tv {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
  max-width: 46rem;
}

.tv-panel { display: none; }
.tv-panel.es-activo { display: block; }

.tv-paso {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 .5rem;
}
.tv-panel__titulo { font-size: 1.375rem; margin-bottom: .75rem; }
.tv-panel p { color: var(--ink-soft); }
.tv-panel p strong { color: var(--ink); font-weight: 600; }

.tv-lista { margin: 0 0 1.5rem; padding-left: 1.1rem; color: var(--ink-soft); }
.tv-lista li { margin-bottom: .5rem; }
.tv-lista strong { color: var(--ink); font-weight: 600; }

.tv-acciones { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.5rem; }
.tv-acciones--prueba { justify-content: center; margin-top: 1.25rem; }

/* ---------- avisos ---------- */
.tv-nota {
  font-size: .9375rem;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border-left: 3px solid var(--line);
  border-radius: 0 8px 8px 0;
  padding: .75rem .9rem;
  margin: 1rem 0 0;
}
.tv-nota--ok { border-left-color: var(--brand); background: var(--brand-tint); }
.tv-nota--aviso { border-left-color: #c98a3c; background: #fbf3e7; color: #6b5330; }

/* ---------- paso 1: calibración ---------- */
.tv-marco-tarjeta {
  margin: 1.5rem 0 1rem;
  padding: 1.25rem 4px;
  background: var(--bg-alt);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.tv-tarjeta {
  position: relative;
  background: linear-gradient(135deg, #7d8f6c, #55654a);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(43, 47, 38, .18);
  flex: none;
  color: rgba(255, 255, 255, .85);
}
.tv-tarjeta__chip {
  position: absolute;
  left: 8%;
  top: 34%;
  width: 13%;
  height: 18%;
  min-width: 22px;
  min-height: 16px;
  border-radius: 4px;
  background: linear-gradient(160deg, #e8d9a8, #c2ab6a);
}
.tv-tarjeta__texto {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 9%;
  font-size: .6875rem;
  line-height: 1.3;
  letter-spacing: .01em;
}
/* De pie, la franja de texto estorba y el chip se mueve arriba */
.tv-tarjeta.es-vertical .tv-tarjeta__chip { top: 8%; width: 22%; height: 11%; }
.tv-tarjeta.es-vertical .tv-tarjeta__texto { bottom: auto; top: 24%; }

.tv-controles { display: flex; align-items: center; gap: .75rem; }
.tv-rango { flex: 1; display: block; }
.tv-rango__etiqueta {
  display: block;
  font-size: .75rem;
  color: var(--ink-soft);
  margin-bottom: .35rem;
}
.tv-rango input { width: 100%; accent-color: var(--brand); height: 28px; }
.tv-mini {
  width: 44px; height: 44px;
  flex: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  align-self: flex-end;
}
.tv-mini:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- paso 2: distancia ---------- */
.tv-opciones { display: grid; gap: .75rem; margin: 1.25rem 0 1rem; }
.tv-opcion {
  display: block;
  width: 100%;
  text-align: left;
  padding: .9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .18s ease, background-color .18s ease;
}
.tv-opcion:hover { border-color: var(--brand); }
.tv-opcion.es-elegido { border-color: var(--brand); background: var(--brand-tint); }
.tv-opcion strong { display: block; font-size: 1.0625rem; color: var(--ink); margin-bottom: .15rem; }
.tv-opcion span { font-size: .875rem; color: var(--ink-soft); }

.tv-otra { display: block; font-size: .875rem; color: var(--ink-soft); }
.tv-otra input {
  display: block;
  margin-top: .35rem;
  width: 8rem;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
}
.tv-otra input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.tv-gafas {
  margin: 1.25rem 0 0;
  padding: .9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tv-gafas legend { font-size: .875rem; color: var(--ink-soft); padding: 0 .35rem; }
.tv-gafas label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-right: 1.25rem;
  font-size: .9375rem;
  min-height: 44px;
  cursor: pointer;
}
.tv-gafas input { accent-color: var(--brand); width: 18px; height: 18px; }

/* ---------- paso 3: la prueba ---------- */
.tv-estado {
  text-align: center;
  font-size: .8125rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}
/* Fondo blanco puro y tinta negra: el contraste forma parte de la medida,
   así que aquí no se usan los cremas de la marca. */
.tv-lienzo {
  display: grid;
  place-items: center;
  min-height: min(46vh, 320px);
  padding: 1.5rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tv-e { display: block; }
.tv-e rect { fill: #000; }

.tv-pregunta { text-align: center; margin: 1.25rem 0 .75rem; font-weight: 500; color: var(--ink); }

.tv-flechas {
  display: grid;
  grid-template-columns: repeat(3, 68px);
  grid-template-rows: repeat(3, 68px);
  gap: .5rem;
  justify-content: center;
}
.tv-flecha {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.tv-flecha svg {
  width: 30px; height: 30px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.tv-flecha:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.tv-flecha:active { transform: translateY(1px); }
.tv-flecha--arriba { grid-area: 1 / 2; }
.tv-flecha--izq    { grid-area: 2 / 1; }
.tv-flecha--der    { grid-area: 2 / 3; }
.tv-flecha--abajo  { grid-area: 3 / 2; }

.tv-ayuda { text-align: center; font-size: .8125rem; color: var(--ink-soft); margin: .75rem 0 0; }

/* ---------- resultado ---------- */
.tv-marcador { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.5rem; }
.tv-marcador__ojo {
  background: var(--brand-tint);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}
.tv-marcador__ojo span {
  display: block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--brand-dark);
  margin-bottom: .35rem;
}
.tv-marcador__ojo strong {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1;
  color: var(--ink);
}
.tv-resultado__titulo { font-size: 1.25rem; }
#tvResultado p { color: var(--ink-soft); }
#tvResultado:focus { outline: none; }

.tv-cierre {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}
.tv-cierre__lead { max-width: 46ch; margin: 0 auto 1.25rem; }
.tv-cierre__precio { font-size: .8125rem; margin: .9rem 0 0; }

/* ---------- pie de la herramienta ---------- */
.tv-privacidad {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  max-width: 46rem;
  margin: 1rem 0 0;
  font-size: .875rem;
  color: var(--ink-soft);
}
.tv-privacidad .ico { color: var(--brand); margin-top: 2px; }

/* ---------- texto de apoyo ---------- */
.tv-texto { max-width: 68ch; }
.tv-texto h3 { font-size: 1.125rem; margin-top: 2rem; }
.tv-texto p { color: var(--ink-soft); }
.tv-texto strong { color: var(--ink); font-weight: 600; }

/* En pantalla completa la tarjeta ocupa todo, con el mismo fondo blanco */
.tv:fullscreen {
  max-width: none;
  border-radius: 0;
  border: none;
  display: grid;
  align-content: center;
  padding: 2rem;
}

@media (max-width: 560px) {
  /* Puesta de pie, la tarjeta mide 54 mm de ancho y la pantalla de un móvil
     ronda los 68 mm: si el marco no llega hasta los bordes, no cabe y el
     visitante no puede calibrar. Por eso aquí se sale de la caja. */
  .tv-marco-tarjeta {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
    padding: 1rem 3px;
  }
  .tv-marcador { grid-template-columns: 1fr; }
  .tv-flechas { grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 60px); }
  .tv-acciones .btn { flex: 1 1 auto; justify-content: center; }
}
