:root {
  --crema: #f6efe6;
  --crema-2: #efe4d6;
  --tarjeta: #ffffff;
  --campo: #fffcf9;
  --tinta: #1f1a17;
  --tenue: #6b625c;
  --borde: #e6dccf;
  --borde-fuerte: #d4c7b7;
  --rojo: #da2623;
  --rojo-oscuro: #b31b18;
  --rojo-suave: #fdeceb;
  --anillo: rgba(218, 38, 35, 0.16);
  --error: #c0261f;
  --ok: #1d7a4c;
  --oscuro: #1c1d22;
  --radio-tarjeta: 32px;
  --radio-campo: 14px;
  --sombra: 0 40px 80px -40px rgba(92, 52, 22, 0.35), 0 2px 6px rgba(31, 26, 23, 0.05);
  --fuente: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.5;
  color: var(--tinta);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(218, 38, 35, 0.07), transparent 60%),
    radial-gradient(800px 600px at 110% 110%, rgba(196, 140, 82, 0.14), transparent 60%),
    var(--crema);
  -webkit-font-smoothing: antialiased;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icono {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Estructura ---------- */
.pagina {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(16px, 4vw, 56px) 16px 32px;
}

.tarjeta {
  width: 100%;
  max-width: 880px;
  background: var(--tarjeta);
  border-radius: var(--radio-tarjeta);
  box-shadow: var(--sombra);
  overflow: hidden;
  animation: aparecer 0.5s ease-out both;
}

.tarjeta__cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(20px, 4vw, 36px) clamp(20px, 6vw, 56px) 0;
}

.logo { width: clamp(150px, 30vw, 220px); height: auto; display: block; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: var(--crema);
  color: var(--tenue);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.chip .icono { width: 16px; height: 16px; color: var(--rojo); }

.tarjeta__cuerpo { padding: clamp(24px, 4vw, 40px) clamp(20px, 6vw, 56px) clamp(28px, 5vw, 48px); }

/* ---------- Encabezado ---------- */
.antetitulo {
  margin: 0 0 10px;
  color: var(--rojo);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 16ch;
  text-wrap: balance;
}

.bajada {
  margin: 14px 0 0;
  max-width: 54ch;
  color: var(--tenue);
  font-size: 1.05rem;
}

.intro { margin-bottom: 32px; }

/* ---------- Campos ---------- */
.rejilla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 24px;
}

.campo label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.92rem;
  font-weight: 600;
}

.control { position: relative; }

.control .icono {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: #a3978b;
  pointer-events: none;
  transition: color 0.15s;
}

