/* ============================================================
   Blue Ride 2026 — sitio público (formulario, credencial)
   Paleta del logo: azul marino #0B2A6F, azul #1E5BC6, celeste.
   Pensado para el celular primero.
   ============================================================ */

:root {
  --navy: #0B2A6F;
  --navy-osc: #071B4A;
  --azul: #1E5BC6;
  --azul-cl: #3B7DE0;
  --celeste: #E8F0FF;
  --fondo: #F3F6FB;
  --papel: #FFFFFF;
  --tinta: #181E2A;
  --tinta-suave: #5F6776;
  --linea: #D9E1EE;
  --verde: #1F8A4C;
  --verde-cl: #E5F6EC;
  --rojo: #C3392B;
  --rojo-cl: #FBE9E7;
  --ambar: #B26B0C;
  --ambar-cl: #FFF3DD;
  --wa: #25D366;
  --radio: 14px;
  --sombra: 0 2px 6px rgba(11,42,111,.06), 0 12px 32px rgba(11,42,111,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 16px/1.55 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--tinta);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--azul); }
h1 { font-size: 1.55rem; line-height: 1.2; color: var(--navy); margin-bottom: .5rem; }
h2 { font-size: 1.2rem; color: var(--navy); margin-bottom: .6rem; }
h3 { font-size: 1.05rem; color: var(--navy); margin: .8rem 0 .4rem; }
p + p { margin-top: .5rem; }
.silencio { color: var(--tinta-suave); }
.chico { font-size: .85rem; }
.centro { text-align: center; }
.opcional { font-weight: 400; color: var(--tinta-suave); font-size: .85em; }
[hidden] { display: none !important; }

/* ── Cabecera ─────────────────────────────────────────────── */
.cabecera {
  background: linear-gradient(160deg, var(--navy-osc), var(--navy) 60%, var(--azul));
  color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1rem 1.1rem;
}
.cabecera-marca {
  display: flex; align-items: center; gap: .9rem;
  max-width: 760px; margin: 0 auto;
  color: #fff; text-decoration: none;
}
.cabecera-marca img { width: 64px; height: 64px; border-radius: 50%; background: #fff; object-fit: cover; flex-shrink: 0; }
.cabecera-marca b { display: block; font-size: 1.25rem; letter-spacing: .01em; }
.cabecera-marca small { display: block; font-size: .8rem; opacity: .85; }

.cabecera { display: flex; align-items: center; justify-content: space-between; gap: .8rem 1rem; flex-wrap: wrap; }
.cabecera-marca { margin: 0; flex: 1 1 260px; }
.cabecera-compartir {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: #fff; color: var(--navy); font: inherit; font-weight: 700; font-size: .95rem;
  padding: .65rem 1.1rem; border: none; border-radius: 999px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.cabecera-compartir:hover { background: var(--celeste); }
.cabecera-compartir:disabled { opacity: .7; }
@media (max-width: 480px) { .cabecera-compartir { width: 100%; } }

/* Banner arriba del formulario */
.banner-compartir {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1rem;
  background: linear-gradient(135deg, var(--navy), var(--azul)); color: #fff;
  border-radius: var(--radio); padding: 1rem 1.1rem; margin-bottom: 1.1rem; box-shadow: var(--sombra);
}
.banner-texto { flex: 1 1 240px; display: flex; flex-direction: column; gap: .15rem; }
.banner-texto b { font-size: 1.02rem; }
.banner-texto span { font-size: .9rem; opacity: .9; }
.banner-botones { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.banner-botones .btn-neutro { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.4); }

/* Botón flotante */
.fab-compartir {
  position: fixed; right: 1rem; bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem); z-index: 50;
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--wa); color: #fff; border: none; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .95rem; padding: .8rem 1.1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.fab-compartir:hover { background: #1DB954; }
.fab-icono { font-size: 1.15rem; line-height: 1; }
@media (min-width: 900px) { .fab-compartir { right: calc(50% - 470px); } }

/* ── Compartir ────────────────────────────────────────────── */
.compartir { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.compartir-imagen { flex: 0 1 300px; max-width: 100%; }
.compartir-imagen img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--linea); box-shadow: var(--sombra); display: block; }
.compartir-acciones { flex: 1 1 260px; display: flex; flex-direction: column; gap: .55rem; }
.compartir-compacto .compartir-imagen { flex-basis: 180px; }
.bloque-compartir { border-color: #C9D9F5; background: linear-gradient(180deg, #fff, var(--celeste)); }

/* ── Marco ────────────────────────────────────────────────── */
.marco { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 1.2rem 1rem 2rem; }
.intro { margin-bottom: 1.2rem; }
.intro-dato { color: var(--navy); font-weight: 600; margin-bottom: .4rem; }

.bloque {
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 1.1rem 1rem 1.2rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--sombra);
}
fieldset.bloque { min-width: 0; }
.bloque legend {
  float: left; width: 100%;
  font-weight: 700; color: var(--navy); font-size: 1.05rem;
  margin-bottom: .9rem; padding: 0;
}
.bloque legend + * { clear: both; }
.bloque-angosto { max-width: 520px; margin-left: auto; margin-right: auto; }
.texto-largo p { margin-bottom: .7rem; }

