/* ---------- Formulario al estilo Typeform (src/site/form.js): una pregunta cada vez ---------- */
/* Los colores del tema que tenía el Typeform: preguntas en negro, respuestas y botones en su azul.
   Para pasarlo a los colores de la marca basta con cambiar estas variables. */
.tf {
  --tf-q: #191919;
  --tf-q-rgb: 25 25 25;
  --tf-a: #0445af;
  --tf-a-rgb: 4 69 175;
  --tf-btn: #0445af;
  --tf-btn-hover: #063a8f;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: var(--font);
  color: var(--tf-q);
}
.tf button, .tf input, .tf textarea, .tf select { font-family: inherit; }
.tf-bar { height: 4px; overflow: hidden; border-radius: 999px; background: rgb(var(--tf-a-rgb) / 0.12); }
.tf-bar i { display: block; height: 100%; border-radius: inherit; background: var(--tf-a); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; transition: transform 600ms var(--ease-out); }
.tf-stage { position: relative; display: grid; min-height: 0; padding: 22px 4px; overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: thin; }
.tf-q, .tf-end { grid-area: 1 / 1; align-self: center; width: min(100%, 720px); margin-inline: auto; }
.tf-q[hidden], .tf-end[hidden], .tf-foot[hidden], .tf-error[hidden], .tf-other[hidden] { display: none; }
.tf-q { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
.tf-q > * { grid-column: 2; justify-self: start; max-width: 100%; }
.tf-head { display: contents; }
/* El número va a la altura de la primera línea de la pregunta */
.tf-num { grid-column: 1; grid-row: 1; display: inline-flex; align-items: center; gap: 2px; height: calc(clamp(1.25rem, 2.2vw, 1.5rem) * 1.33); font-size: 0.9375rem; line-height: 1; color: var(--tf-a); }
.tf-num:empty { display: none; }
.tf-num svg { width: 14px; height: 14px; }
.tf-title { grid-column: 2; grid-row: 1; font-size: clamp(1.25rem, 2.2vw, 1.5rem); font-weight: 400; line-height: 1.33; letter-spacing: -0.01em; color: var(--tf-q); text-wrap: pretty; }
.tf-req { margin-left: 1px; }
.tf-desc { margin-top: 6px; font-size: clamp(0.9375rem, 1.4vw, 1.0625rem); line-height: 1.45; color: rgb(var(--tf-q-rgb) / 0.78); }
.tf-desc a { color: var(--tf-a); text-decoration: underline; text-underline-offset: 2px; }
.tf-q > .tf-input, .tf-fields { justify-self: stretch; }

.tf-input {
  display: block;
  width: 100%;
  margin-top: 26px;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid rgb(var(--tf-a-rgb) / 0.3);
  border-radius: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--tf-a);
  background: transparent;
  box-shadow: 0 1px 0 transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 200ms, box-shadow 200ms;
}
.tf-input::placeholder { color: rgb(var(--tf-a-rgb) / 0.38); opacity: 1; }
.tf-input:focus, .tf-input:focus-visible { border-bottom-color: var(--tf-a); box-shadow: 0 1px 0 var(--tf-a); outline: none; }
textarea.tf-input { resize: none; overflow: hidden; }

