@font-face {
  font-family: "Stack Sans Text";
  src: url("fonts/stack-sans-text-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --azul: #0069b3;
  --azul-hover: #005a9a;
  --azul-claro: #e6f1fa;
  --naranja: #f5821f;
  --naranja-claro: #fff1e2;
  --naranja-texto: #b04a00;
  --texto: #14202e;
  --suave: #55657a;
  --borde: #dbe5ef;
  --borde-input: #c5d3e2;
  --fondo-card: #f6f9fc;
  --error: #b3261e;
  --ok: #1b7f4a;
  --foco: #0a58ca;
  --radio: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Stack Sans Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--texto);
  background: #fff;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--naranja);
  flex: none;
}

/* ---------- Estructura ---------- */
.page {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* ---------- Cabecera ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--azul);
  color: #fff;
  text-align: center;
  padding: calc(26px + env(safe-area-inset-top)) 24px 46px;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.hero::before { width: 300px; height: 300px; top: -150px; right: -110px; }
.hero::after  { width: 220px; height: 220px; bottom: -120px; left: -80px; }
.hero > * { position: relative; z-index: 1; }

.logo {
  display: block;
  width: 210px;
  height: auto;
  margin: 0 auto 18px;
}
.wordmark {
  margin-bottom: 18px;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.wordmark span {
  display: block;
  margin-top: 6px;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.5em;
  opacity: 0.8;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 6.4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.hero-sub {
  margin: 6px 0 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.92);
}

/* ---------- Hoja inferior ---------- */
.sheet {
  position: relative;
  flex: 1;
  margin-top: -26px;
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 28px rgba(0, 40, 80, 0.14);
}

.actions { display: flex; flex-direction: column; gap: 12px; }

.action {
  display: grid;
  grid-template-columns: 56px 1fr 22px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 80px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: #fff;
  color: var(--texto);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(20, 32, 46, 0.05);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
#btn-resena {
  border-color: #b9d6ee;
  background: linear-gradient(180deg, #f3f9fe 0%, #fff 100%);
}
.action:active { transform: scale(0.985); }
.action:focus-visible,
.success-link:focus-visible,
.submit:focus-visible,
.privacy summary:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
}
@media (hover: hover) {
  .action:hover {
    border-color: #8dbbe0;
    box-shadow: 0 8px 20px rgba(0, 105, 179, 0.13);
    transform: translateY(-1px);
  }
}

.action-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
}
.action-icon svg { width: 26px; height: 26px; fill: currentColor; }
.tone-blue   { background: var(--azul-claro);   color: var(--azul); }
.tone-orange { background: var(--naranja-claro); color: var(--naranja-texto); }

.action-text strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
}
.action-text small {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
  color: var(--suave);
}

.chev {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #8296ab;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}
.action[aria-expanded="true"] .chev-down { transform: rotate(180deg); }

/* ---------- Formulario desplegable ---------- */
.reveal {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.3s ease, visibility 0s linear 0.3s;
}
.reveal[data-open="true"] {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.3s ease, visibility 0s;
}
.reveal-inner { min-height: 0; overflow: hidden; }

.signup {
  margin-top: 14px;
  padding: 20px 16px 18px;
  background: var(--fondo-card);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
}
.signup h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 500;
}
.opt { font-weight: 400; color: var(--suave); }

.field input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1.5px solid var(--borde-input);
  border-radius: 12px;
  background: #fff;
  color: var(--texto);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: #8b9aad; }
.field input:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(0, 105, 179, 0.18);
}
.field input[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.12);
}
.field-error {
  margin: 6px 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--error);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.consent { margin: 4px 0 6px; }
.check {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  min-height: 44px;
  font-size: 0.92rem;
  line-height: 1.4;
  cursor: pointer;
}
.check input {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.box {
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 1.5px solid var(--borde-input);
  border-radius: 7px;
  background: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.check input:checked + .box {
  border-color: var(--azul);
  background: var(--azul)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 16px no-repeat;
}
.check input:focus-visible + .box {
  outline: 3px solid var(--foco);
  outline-offset: 2px;
}
.check input[aria-invalid="true"] + .box { border-color: var(--error); }

.privacy { margin: 6px 0 4px; font-size: 0.88rem; color: var(--suave); }
.privacy summary { padding: 8px 0; cursor: pointer; }
.privacy p { margin: 4px 0 6px; }

.form-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fdecea;
  color: #8c1d18;
  font-size: 0.92rem;
}

.submit {
  display: block;
  width: 100%;
  height: 56px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  background: var(--azul);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.submit:active { transform: scale(0.985); }
.submit[disabled] { opacity: 0.7; cursor: default; }
@media (hover: hover) { .submit:hover:not([disabled]) { background: var(--azul-hover); } }

/* ---------- Éxito ---------- */
.success { padding: 6px 0 2px; text-align: center; }
.success:focus { outline: none; }
.check-anim { width: 68px; height: 68px; }
.check-anim circle {
  fill: none;
  stroke: var(--ok);
  stroke-width: 2.5;
  stroke-dasharray: 151;
  animation: trazo 0.55s ease-out;
}
.check-anim path {
  fill: none;
  stroke: var(--ok);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  animation: trazo-check 0.4s ease-out 0.4s backwards;
}
.success h3 { margin: 10px 0 4px; font-size: 1.3rem; font-weight: 600; }
.success p { margin: 0; color: var(--suave); }
.success-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: 16px;
  padding: 0 20px;
  border: 1.5px solid var(--azul);
  border-radius: 999px;
  color: var(--azul);
  font-weight: 500;
  text-decoration: none;
}
@media (hover: hover) { .success-link:hover { background: var(--azul-claro); } }

/* ---------- Pie ---------- */
footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
  font-size: 0.82rem;
  color: var(--suave);
  text-align: center;
}

/* ---------- Animaciones ---------- */
@keyframes entra {
  from { opacity: 0; transform: translateY(12px); }
}
@keyframes trazo { from { stroke-dashoffset: 151; } }
@keyframes trazo-check { from { stroke-dashoffset: 40; } }

.logo, .wordmark, h1, .hero-sub { animation: entra 0.45s ease-out backwards; }
h1 { animation-delay: 0.08s; }
.hero-sub { animation-delay: 0.14s; }
.action { animation: entra 0.45s ease-out backwards; }
.actions .action:nth-child(1) { animation-delay: 0.18s; }
.actions .action:nth-child(2) { animation-delay: 0.26s; }
.actions .action:nth-child(3) { animation-delay: 0.34s; }

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

/* ---------- Pantallas grandes: la página se muestra como tarjeta centrada ---------- */
@media (min-width: 600px) {
  body { padding: 40px 16px; background: #e9eff6; }
  .page {
    min-height: 0;
    overflow: hidden;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(0, 40, 80, 0.2);
  }
}
