/* Formulario público — paleta tomada de los flyers de la colonia.
   Diseño en pasos cortos: cada pantalla entra casi sin scroll y los botones quedan fijos abajo. */
:root {
  --amarillo: #f9cf3a;
  --amarillo-claro: #fff6d1;
  --azul: #1d5fbf;
  --azul-osc: #154a96;
  --celeste: #bfe3f7;
  --rosa: #ec3f95;
  --naranja: #f59a2a;
  --texto: #1f2937;
  --muted: #64748b;
  --borde: #e5e7eb;
  --ok: #16a34a;
  --error: #dc2626;
  --radio: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Nunito', system-ui, sans-serif; color: var(--texto); background: var(--amarillo-claro); font-size: 16px; line-height: 1.4; }
h1, h2, h3 { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; line-height: 1.1; color: var(--azul); }
h2 { font-size: 1.45rem; margin: 0 0 .7rem; }
h3 { font-size: 1.1rem; margin: 1rem 0 .4rem; }
a { color: var(--azul); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.r { text-align: right; }

/* Encabezado compacto */
.hero { background: var(--amarillo); padding: 14px 16px 34px; border-bottom: 5px solid var(--azul); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -50px; top: -70px; width: 180px; height: 180px; border-radius: 50%; background: var(--rosa); opacity: .18; }
.hero-in { max-width: 640px; margin: 0 auto; position: relative; z-index: 1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hero h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); margin: 0; font-weight: 800; order: 1; }
.kicker { margin: 0; font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; font-weight: 800; color: var(--rosa); font-size: 1rem; order: 2; }

.wrap { max-width: 640px; margin: -22px auto 24px; padding: 0 12px; position: relative; z-index: 2; }
.card { background: #fff; border-radius: var(--radio); padding: 18px; box-shadow: 0 8px 24px rgba(29, 95, 191, .12); margin-bottom: 14px; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
#form { padding-bottom: 0; }

/* Progreso */
.progreso { margin: -2px 0 14px; }
.progreso-txt { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.progreso-bar { height: 6px; background: var(--borde); border-radius: 999px; overflow: hidden; }
.progreso-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--azul), var(--rosa)); border-radius: 999px; transition: width .25s; }
.total-chip { background: var(--azul); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .8rem; white-space: nowrap; }
.intro { font-size: .9rem; margin-top: -4px; }

