/* Formulario de cuentanos.tararafilms.com. Estilo de la web, no de Slate:
   el degradado rojo con grano de la web, Eiko para la pregunta, Neue Montreal
   para el resto, botones rectos. A la izquierda, la hoja «Tu proyecto» que se
   rellena con lo contestado; a la derecha, la pregunta. */
@font-face { font-family: "Eiko"; src: url("fonts/PPEiko-Black.otf") format("opentype"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Montreal"; src: url("fonts/PPNeueMontreal-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --sala: #121213;
  --papel: #FAF9F7;
  --rojo: #F43C3C;
  --linea: rgba(250, 249, 247, .22);
  --linea-fuerte: rgba(250, 249, 247, .55);
  --suave: rgba(250, 249, 247, .68);
  --display: "Eiko", "Times New Roman", serif;
  --texto: "Montreal", "Helvetica Neue", Arial, sans-serif;
  --borde: clamp(20px, 4vw, 56px);
  --suave-curva: cubic-bezier(.65, 0, .35, 1); /* ease in-out: arranca y frena suave */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--sala); color: var(--papel);
  font-family: var(--texto); font-weight: 500; font-size: 17px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--papel); outline-offset: 3px; }

/* El degradado de la web, con un velo para que se lea la pregunta */
.fondo { position: fixed; inset: 0; z-index: -1; background: var(--sala) url("fondo.webp") center / cover no-repeat; }
.fondo::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(18, 18, 19, .25) 0%, rgba(18, 18, 19, .55) 38%, rgba(18, 18, 19, .72) 100%); }

/* Cabecera */
.arriba { position: fixed; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  padding: max(22px, env(safe-area-inset-top)) var(--borde) 0; pointer-events: none; }
.arriba > * { pointer-events: auto; }
.logo { width: 118px; height: auto; display: block; }
.cuadro { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  background: rgba(18, 18, 19, .35); border: 1px solid var(--linea-fuerte); border-radius: 0; cursor: pointer;
  transition: background .2s var(--suave-curva), color .2s var(--suave-curva), transform .12s var(--suave-curva); }
.cuadro:hover { background: var(--papel); color: var(--sala); }
.cuadro:active { transform: scale(.96); }
.cuadro[hidden] { display: none; }