.control input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 46px;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio-campo);
  background: var(--campo);
  color: var(--tinta);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  appearance: none;
}
.control input::placeholder { color: #b3a89c; opacity: 1; }
.control input:hover { border-color: var(--borde-fuerte); }
.control input:focus {
  outline: none;
  border-color: var(--rojo);
  background: #fff;
  box-shadow: 0 0 0 4px var(--anillo);
}
.control:focus-within .icono { color: var(--rojo); }

.ayuda {
  min-height: 1.45em;
  margin: 5px 2px 8px;
  color: var(--tenue);
  font-size: 0.8rem;
  line-height: 1.45;
}

.campo.es-error .control input { border-color: var(--error); background: #fffafa; }
.campo.es-error .control input:focus { box-shadow: 0 0 0 4px rgba(192, 38, 31, 0.14); }
.campo.es-error .control .icono,
.campo.es-error .ayuda { color: var(--error); }
.campo.es-error .ayuda { font-weight: 500; }
.campo.es-valido .control input { border-color: #bfd8c9; }

/* Trampa anti-bots fuera de pantalla */
.trampa {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Casilla de autorización ---------- */
.campo--check { margin-top: 8px; }

.check {
  display: flex !important;
  gap: 14px;
  align-items: flex-start;
  margin: 0 !important;
  padding: 16px 18px;
  border: 1.5px solid var(--borde);
  border-radius: 16px;
  background: var(--campo);
  font-weight: 400 !important;
  font-size: 0.88rem !important;
  line-height: 1.55;
  color: var(--tenue);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.check:hover { border-color: var(--borde-fuerte); }
.check strong { color: var(--tinta); font-weight: 600; }
.check a { color: var(--rojo); font-weight: 600; text-underline-offset: 3px; }
.check a:hover { color: var(--rojo-oscuro); }

.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check__caja {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--borde-fuerte);
  border-radius: 7px;
  background: #fff;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.check__caja .icono {
  width: 15px;
  height: 15px;
  color: #fff;
  stroke-width: 3;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}
.check input:checked + .check__caja { background: var(--rojo); border-color: var(--rojo); }
.check input:checked + .check__caja .icono { opacity: 1; transform: none; }
.check input:focus-visible + .check__caja { box-shadow: 0 0 0 4px var(--anillo); border-color: var(--rojo); }
.check:has(input:checked) { border-color: rgba(218, 38, 35, 0.35); background: #fffaf9; }
.campo--check.es-error .check { border-color: var(--error); }
.campo--check.es-error .check__caja { border-color: var(--error); }

/* ---------- Botón ---------- */
.acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 16px;
}

.boton {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 260px;
  height: 58px;
  padding: 0 28px;
  border: 0;
  border-radius: 16px;
  background: var(--rojo);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 28px -14px rgba(218, 38, 35, 0.75);
  transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.boton:hover { background: var(--rojo-oscuro); transform: translateY(-1px); box-shadow: 0 18px 30px -14px rgba(179, 27, 24, 0.8); }
.boton:active { transform: translateY(0); box-shadow: 0 8px 18px -10px rgba(179, 27, 24, 0.8); }
.boton:focus-visible { outline: 3px solid rgba(218, 38, 35, 0.35); outline-offset: 3px; }
.boton__flecha { transition: transform 0.2s; }
.boton:hover .boton__flecha { transform: translateX(3px); }

.boton__giro {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: girar 0.7s linear infinite;
}

.boton[aria-busy="true"] { cursor: progress; }
.boton[aria-busy="true"] .boton__giro { display: block; }
.boton[aria-busy="true"] .boton__flecha { display: none; }
.boton:disabled { background: #e0807e; box-shadow: none; transform: none; }

.boton--secundario {
  min-width: 0;
  height: 50px;
  background: var(--crema);
  color: var(--tinta);
  box-shadow: none;
}
.boton--secundario:hover { background: var(--crema-2); box-shadow: none; }

.nota { margin: 0; color: var(--tenue); font-size: 0.8rem; }

/* ---------- Alerta y éxito ---------- */
.alerta {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1.5px solid rgba(192, 38, 31, 0.3);
  border-radius: 14px;
  background: var(--rojo-suave);
  color: #8f1c17;
  font-size: 0.92rem;
  font-weight: 500;
  animation: aparecer 0.25s ease-out both;
}
.alerta[hidden] { display: none; }
.alerta p { margin: 0; }
.alerta:focus { outline: none; }

.exito {
  padding: clamp(8px, 4vw, 32px) 0 8px;
  text-align: center;
  animation: aparecer 0.4s ease-out both;
}
.exito:focus { outline: none; }
.exito__sello {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #e7f4ec;
  color: var(--ok);
}
.exito__sello .icono { width: 38px; height: 38px; stroke-width: 2.4; }
.exito h2 { margin: 0 0 10px; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; }
.exito p { max-width: 44ch; margin: 0 auto 28px; color: var(--tenue); font-size: 1.02rem; }

/* ---------- Franja del aliado ---------- */
.tarjeta__aliado {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 24px;
  background: var(--oscuro);
  color: #a7a9b2;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.tarjeta__aliado img { width: auto; height: 26px; display: block; }

.pie { margin: 20px 0 0; color: var(--tenue); font-size: 0.8rem; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  :root { --radio-tarjeta: 24px; }
  .rejilla { grid-template-columns: 1fr; gap: 6px; }
  /* En una columna no hay que alinear filas: sin ayuda, el campo no reserva espacio */
  .ayuda:empty { min-height: 0; margin: 0 0 6px; }
  .acciones { flex-direction: column; align-items: stretch; }
  .boton { width: 100%; min-width: 0; }
  .nota { text-align: center; }
  .chip { padding: 6px 12px 6px 9px; font-size: 0.8rem; }
}

@keyframes aparecer {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes girar { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
