/* FETRI · landing de registro */
:root {
  --asfalto: #14181f;
  --asfalto-2: #1d232c;
  --blanco: #ffffff;
  --pista: #f3f4f6;
  --linea: #e5e7eb;
  --rojo: #d8232a;
  --rojo-oscuro: #b21b21;
  --ambar: #f2a900;
  --agua: #1e88e5;
  --tinta: #1f2937;
  --tinta-2: #4b5563;
  --mudo: #6b7280;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 20px;
  --ring: 0 0 0 4px rgba(20, 24, 31, 0.12);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--tinta);
  background: var(--pista);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; }
input, select { font: inherit; color: inherit; }

/* Cabecera */
.site-head {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 24px;
}
.site-logo img { height: 44px; width: auto; }
.lang-switch {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.lang-switch:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* Hero */
.hero { position: relative; min-height: 100vh; }
.hero-bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: clamp(540px, 74%, 760px);
  background:
    radial-gradient(60% 50% at 8% 100%, rgba(216, 35, 42, 0.35), transparent 70%),
    radial-gradient(40% 40% at 90% 0%, rgba(30, 136, 229, 0.18), transparent 70%),
    repeating-linear-gradient(115deg, transparent 0 46px, rgba(255, 255, 255, 0.035) 46px 48px),
    linear-gradient(180deg, var(--asfalto-2), var(--asfalto));
  overflow: hidden;
}
.hero-bg::after {
  /* Línea de meta: banda a cuadros muy sutil al pie del asfalto */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 10px, transparent 10px 20px),
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255,255,255,.12) 10px 20px);
  background-size: 20px 5px, 20px 5px;
  background-position: 0 0, 0 5px;
  background-repeat: repeat-x;
  opacity: .5;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1160px;
  margin: 0 auto;
  padding: 128px 24px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 520px);
  gap: 56px;
  align-items: start;
}
.hero-copy { color: #fff; padding-top: 24px; }
.eyebrow {
  margin: 0 0 18px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ambar);
}
.hero h1 {
  margin: 0 0 22px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(54px, 7.2vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.hero h1 .accent { font-style: normal; color: var(--rojo); }
.lead {
  margin: 0 0 32px;
  max-width: 44ch;
  font-size: 19px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.76);
}
.legs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.legs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}
.legs .pict { width: 20px; height: 20px; }
.leg-swim .pict { color: var(--agua); }
.leg-bike .pict { color: var(--ambar); }
.leg-run .pict { color: var(--rojo); }

/* Tarjeta del formulario */
.card {
  position: relative;
  background: var(--blanco);
  border-radius: var(--radius);
  border: 1px solid rgba(20, 24, 31, 0.06);
  box-shadow: 0 30px 80px -30px rgba(20, 24, 31, 0.55), 0 8px 24px -12px rgba(20, 24, 31, 0.3);
  padding: 30px 30px 28px;
  overflow: hidden;
  animation: card-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.card-title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.card-note { margin: 0 0 22px; color: var(--mudo); font-size: 15px; }

/* Pista de progreso: tres segmentos */
.track {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
  background: var(--linea);
}
.track .tl { position: relative; background: var(--linea); overflow: hidden; }
.track .tl::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.track .tl.done::after, .track.full .tl::after { transform: scaleX(1); }
.track .swim::after { background: var(--agua); }
.track .bike::after { background: var(--ambar); }
.track .run::after { background: var(--rojo); }

fieldset {
  border: 0;
  margin: 0 0 10px;
  padding: 0;
  min-width: 0;
}
legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tinta-2);
}
fieldset[data-leg='1'] legend .pict { color: var(--agua); }
fieldset[data-leg='2'] legend .pict { color: var(--ambar); }
fieldset[data-leg='3'] legend .pict { color: var(--rojo); }
fieldset.complete legend { color: var(--tinta); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-weight: 600; font-size: 14px; color: var(--tinta-2); }
.field-age { max-width: 160px; }
.field input, .field select {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--linea);
  border-radius: 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field input::placeholder { color: #9ca3af; }
.field input:focus, .field select:focus, .field input:focus-visible { border-color: var(--asfalto); box-shadow: var(--ring); }
.field.invalid input, .field.invalid select { border-color: var(--rojo); }
.field.invalid input:focus, .field.invalid select:focus { box-shadow: 0 0 0 4px rgba(216, 35, 42, 0.14); }
.field.valid input, .field.valid select { border-color: #a7b0bd; }
.err { display: none; color: var(--rojo); font-size: 13px; font-weight: 500; }
.field.invalid .err, .err.show { display: block; }
input[type='number'] { -moz-appearance: textfield; }
input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; }

.phone { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.dial { position: relative; }
.dial-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 50px;
  padding: 0 34px 0 14px;
  border: 1.5px solid var(--linea);
  border-radius: 12px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dial select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.dial:focus-within .dial-badge { border-color: var(--asfalto); box-shadow: var(--ring); }
.phone input { min-width: 0; }

.hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin: 10px 0 18px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--tinta-2);
  cursor: pointer;
}
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--rojo); }
.consent a { color: var(--tinta); font-weight: 600; }

