/* Base de los diseños alternativos.

   Lo que es igual en todos: la mecánica del formulario, sus estados, el bloque
   de éxito con su entrada, el banner de cookies y el movimiento reducido. Cada
   diseño pone sus variables --d-* y su aspecto encima; aquí no hay ninguna
   decisión de marca. */

:root {
  --d-bg: #ffffff;
  --d-ink: #111111;
  --d-soft: #555555;
  --d-line: #dddddd;
  --d-field-bg: #ffffff;
  --d-field-line: #888888;
  --d-focus: #140DD9;
  --d-fill: #140DD9;
  --d-on-fill: #ffffff;
  --d-error: #B3261E;
  --d-error-bg: #FEF4F3;
  --d-ok: #1E8E5A;
  --d-money: #1E8E5A;
  --d-mark: #C9F2DD;
  --d-radius: 10px;
  --d-field-h: 52px;
  --d-font: system-ui, sans-serif;
  --ck-bg: #111111;
  --ck-ink: #ffffff;
  --ck-link: #ffffff;
  --pad-x: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Las decoraciones que salen a sangre (cintas, manchas, estrellas) no dan
   scroll horizontal. clip, no hidden: no rompe los position: sticky. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { overflow-x: clip; }
body { margin: 0; background: var(--d-bg); color: var(--d-ink); font-family: var(--d-font); }
h1, h2, h3, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--d-mark); color: var(--d-ink); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 40;
  padding: 12px 18px; background: var(--d-ink); color: var(--d-bg); font-weight: 600;
}
.skip:focus { top: 0; }

:focus-visible { outline: 3px solid var(--d-focus); outline-offset: 2px; }

/* --------------------------------------------------------- formulario */

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14.5px; }
.req { opacity: 0.6; }
.pareja { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 360px) { .pareja { grid-template-columns: 1fr 1fr; gap: 0 12px; } }

.field input,
.field select {
  width: 100%;
  height: var(--d-field-h);
  padding: 0 14px;
  border: 1.5px solid var(--d-field-line);
  border-radius: var(--d-radius);
  background: var(--d-field-bg);
  /* Con alternativa aquí y no en :root: si no, se congelaría el color de
     :root y los diseños oscuros tendrían el texto oscuro. */
  color: var(--d-field-ink, var(--d-ink));
  font-size: 17px;
  appearance: none;
}
.field input::placeholder { color: var(--d-soft); opacity: 0.8; }
.field input:focus, .field select:focus { outline: none; border-color: var(--d-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--d-focus) 25%, transparent); }
.field select {
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.tel-wrap { position: relative; }
.tel-prefijo { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 600; font-size: 17px; opacity: 0.7; pointer-events: none; }
.tel-wrap input { padding-left: 54px; }

.field input[aria-invalid="true"] { border-color: var(--d-error); background: var(--d-error-bg); color: var(--d-ink); }

.field-error { display: flex; gap: 7px; margin-top: 7px; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--d-error); }
.field-error::before {
  content: "!"; display: grid; place-items: center; flex: none;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--d-error); color: var(--d-bg); font-size: 12px; line-height: 1;
}

.consent { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 6px 0; margin-bottom: 14px; font-size: 13.5px; line-height: 1.5; color: var(--d-soft); }
.consent input { width: 22px; height: 22px; margin: 0; accent-color: var(--d-fill); }

.form-alerta { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--d-radius); background: var(--d-error-bg); color: var(--d-error); font-size: 14px; font-weight: 600; line-height: 1.45; }
.form-alerta strong { display: block; margin-bottom: 2px; }

.proof-text { margin: 4px 0 12px; font-size: 15px; font-weight: 600; }

.btn {
  display: grid; place-items: center; width: 100%; min-height: 56px; padding: 0 18px;
  border: 0; border-radius: var(--d-radius);
  background: var(--d-fill); color: var(--d-on-fill);
  font-family: var(--d-font-display, var(--d-font)); font-size: 18px; font-weight: 700;
  text-align: center; text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.7; cursor: progress; }