/* ── Campos ───────────────────────────────────────────────── */
.formulario { display: block; }
.fila { display: flex; flex-wrap: wrap; gap: .8rem; }
.fila > .campo { flex: 1 1 220px; }
.fila > .campo-chico { flex: 0 1 200px; }
.campo { margin-bottom: .9rem; min-width: 0; }
.campo > label, .campo > .etiqueta { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; color: var(--tinta); }
.campo input[type=text], .campo input[type=tel], .campo input[type=email], .campo input[type=date],
.campo input[type=file], .campo select, .campo textarea {
  width: 100%; font: inherit; color: var(--tinta);
  padding: .68rem .8rem;
  border: 1.5px solid var(--linea); border-radius: 10px;
  background: #fff; min-height: 46px;
}
.campo input:focus, .campo select:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(30,91,198,.15); }
.campo.mal input, .campo.mal select { border-color: var(--rojo); }
.campo .error, .error { color: var(--rojo); font-size: .85rem; margin-top: .3rem; }
.ayuda { color: var(--tinta-suave); font-size: .85rem; margin-top: .35rem; }
input[type=file] { padding: .5rem .6rem; }

.opciones { display: flex; flex-wrap: wrap; gap: .5rem; }
.opcion {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem .9rem; border: 1.5px solid var(--linea); border-radius: 10px;
  background: #fff; cursor: pointer; user-select: none; min-height: 46px;
}
.opcion:has(input:checked) { border-color: var(--azul); background: var(--celeste); font-weight: 600; }
.opcion input { accent-color: var(--azul); width: 18px; height: 18px; }

.check { display: flex; align-items: flex-start; gap: .6rem; margin: .6rem 0; cursor: pointer; line-height: 1.4; }
.check input { accent-color: var(--azul); width: 20px; height: 20px; flex-shrink: 0; margin-top: .1rem; }
.check-destacado { padding: .8rem; border: 1.5px solid var(--linea); border-radius: 10px; background: var(--celeste); }
.check-destacado.mal { border-color: var(--rojo); }

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

.autocompletar { position: relative; }
.sugerencias {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
  list-style: none; background: #fff; border: 1.5px solid var(--linea); border-radius: 10px;
  box-shadow: var(--sombra); max-height: 240px; overflow-y: auto; margin-top: 4px;
}
.sugerencias li { padding: .6rem .8rem; cursor: pointer; }
.sugerencias li:hover { background: var(--celeste); }

.foto-previa { margin-top: .5rem; }
.foto-previa img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 3px solid var(--celeste); }

