/* ============================================================
   TEAM ACTIVATE — /sumate  (formulario de alumno nuevo, estilo quiz)
   Paleta de la landing: negro, blanco, naranja de marca
   ============================================================ */
:root {
  --black: #0a0a0a;
  --black-soft: #141414;
  --white: #f5f5f2;
  --orange: #ff8c00;
  --gray: #8a8a86;
  --gray-line: rgba(245,245,242,0.16);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--black);
  color: var(--white);
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.font-condensed { font-family: 'League Gothic', sans-serif; letter-spacing: 0.02em; }

/* Fondo: foto en blanco y negro + velo para que el formulario se lea */
.bg {
  position: fixed; inset: 0; z-index: 0;
  background: #1a1a1a url('/images/formulario/bg-sumate.jpg') center 62% / cover no-repeat;
}
.veil {
  position: fixed; inset: 0; z-index: 0;
  background:
    linear-gradient(180deg, rgba(10,10,10,0.72) 0%, rgba(10,10,10,0.55) 40%, rgba(10,10,10,0.78) 100%),
    rgba(10,10,10,0.18);
}

/* ---------- barra superior ---------- */
.topbar {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0.9rem 1.1rem;
}
.back-home {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.5rem 0.7rem 0.5rem 0.4rem; border-radius: 999px;
  font-size: 0.9rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em;
  color: rgba(245,245,242,0.85);
  transition: background .2s ease;
}
.back-home:hover { background: rgba(245,245,242,0.1); }
.back-home svg { width: 20px; height: 20px; }
.brand img { width: 74px; height: 74px; object-fit: contain; margin: -8px 0; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); }
.sound-btn {
  justify-self: end;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(245,245,242,0.08); border: 1px solid var(--gray-line);
  color: var(--white); cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.sound-btn:hover { background: rgba(245,245,242,0.16); }
.sound-btn svg { width: 20px; height: 20px; }
.sound-btn .ico-off { display: none; }
.sound-btn[aria-pressed="false"] .ico-on { display: none; }
.sound-btn[aria-pressed="false"] .ico-off { display: block; opacity: .75; }

/* ---------- contenedor ---------- */
.wrap {
  position: relative; z-index: 1;
  flex: 1;
  width: 100%; max-width: 620px;
  margin: 0 auto;
  padding: 0.5rem 1.1rem 2.5rem;
  display: flex; flex-direction: column; justify-content: center; gap: 1.1rem;
}

/* ---------- progreso: ruta con ciclista ---------- */
.progress { padding: 0 0.2rem; }
.track {
  position: relative;
  height: 34px;
  margin: 0 22px 0 4px;
}
.track::before {
  content: ""; position: absolute; left: 0; right: -6px; bottom: 6px; height: 3px;
  background-image: linear-gradient(90deg, rgba(245,245,242,0.32) 0 50%, transparent 50%);
  background-size: 18px 3px; background-repeat: repeat-x;
}
.track-fill {
  position: absolute; left: 0; bottom: 6px; height: 3px; width: 0%;
  background-image: linear-gradient(90deg, var(--orange) 0 50%, transparent 50%);
  background-size: 18px 3px; background-repeat: repeat-x;
  transition: width .55s cubic-bezier(.65,0,.35,1);
}
.rider {
  position: absolute; left: 0; bottom: 5px;
  color: var(--orange);
  transform: translateX(-50%);
  transition: left .55s cubic-bezier(.65,0,.35,1);
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.55));
}
.rider svg { display: block; overflow: visible; }
.wheel { transform-box: fill-box; transform-origin: center; }
.rider.moving .wheel { animation: spin .55s linear 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.flag { position: absolute; right: -22px; bottom: 4px; color: var(--white); opacity: .85; }
.km {
  margin: 0.15rem 0 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(245,245,242,0.65);
}
.km strong { color: var(--orange); font-weight: 600; }

/* ---------- tarjeta ---------- */
.card {
  background: rgba(10,10,10,0.74);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4.5vw, 2.4rem);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q {
  display: block; padding: 0; margin: 0 0 0.35rem;
  font-size: clamp(2rem, 7.5vw, 2.8rem); line-height: 1.02; text-transform: uppercase;
  outline: none;
}
.hint { display: block; margin: 0 0 0.6rem; color: var(--gray); font-size: 0.9rem; font-weight: 300; }

.step { animation: stepIn .35s ease both; }
.step[hidden] { display: none; }
@keyframes stepIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
.step.back { animation-name: stepInBack; }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }

/* campos de texto */
.text-input, textarea {
  width: 100%;
  background: rgba(20,20,20,0.9);
  border: 1.5px solid var(--gray-line);
  border-radius: 10px;
  padding: 0.85em 1em;
  color: var(--white);
  font-family: 'Oswald', sans-serif; font-size: 1.15rem; font-weight: 400;
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { resize: vertical; min-height: 7rem; }
.text-input::placeholder, textarea::placeholder { color: rgba(245,245,242,0.35); }
.text-input:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,140,0,0.2); }

/* opciones tipo botón grande */
.options { display: grid; gap: 0.65rem; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span {
  display: flex; align-items: center; gap: 0.8rem;
  min-height: 56px; padding: 0.7rem 1.1rem;
  background: rgba(20,20,20,0.9);
  border: 1.5px solid var(--gray-line);
  border-radius: 12px;
  font-size: 1.08rem; font-weight: 500; line-height: 1.25;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.opt span::before {
  content: ""; flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(245,245,242,0.4);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
@media (hover: hover) { .opt:hover span { border-color: rgba(255,140,0,0.7); transform: translateX(3px); } }
.opt input:focus-visible + span { outline: 3px solid rgba(255,140,0,0.55); outline-offset: 2px; }
.opt input:checked + span { border-color: var(--orange); background: rgba(255,140,0,0.14); }
.opt input:checked + span::before { border-color: var(--orange); background: var(--orange); box-shadow: inset 0 0 0 4px #1a1a1a; }

.error { margin: 0.7rem 0 0; color: #ffb36b; font-size: 0.92rem; }
.error[hidden] { display: none; }

/* navegación */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; margin-top: 1.4rem; }
.btn-next, .btn-back {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0.75em 1.7em;
  border-radius: 999px;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 0.98rem;
  letter-spacing: 0.04em; text-transform: uppercase;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn-next { background: var(--orange); color: var(--black); margin-left: auto; }
.btn-next:hover { background: #ffa733; transform: translateY(-2px); }
.btn-next[disabled] { opacity: .5; cursor: progress; transform: none; }
.btn-back { background: transparent; color: rgba(245,245,242,0.85); border-color: rgba(245,245,242,0.3); }
.btn-back:hover { border-color: var(--white); background: rgba(245,245,242,0.08); }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ---------- pantalla final ---------- */
.done { text-align: center; padding: 0.5rem 0 0; outline: none; animation: stepIn .45s ease both; }
.done[hidden], .fail[hidden] { display: none; }
.done-badge {
  width: 76px; height: 76px; margin: 0 auto 0.8rem; border-radius: 50%;
  background: var(--orange); color: var(--black);
  display: grid; place-items: center;
  animation: pop .6s cubic-bezier(.2,1.4,.4,1) both;
}
.done-badge svg { width: 42px; height: 42px; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done-title { font-size: clamp(2.4rem, 9vw, 3.4rem); line-height: 1; text-transform: uppercase; margin: 0 0 0.6rem; font-weight: 400; }
.done-text { margin: 0 auto 1.2rem; max-width: 460px; color: rgba(245,245,242,0.88); font-size: 1.08rem; }
.profile {
  margin: 0 auto 1.3rem; max-width: 460px; text-align: left;
  background: linear-gradient(120deg, rgba(255,140,0,0.16), rgba(255,140,0,0.04));
  border: 1px solid rgba(255,140,0,0.4); border-radius: 12px; padding: 1rem 1.2rem;
}
.profile[hidden] { display: none; }
.profile-tag {
  display: inline-block; background: var(--orange); color: var(--black);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.25em 0.8em; border-radius: 999px; margin-bottom: 0.5rem;
}
.profile p { margin: 0; color: rgba(245,245,242,0.88); font-size: 0.98rem; }
.done-thanks { margin: 0 0 1.4rem; color: rgba(245,245,242,0.85); font-size: 1.05rem; }
.done-thanks strong { color: var(--orange); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.done-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }
.done-ctas .btn-next { margin-left: 0; }

.fail { text-align: center; color: rgba(245,245,242,0.9); }
.fail p { margin: 0 0 1rem; }

/* ---------- celular ---------- */
@media (max-width: 520px) {
  .topbar { padding: 0.6rem 0.7rem; }
  .back-home span { display: none; }
  .brand img { width: 64px; height: 64px; }
  /* espacio abajo: el cartel "Powered by Netlify" no tiene que tapar los botones */
  .wrap { padding: 0.25rem 0.9rem 5.5rem; justify-content: flex-start; gap: 0.9rem; }
  .nav { flex-wrap: wrap-reverse; }
  .btn-next, .btn-back { flex: 1 1 45%; }
  .done-ctas .btn-next, .done-ctas .btn-back { flex: 1 1 100%; }
  .btn-next[data-submit] { flex: 1 1 100%; }
}
@media (max-height: 640px) and (min-width: 700px) { .wrap { justify-content: flex-start; } }

@media (prefers-reduced-motion: reduce) {
  .step, .done, .done-badge { animation: none !important; }
  .rider, .track-fill { transition: none; }
  .rider.moving .wheel { animation: none; }
}

/* ---------- pantallas con varias preguntas ---------- */
.fields { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1.2rem; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field-label, .field-legend {
  display: block; padding: 0; margin: 0 0 0.5rem;
  font-size: 1.05rem; font-weight: 500; line-height: 1.3; color: var(--white);
}
.req { color: var(--orange); }
.field.invalid .text-input, .field.invalid textarea { border-color: #ffb36b; }
.field.invalid .opt span, .field.invalid .check > span::before { border-color: #ffb36b; }
.field .error { margin: 0.45rem 0 0; }
.step-error { margin: 1rem 0 0; }

/* opciones cortas en 2 columnas */
.options.chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.options.chips .opt span { min-height: 50px; padding: 0.55rem 0.9rem; font-size: 1rem; }
.opt input[type="checkbox"] + span::before { border-radius: 6px; }
.opt input[type="checkbox"]:checked + span::before {
  border-color: var(--orange); background: var(--orange); box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%230a0a0a' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}

/* consentimiento */
.consent { padding-top: 0.2rem; }
.check { display: flex; align-items: flex-start; gap: 0.8rem; cursor: pointer; font-size: 0.98rem; line-height: 1.35; position: relative; }
.check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.check > span::before {
  content: ""; display: inline-block; vertical-align: -5px; margin-right: 0.7rem;
  width: 24px; height: 24px; border-radius: 6px; border: 2px solid rgba(245,245,242,0.45);
  background: rgba(20,20,20,0.9);
}
.check input:checked + span::before {
  border-color: var(--orange); background-color: var(--orange);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%230a0a0a' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}
.check input:focus-visible + span::before { outline: 3px solid rgba(255,140,0,0.55); outline-offset: 2px; }

/* aviso de privacidad (bienvenida) */
.privacy {
  display: flex; gap: 0.8rem; align-items: flex-start;
  margin: 1.2rem 0 0; padding: 0.9rem 1rem;
  border: 1px solid rgba(255,140,0,0.4); border-radius: 14px;
  background: rgba(255,140,0,0.08);
}
.privacy-ico { flex: none; width: 24px; height: 24px; margin-top: 2px; color: var(--orange); }
.privacy strong { display: block; margin-bottom: 0.2rem; font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--orange); font-weight: 600; }
.privacy p { margin: 0; font-size: 0.95rem; line-height: 1.45; color: rgba(245,245,242,0.88); }

/* bienvenida */
.intro .q { font-size: clamp(2.3rem, 9vw, 3.2rem); margin-bottom: 0.8rem; }
.intro-p { margin: 0 0 0.9rem; font-size: 1.02rem; color: rgba(245,245,242,0.9); }
.intro-time {
  margin: 1.1rem 0 0; display: inline-block;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange);
}
.done-thanks .lema { display: inline-block; margin-top: 0.5rem; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(245,245,242,0.55); }
.km strong { font-weight: 600; }

@media (max-width: 520px) {
  .options.chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .options.chips .opt span { font-size: 0.95rem; padding: 0.55rem 0.75rem; gap: 0.6rem; overflow-wrap: anywhere; }
}