.btn.is-enviando { grid-auto-flow: column; grid-auto-columns: max-content; justify-content: center; gap: 10px; }
.btn.is-enviando::before { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: d-girar 0.7s linear infinite; }
@keyframes d-girar { to { transform: rotate(360deg); } }

.legal { margin-top: 12px; font-size: 12.5px; line-height: 1.5; color: var(--d-soft); }
.legal a { text-decoration: underline; }

.trampa { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

@keyframes d-aviso { from { opacity: 0; transform: translateY(-4px); } }
.field-error:not([hidden]), .form-alerta:not([hidden]) { animation: d-aviso 0.2s cubic-bezier(0.16, 1, 0.3, 1); }

/* -------------------------------------------------------------- éxito */

.success { display: grid; justify-items: start; gap: 18px; padding: 8px 0; }
.success-mark { width: 36px; height: 36px; color: var(--d-ok); }
.success h2 { font-family: var(--d-font-display, var(--d-font)); font-size: clamp(26px, 7vw, 32px); line-height: 1.08; letter-spacing: -0.02em; }
.success .exito-sub, .success .exito-app p { font-family: var(--d-font-display, var(--d-font)); font-size: clamp(19px, 5vw, 22px); font-weight: 600; line-height: 1.2; }
.success .exito-sub { margin-top: -8px; }
.exito-camino { width: 100%; display: grid; gap: 14px; }
.exito-whatsapp { grid-template-columns: 30px 1fr; align-items: center; padding: 18px; border-radius: var(--d-radius); background: color-mix(in srgb, var(--d-ink) 6%, transparent); }
.exito-icono { width: 30px; height: 30px; color: var(--d-money); }
.success .exito-whatsapp p { font-size: 17px; line-height: 1.45; }
.destacado { color: inherit; font-weight: 700; padding: 1px 6px; border-radius: 5px; white-space: nowrap; background: linear-gradient(var(--d-mark), var(--d-mark)) no-repeat left center / 100% 100%; }
.exito-o { width: 100%; display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--d-soft); }
.exito-o::before, .exito-o::after { content: ""; flex: 1; height: 1px; background: var(--d-line); }
.exito-app .btn { width: 100%; }

@keyframes d-trazo { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes d-enfoque { from { opacity: 0; filter: blur(6px); transform: translateY(10px); } }
@keyframes d-rotulador { from { background-size: 0% 100%; } }
@keyframes d-fundido { from { opacity: 0; } }
.is-entrando .success-mark path { stroke-dasharray: 1; animation: d-trazo 0.5s cubic-bezier(0.65, 0, 0.35, 1) 0.12s both; }
.is-entrando > h2, .is-entrando .exito-sub, .is-entrando .exito-camino, .is-entrando .exito-o { animation: d-enfoque 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.is-entrando > h2 { animation-delay: 0.22s; }
.is-entrando .exito-sub { animation-delay: 0.3s; }
.is-entrando .exito-whatsapp { animation-delay: 0.38s; }
.is-entrando .exito-o { animation-delay: 0.46s; }
.is-entrando .exito-app { animation-delay: 0.52s; }
.is-entrando .destacado { animation: d-rotulador 0.55s cubic-bezier(0.65, 0, 0.35, 1) 0.75s both; }

/* ------------------------------------------------------------ cookies */

.cookies {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; gap: 12px;
  padding: 16px var(--pad-x) max(16px, env(safe-area-inset-bottom));
  background: var(--ck-bg); color: var(--ck-ink);
}
.cookies p { font-size: 13.5px; line-height: 1.5; }
.cookies a { color: var(--ck-link); text-decoration: underline; }
.cookies-actions { display: flex; gap: 10px; }
.cookies .btn { min-height: 46px; font-size: 15.5px; }
.ghost { min-height: 46px; padding: 0 18px; border: 1px solid currentColor; border-radius: var(--d-radius); background: transparent; color: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
@media (min-width: 720px) {
  .cookies { grid-template-columns: 1fr auto; align-items: center; }
}

/* Estrellas de Google, por si un diseño las usa. */
.stars { display: inline-flex; gap: 2px; }
.star { width: 15px; height: 15px; fill: currentColor; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .success.is-entrando { animation: d-fundido 0.24s ease both !important; }
}