.btn-go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: var(--asfalto);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s, transform 0.15s;
}
.btn-go:hover { background: var(--rojo); }
.btn-go:active { transform: scale(0.99); }
.btn-go:focus-visible { outline: 3px solid var(--ambar); outline-offset: 3px; }
.btn-go .btn-arrow { transition: transform 0.25s; font-family: var(--body); font-weight: 600; }
.btn-go:hover .btn-arrow { transform: translateX(6px); }
.card.ready .btn-go { background: var(--rojo); box-shadow: 0 10px 30px -10px rgba(216, 35, 42, 0.7); }
.card.ready .btn-go:hover { background: var(--rojo-oscuro); }
.btn-go[disabled] { opacity: 0.6; cursor: progress; }
.form-error { margin: 12px 0 0; color: var(--rojo); font-weight: 500; text-align: center; }
.alert { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: #fdecec; color: #9b1c1c; font-weight: 500; }

/* Estado "revisa tu correo" */
.done { text-align: center; padding: 18px 6px 6px; }
.done-icon {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 30px;
  background: var(--pista);
  color: var(--tinta);
  animation: pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.done-icon.ok { background: #e8f7ee; color: #15803d; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.done p { color: var(--tinta-2); max-width: 40ch; margin: 8px auto 20px; }
.done-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 22px;
  border: 1.5px solid var(--asfalto);
  border-radius: 999px;
  background: #fff;
  color: var(--asfalto);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-ghost:hover { background: var(--asfalto); color: #fff; }
.btn-ghost[disabled] { opacity: 0.5; cursor: default; }
.btn-link { background: none; border: 0; color: var(--mudo); text-decoration: underline; cursor: pointer; padding: 6px; }
.card-center { max-width: 560px; margin: 0 auto; }
.hero-simple .hero-inner { grid-template-columns: 1fr; padding-top: 140px; }
.hero-simple .hero-bg { height: 60%; }

/* Pie */
.site-foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  max-width: 1160px; margin: 0 auto; padding: 24px;
  color: var(--mudo); font-size: 13px;
}
.site-foot a { color: var(--tinta-2); }

/* Responsive */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; padding: 104px 20px 48px; }
  .hero-bg { height: 52%; }
  .hero-copy { padding-top: 0; }
  .hero h1 { font-size: clamp(46px, 12vw, 84px); }
  .lead { font-size: 17px; }
}
@media (max-width: 560px) {
  .site-head { padding: 16px; }
  .site-logo img { height: 36px; }
  .card { padding: 26px 18px 22px; border-radius: 16px; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .field-age { max-width: 100%; }
  .card-title { font-size: 30px; }
  .legs li { font-size: 15px; padding: 6px 12px 6px 8px; }
  .hero-bg { height: 46%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