/* Varios campos en la misma pregunta (nombre, apellidos, teléfono y correo) */
.tf-fields { display: grid; gap: 22px; margin-top: 22px; }
@media (max-width: 640px) { .tf-fields { gap: 18px; margin-top: 18px; } .tf-actions { margin-top: 22px; } }
.tf-flabel { display: block; font-size: 1rem; line-height: 1.3; color: var(--tf-q); }
.tf-frow .tf-input { margin-top: 8px; font-size: clamp(1.125rem, 2vw, 1.375rem); }
.tf-phone { display: flex; align-items: stretch; gap: 8px; margin-top: 8px; }
.tf-phone .tf-input { flex: 1; min-width: 0; margin-top: 0; }
.tf-cc { position: relative; display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 0 4px 8px 2px; border-bottom: 1px solid rgb(var(--tf-a-rgb) / 0.3); transition: border-color 200ms, box-shadow 200ms; }
.tf-cc:focus-within { border-bottom-color: var(--tf-a); box-shadow: 0 1px 0 var(--tf-a); }
.tf-flag { font-size: 1.375rem; line-height: 1; }
.tf-flag[data-cc="ES"] { width: 26px; height: 18px; border-radius: 2px; font-size: 0; background: linear-gradient(#aa151b 25%, #f1bf00 25% 75%, #aa151b 75%); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08); }
.tf-chev { display: grid; color: rgb(var(--tf-a-rgb) / 0.7); }
.tf-chev svg { width: 16px; height: 16px; }
.tf-cc select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }

/* Opciones con su letra (A, B, C…) */
.tf-choices { display: inline-grid; gap: 8px; width: max-content; min-width: min(100%, 220px); max-width: 100%; margin-top: 24px; }
.tf-choices:focus, .tf-choices:focus-visible { outline: none; }
.tf-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 40px 6px 8px;
  border: 0;
  border-radius: 6px;
  font-size: clamp(1rem, 1.6vw, 1.1875rem);
  line-height: 1.3;
  text-align: left;
  color: var(--tf-a);
  background: rgb(var(--tf-a-rgb) / 0.07);
  box-shadow: inset 0 0 0 1px rgb(var(--tf-a-rgb) / 0.08);
  cursor: pointer;
  transition: background-color 160ms, box-shadow 160ms;
}
.tf-choice:hover { background: rgb(var(--tf-a-rgb) / 0.14); }
.tf-choice:focus-visible { outline: 2px solid var(--tf-a); outline-offset: 2px; border-radius: 6px; }
.tf-choice[aria-pressed="true"] { background: rgb(var(--tf-a-rgb) / 0.14); box-shadow: inset 0 0 0 2px var(--tf-a); }
.tf-key { display: grid; place-items: center; flex: none; min-width: 22px; height: 22px; padding: 0 4px; border: 1px solid rgb(var(--tf-a-rgb) / 0.45); border-radius: 4px; font-size: 0.75rem; font-weight: 600; line-height: 1; color: var(--tf-a); background: #fff; }
.tf-choice[aria-pressed="true"] .tf-key { border-color: var(--tf-a); color: #fff; background: var(--tf-a); }
.tf-tick { position: absolute; right: 12px; top: 50%; display: grid; width: 18px; height: 18px; translate: 0 -50%; opacity: 0; transition: opacity 160ms; }
.tf-choice[aria-pressed="true"] .tf-tick { opacity: 1; }
.tf-choice.is-blink { animation: tf-blink 480ms steps(1) both; }
@keyframes tf-blink { 0%, 50% { background: rgb(var(--tf-a-rgb) / 0.03); } 25%, 75% { background: rgb(var(--tf-a-rgb) / 0.2); } }
.tf-other { margin-top: 2px; font-size: clamp(1rem, 1.6vw, 1.1875rem); }

/* Casilla de aceptar */
.tf-consent { display: inline-flex; align-items: center; gap: 10px; margin-top: 20px; padding: 4px 2px; border: 0; border-radius: 6px; font-size: clamp(1rem, 1.6vw, 1.125rem); line-height: 1.3; text-align: left; color: var(--tf-a); background: none; cursor: pointer; }
.tf-consent:focus-visible { outline: 2px solid var(--tf-a); outline-offset: 2px; }
.tf-box { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border: 1.5px solid rgb(var(--tf-a-rgb) / 0.5); border-radius: 4px; color: #fff; background: #fff; transition: background-color 160ms, border-color 160ms; }
.tf-box svg { width: 16px; height: 16px; opacity: 0; }
.tf-consent[aria-checked="true"] .tf-box { border-color: var(--tf-a); background: var(--tf-a); }
.tf-consent[aria-checked="true"] .tf-box svg { opacity: 1; }

.tf-error { display: inline-flex; align-items: center; gap: 6px; width: fit-content; margin-top: 10px; padding: 5px 10px; border-radius: 4px; font-size: 0.875rem; line-height: 1.35; color: #af0404; background: #f7e6e6; }
.tf-error svg { flex: none; width: 16px; height: 16px; }

.tf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 26px; }
.tf-ok { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 4px; font-size: 1.125rem; font-weight: 700; line-height: 1; color: #fff; background: var(--tf-btn); box-shadow: 0 3px 12px -4px rgb(0 0 0 / 0.3); cursor: pointer; transition: background-color 160ms; }
.tf-ok:hover { background: var(--tf-btn-hover); }
.tf-ok svg { width: 18px; height: 18px; }
.tf-ok--send { padding: 0 20px; }
.tf-ok.is-busy { opacity: 0.7; cursor: progress; }
.tf-hint { font-size: 0.75rem; color: rgb(var(--tf-q-rgb) / 0.7); }
.tf-hint b { font-weight: 700; }
@media (hover: none) { .tf-hint { display: none; } }

.tf-foot { display: flex; justify-content: flex-end; padding-top: 8px; }
.tf-nav { display: flex; gap: 1px; overflow: hidden; border-radius: 4px; box-shadow: 0 3px 12px -4px rgb(0 0 0 / 0.3); }
.tf-nav button { display: grid; place-items: center; width: 36px; height: 32px; padding: 0; border: 0; color: #fff; background: var(--tf-btn); cursor: pointer; }
.tf-nav button:hover:not(:disabled) { background: var(--tf-btn-hover); }
.tf-nav button:disabled { opacity: 0.5; cursor: default; }
.tf-nav svg { width: 20px; height: 20px; }

.tf-end { display: grid; justify-items: center; gap: 14px; text-align: center; outline: none; }
.tf-end-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: #fff; background: var(--tf-a); }
.tf-end-ico svg { width: 30px; height: 30px; }
.tf-end h3 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; color: var(--tf-q); }
.tf-end p { max-width: 44ch; font-size: clamp(1rem, 1.6vw, 1.1875rem); line-height: 1.5; color: rgb(var(--tf-q-rgb) / 0.75); }
.tf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