/* Campos */
.field { margin-bottom: 12px; }
.field > label { display: block; font-weight: 700; margin-bottom: 4px; font-size: .95rem; }
.field > label b, .check b { color: var(--rosa); }
.field small { display: block; margin: -2px 0 4px; font-size: .8rem; }
input[type=text], input:not([type]), input[type=email], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 2px solid var(--borde); border-radius: 10px; font: inherit; background: #fff; color: inherit; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(29,95,191,.15); }
.invalid input, .invalid select, .invalid textarea, .invalid .opts { border-color: var(--error) !important; }
.invalid > label { color: var(--error); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid2 .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.opts { display: flex; flex-wrap: wrap; gap: 8px; border: 2px solid transparent; border-radius: 10px; }
.opt { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 2px solid var(--borde); border-radius: 999px; cursor: pointer; font-weight: 700; min-height: 42px; }
.opt:has(input:checked) { border-color: var(--azul); background: #eaf2fd; color: var(--azul); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; margin-top: 12px; }
.check input { width: 20px; height: 20px; flex: none; }

/* Ficha de salud: preguntas Sí/No en una fila */
.salud .q { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--borde); margin: 0; }
.salud .q > label { margin: 0; flex: 1 1 200px; }
.salud .q > small { flex-basis: 100%; order: 3; margin: 0; }
.salud .q > input, .salud .q > select, .salud .q > textarea { flex-basis: 100%; }
.salud .q:last-child { border-bottom: 0; }

/* Paso 1: sede y modalidad */
.club-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
@media (max-width: 520px) { .club-grid { grid-template-columns: 1fr; } }
.club, .plan, .cant { cursor: pointer; position: relative; }
.club input, .plan input, .cant input { position: absolute; opacity: 0; pointer-events: none; }
.club-in, .plan-in { display: block; border: 3px solid var(--borde); border-radius: var(--radio); padding: 12px 14px; height: 100%; transition: .15s; }
.club-in strong { display: block; font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; font-size: 1.2rem; color: var(--azul); }
.club-in small { color: var(--muted); font-size: .85rem; }
.club input:checked + .club-in { border-color: var(--azul); background: #e3f2fc; box-shadow: inset 0 0 0 1px var(--azul); }
.club input:focus-visible + .club-in, .plan input:focus-visible + .plan-in, .cant input:focus-visible + span { outline: 3px solid var(--rosa); }
.pills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.pill { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border: 2px solid var(--borde); border-radius: 999px; font-weight: 700; cursor: pointer; text-align: center; }
.pill:has(input:checked) { background: var(--azul); color: #fff; border-color: var(--azul); }
.pill input { accent-color: var(--amarillo); }
.aviso-club { background: var(--rosa); color: #fff; font-weight: 800; padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-size: .95rem; }

/* Paso 2: cantidad */
.cant-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.cant span { display: flex; flex-direction: column; align-items: center; padding: 18px 8px; border: 3px solid var(--borde); border-radius: var(--radio); font-weight: 700; color: var(--muted); transition: .15s; }
.cant b { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; font-size: 2.6rem; line-height: 1; color: var(--azul); }
.cant input:checked + span { border-color: var(--azul); background: var(--celeste); color: var(--azul); }

/* Niños */
.nino-tag { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--amarillo); color: var(--azul); font-size: 1rem; vertical-align: 3px; }

/* Pago */
.tarifa-linea { margin: -4px 0 10px; color: var(--muted); }
.plans { display: grid; gap: 8px; }
.plan-in { padding: 10px 14px; }
.plan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.plan-top strong { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; font-size: 1.15rem; color: var(--azul); }
.plan-tot { font-weight: 800; }
.plan-det { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; color: var(--muted); font-size: .9rem; }
.cuota-chip { background: var(--amarillo-claro); border-radius: 6px; padding: 1px 7px; color: var(--texto); font-weight: 700; font-size: .85rem; }
.cuota-chip small { color: var(--muted); font-weight: 600; }
.plan input:checked + .plan-in { border-color: var(--rosa); background: #fff0f7; }
#convenio-box { margin-top: 12px; }
.pay-info { background: var(--amarillo-claro); border-left: 5px solid var(--naranja); padding: 8px 14px; border-radius: 10px; margin: 0 0 12px; }
.pay-info p { margin: .3rem 0; }
.alias { font-size: 1.2rem; color: var(--azul); letter-spacing: .02em; user-select: all; }
.big { font-size: 1.4rem; color: var(--rosa); }

.drop { display: block; border: 3px dashed var(--celeste); border-radius: var(--radio); padding: 18px 12px; text-align: center; cursor: pointer; font-weight: 700; color: var(--azul); background: #f5fbff; position: relative; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop.has { border-color: var(--ok); color: var(--ok); background: #f0fdf4; }
.invalid .drop { border-color: var(--error); }

.resumen dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; font-size: .95rem; }
.resumen dt { font-weight: 800; color: var(--azul); }
.resumen dd { margin: 0; }
@media (max-width: 520px) { .resumen dl { grid-template-columns: 1fr; gap: 0; } .resumen dd { margin-bottom: 8px; } }

.alert { padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-weight: 700; font-size: .92rem; }
.alert ul { margin: 0; padding-left: 18px; }
.alert.error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.alert.ok { background: #f0fdf4; color: var(--ok); border: 1px solid #bbf7d0; }

/* Botonera fija abajo */
.nav { position: sticky; bottom: 0; display: flex; gap: 10px; margin: 14px -18px 0; padding: 12px 18px; background: rgba(255,255,255,.96); border-top: 1px solid var(--borde); border-radius: 0 0 var(--radio) var(--radio); z-index: 5; }
.nav .btn:not(.ghost) { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--azul); color: #fff; border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; min-height: 48px; }
.btn:hover { background: var(--azul-osc); }
.btn.pink { background: var(--rosa); }
.btn.pink:hover { background: #c92b7a; }
.btn.ghost { background: transparent; color: var(--azul); border: 2px solid var(--azul); padding: 10px 18px; }
.btn:disabled { opacity: .6; cursor: wait; }

.ok-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2.2rem; display: grid; place-items: center; margin: 0 auto 10px; }
.codigo { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; font-size: 2.2rem; font-weight: 800; color: var(--rosa); margin: 0; letter-spacing: .04em; }
.codigo.sm { font-size: 1.7rem; }
.tbl { width: 100%; border-collapse: collapse; margin: 10px 0; }
.tbl th, .tbl td { padding: 7px; border-bottom: 1px solid var(--borde); text-align: left; }
.tbl th.r, .tbl td.r { text-align: right; white-space: nowrap; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; }
.saldo { font-size: 1.1rem; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; background: var(--borde); }
.b-pagada, .b-confirmada { background: #dcfce7; color: #166534; }
.b-informada { background: #fef3c7; color: #92400e; }
.b-pendiente { background: #e0e7ff; color: #3730a3; }
.b-baja { background: #fee2e2; color: #991b1b; }
.link { background: none; border: 0; color: var(--rosa); font-weight: 700; cursor: pointer; text-decoration: underline; font: inherit; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; }

/* Edad automática (pregunta con código "edad"): visible pero no editable */
.q-edad select, .q-edad input, .q-edad .opts { pointer-events: none; }
.q-edad select, .q-edad input[type=text], .q-edad input[type=number] { background: #f1f3f5; color: #333; }
.q-edad select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: none; }
.q-edad .edad-aviso { color: #c0392b; }
.q-edad .edad-aviso:empty { display: none; }

/* Grupo según sala/grado */
.grupo-info { display: block; margin-top: 6px; color: var(--texto, #1f2937); }
.grupo-info .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); vertical-align: -1px; }
.grupo-warn { display: inline-block; margin-top: 4px; background: #fff3cd; color: #7a5600; border-radius: 8px; padding: 4px 8px; }
.grupo-err { display: inline-block; margin-top: 4px; background: #fde2e1; color: #a12622; border-radius: 8px; padding: 4px 8px; }
.grupos-lista { list-style: none; padding: 0; margin: 12px 0; }
.grupos-lista li { margin: 4px 0; }
.grupos-lista .dot, #exito .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); vertical-align: -1px; }
.kit-box { border: 2px dashed #ec4899; border-radius: 12px; padding: 10px 14px; margin: 14px auto; max-width: 460px; text-align: left; }

/* Logo en la cabecera */
.hero-in { align-items: center; }
.hero-logo { width: 92px; height: auto; order: 0; flex: 0 0 auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.15)); }
.hero.small .hero-logo { width: 64px; }
@media (min-width: 600px) { .hero-logo { width: 120px; } .hero.small .hero-logo { width: 76px; } }