/* Dos columnas: hoja y pregunta */
.marco { display: grid; grid-template-columns: minmax(280px, 34%) 1fr; min-height: 100%; }
.hoja { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  padding: 112px var(--borde) 28px; border-right: 1px solid var(--linea); overflow-y: auto; }
.hoja-titulo { margin: 0 0 22px; padding-bottom: 12px; border-bottom: 1px solid var(--linea-fuerte);
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.hoja-vacia { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.05; letter-spacing: -.01em; }
.hoja-vacia[hidden] { display: none; }
.hoja-lista { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.hoja-item { animation: aparece .4s var(--suave-curva) both; }
.hoja-item button { display: grid; grid-template-columns: 112px 1fr; gap: 12px; width: 100%; padding: 9px 0; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--linea); cursor: pointer; }
.hoja-item button:hover .hoja-valor { text-decoration: underline; text-decoration-color: var(--rojo); text-decoration-thickness: 2px; }
.hoja-etiqueta { color: var(--suave); font-size: 13px; padding-top: 2px; }
.hoja-valor { font-size: 15px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hoja-pie { margin: auto 0 0; padding-top: 24px; color: var(--suave); font-size: 13px; }
.hoja-pie a:hover { color: var(--papel); }

.lado { position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.pantalla { flex: 1; display: flex; align-items: center; padding: 112px var(--borde) 40px; }
.paso { width: 100%; max-width: 760px; }
.paso > * { animation: aparece .6s var(--suave-curva) both; }
.paso > *:nth-child(2) { animation-delay: .05s; }
.paso > *:nth-child(3) { animation-delay: .1s; }
.paso > *:nth-child(4) { animation-delay: .15s; }
.paso.atras > * { animation-name: aparece-atras; }
@keyframes aparece { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes aparece-atras { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

.antetitulo { margin: 0 0 18px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--suave); }
.pregunta { margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(36px, 4.6vw, 64px);
  line-height: 1; letter-spacing: -.02em; text-wrap: balance; }
.ayuda { margin: 14px 0 0; color: var(--suave); font-size: 17px; max-width: 36em; }
.texto { margin: 18px 0 0; font-size: 19px; max-width: 32em; }
.cuerpo { margin-top: 36px; }

/* Opciones: lista con líneas finas, sin cajas */
.opciones { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--linea); max-width: 620px; }
.opcion { position: relative; display: grid; grid-template-columns: 34px 1fr 24px; align-items: center; gap: 12px; width: 100%;
  min-height: 58px; padding: 12px 4px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--linea);
  cursor: pointer; font-size: 20px; transition: padding .25s var(--suave-curva), color .2s var(--suave-curva); }
.opcion::before { content: ""; position: absolute; inset: 0; background: var(--sala); /* barrido negro (José, 20-11) */ transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--suave-curva); z-index: -1; }
.opcion { isolation: isolate; }
.letra { font-size: 13px; color: var(--suave); letter-spacing: .06em; transition: color .2s var(--suave-curva); }
.flecha { opacity: 0; transform: translateX(-8px); transition: opacity .2s var(--suave-curva), transform .25s var(--suave-curva); }
.opcion:hover { padding-left: 14px; }
.opcion:hover::before { transform: scaleX(1); opacity: .55; }
.opcion::before { opacity: 1; }
.opcion:hover .flecha { opacity: 1; transform: none; }
.opcion[aria-checked="true"] { padding-left: 14px; }
.opcion[aria-checked="true"]::before { transform: scaleX(1); opacity: 1; }
.opcion[aria-checked="true"] .letra { color: var(--papel); }
.opcion[aria-checked="true"] .flecha { opacity: 1; transform: none; }
.opcion:active { transform: scale(.995); }

/* Campos */
.campo { display: block; margin-bottom: 26px; max-width: 620px; }
.campo span { display: block; margin-bottom: 4px; color: var(--suave); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.entrada { width: 100%; padding: 10px 0; background: transparent; border: 0; border-bottom: 1px solid var(--linea-fuerte);
  border-radius: 0; font-size: 26px; outline: none; transition: border-color .2s var(--suave-curva); }
.entrada:focus { border-bottom-color: var(--rojo); }
.entrada::placeholder { color: rgba(250, 249, 247, .38); }
textarea.entrada { resize: none; min-height: 2.6em; max-height: 42vh; font-size: 22px; line-height: 1.4; overflow-y: auto; }

.casilla { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; cursor: pointer; max-width: 620px; font-size: 18px; }
.casilla input { flex: none; appearance: none; width: 24px; height: 24px; margin: 1px 0 0; border: 1px solid var(--linea-fuerte); border-radius: 0;
  background: transparent; cursor: pointer; transition: background .15s var(--suave-curva); }
.casilla input:checked { background: var(--rojo) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 12l5 5 9-10' stroke='%23FAF9F7' stroke-width='2.4' fill='none'/></svg>") center / 18px no-repeat; border-color: var(--rojo); }
.casilla a:hover { text-decoration-color: var(--rojo); }

/* Botón */
.acciones { display: flex; align-items: center; gap: 18px; margin-top: 34px; flex-wrap: wrap; }
.boton { position: relative; display: inline-flex; align-items: center; gap: 14px; min-height: 52px; padding: 14px 26px; overflow: hidden;
  background: var(--rojo); color: var(--papel); border: 0; border-radius: 0; cursor: pointer; text-decoration: none; font-size: 18px;
  transition: background .2s var(--suave-curva), color .2s var(--suave-curva), transform .12s var(--suave-curva); }
.boton .flecha-boton { display: inline-block; transition: transform .25s var(--suave-curva); }
.boton:hover { background: var(--papel); color: var(--sala); }
.boton:hover .flecha-boton { transform: translateX(4px); }
.boton:active { transform: scale(.98); }
.boton[disabled] { opacity: .6; cursor: default; }
.pista { color: var(--suave); font-size: 13px; }
.error { margin: 14px 0 0; color: #FFC2C2; font-size: 15px; min-height: 1.3em; }

/* Pie: volver y avance */
.pie { display: flex; align-items: center; gap: 18px; padding: 0 var(--borde) max(26px, env(safe-area-inset-bottom)); min-height: 70px; }
.avance { display: flex; align-items: center; gap: 16px; }
.avance[hidden] { display: none; }
.contador { font-family: var(--display); font-weight: 900; font-size: 20px; letter-spacing: -.01em; min-width: 3.6em; }
.marcas { display: flex; gap: 4px; }
.marcas i { display: block; width: 18px; height: 3px; background: var(--linea-fuerte); transition: background .3s var(--suave-curva); }
.marcas i.hecha { background: var(--rojo); }
.marcas i.ahora { background: var(--papel); }

.trampa { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Tableta y móvil: una columna; la hoja se recoge en una línea arriba */
@media (max-width: 900px) {
  .marco { grid-template-columns: 1fr; }
  .hoja { position: fixed; top: 0; left: 0; right: 0; height: auto; z-index: 2; padding: 0; border: 0; overflow: visible; pointer-events: none; }
  .hoja > * { display: none !important; }
  /* En vertical, el encuadre cae en la mancha roja de la derecha de la imagen */
  .fondo { background-position: 74% 50%; }
  .fondo::after { background: linear-gradient(180deg, rgba(18, 18, 19, .35) 0%, rgba(18, 18, 19, .55) 60%, rgba(18, 18, 19, .7) 100%); }
}
@media (max-width: 640px) {
  :root { --borde: 16px; }
  body { font-size: 16px; }
  .logo { width: 100px; }
  .pantalla { align-items: flex-start; padding-top: 96px; }
  .pregunta { font-size: clamp(32px, 9vw, 40px); }
  .opcion { font-size: 18px; min-height: 54px; grid-template-columns: 28px 1fr 20px; }
  .opcion:hover { padding-left: 4px; }
  .entrada { font-size: 21px; }
  textarea.entrada { font-size: 19px; }
  .pista { display: none; }
  .boton { width: 100%; justify-content: center; }
  .marcas i { width: 12px; }
}