/* ── Kit ──────────────────────────────────────────────────── */
.kit { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.kit-foto { width: 140px; max-width: 40%; border-radius: 12px; border: 1px solid var(--linea); flex-shrink: 0; }
.kit-texto h3 { margin-top: 0; }
.kit-precio { font-size: 1.35rem; font-weight: 800; color: var(--navy); margin-top: .4rem; }
.kit-precio small { font-size: .8rem; font-weight: 400; color: var(--tinta-suave); }
.kit-total { font-size: 1.3rem; font-weight: 800; color: var(--navy); padding: .5rem 0; }
.tallas { display: flex; flex-wrap: wrap; gap: .6rem; }
.talla { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--tinta-suave); }
.talla select { min-width: 120px; padding: .55rem .6rem; border: 1.5px solid var(--linea); border-radius: 10px; font: inherit; min-height: 44px; }

/* ── Botones ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .7rem 1.1rem; border-radius: 10px; border: 1.5px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 46px;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn-primario { background: var(--azul); color: #fff; }
.btn-primario:hover:not(:disabled) { background: var(--navy); }
.btn-neutro { background: #fff; color: var(--navy); border-color: var(--linea); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #1DB954; }
.btn-grande { width: 100%; font-size: 1.05rem; padding: .95rem 1.2rem; margin-top: .6rem; }
.btn-chico { padding: .35rem .7rem; min-height: 32px; font-size: .85rem; }

/* ── Avisos ───────────────────────────────────────────────── */
.aviso { padding: .85rem 1rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid transparent; line-height: 1.45; }
.aviso-ok { background: var(--verde-cl); color: #145A33; border-color: #BFE7CD; }
.aviso-error { background: var(--rojo-cl); color: #8E2A1F; border-color: #F2C4BE; }
.aviso-info { background: var(--celeste); color: var(--navy); border-color: #C9D9F5; }
.aviso-ambar { background: var(--ambar-cl); color: #7A4A08; border-color: #F6DDAE; }
.enlace { display: block; word-break: break-all; font-size: .9rem; margin: .4rem 0; }

/* ── Credencial ───────────────────────────────────────────── */
.credencial { text-align: center; margin-bottom: 1.2rem; }
.credencial-imagen { display: block; margin: 1rem auto; max-width: 420px; }
.credencial-imagen img { width: 100%; height: auto; border-radius: 16px; box-shadow: var(--sombra); border: 1px solid var(--linea); }
.acciones { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-bottom: 1rem; }
.acciones .btn { flex: 1 1 200px; }

.datos { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .6rem 0 .9rem; }
.datos dt { color: var(--tinta-suave); font-size: .9rem; }
.datos dd { word-break: break-word; }

.lista-check { list-style: none; padding-left: 0; }
.lista-check li { padding: .35rem 0 .35rem 1.7rem; position: relative; }
.lista-check li::before { content: "✓"; position: absolute; left: .2rem; color: var(--azul); font-weight: 800; }

/* ── Modal ────────────────────────────────────────────────── */
dialog.modal {
  border: none; border-radius: 16px; padding: 0; max-width: 640px; width: calc(100% - 2rem);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
dialog.modal::backdrop { background: rgba(7,27,74,.55); }
dialog.modal h3 { padding: 1rem 1.2rem .5rem; margin: 0; }
.modal-cuerpo { padding: 0 1.2rem; max-height: 60vh; overflow-y: auto; }
.modal-cuerpo p { margin-bottom: .7rem; }
.modal-pie { display: flex; gap: .6rem; justify-content: flex-end; padding: .9rem 1.2rem; border-top: 1px solid var(--linea); }

/* ── Pie ──────────────────────────────────────────────────── */
.pie {
  padding: 1.2rem 1rem calc(env(safe-area-inset-bottom, 0px) + 1.2rem);
  text-align: center; color: var(--tinta-suave); font-size: .85rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.pie a { color: var(--tinta-suave); }
.pie-credito { font-size: .75rem; opacity: .75; }
.pie-credito a { text-decoration: none; }

@media (min-width: 640px) {
  h1 { font-size: 1.9rem; }
  .bloque { padding: 1.5rem 1.5rem 1.6rem; }
  .marco { padding-top: 1.8rem; }
}
