/* Inscripción a 1° año – E.E.S.T. N°4 Berazategui
   Misma paleta que registro-muestra (azul noche + amarillo de alto contraste).
   Sin fuentes ni íconos externos: la CSP solo permite archivos de este servidor,
   así que se usa la fuente del sistema y los íconos son SVG dentro del HTML.
   Mobile-first: los estilos base son para celular; los @media agrandan para pantallas anchas. */
:root {
  /* Siempre en modo claro: el celular no la oscurece aunque tenga el modo oscuro activado */
  color-scheme: light only;
  --navy: #0f2d52;
  --navy-2: #173f6e;
  --navy-3: #22578f;
  --ink: #12213a;
  --muted: #55657d;
  --paper: #eef2f7;
  --card: #ffffff;
  --line: #cfd8e5;
  --accent: #f5b82e;
  --accent-ink: #1b1400;
  --ok: #14773f;          /* Inscripción Recibida */
  --ok-soft: #e3f3e9;
  --espera: #9a4a00;      /* Lista de Espera */
  --espera-soft: #fff1e0;
  --fuera: #475467;       /* Fuera de zona */
  --fuera-soft: #eef0f3;
  --err: #b42318;
  --focus: #f5b82e;

  --radius-lg: 20px;
  --radius: 12px;
  --radius-sm: 8px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.ico { width: 1.4em; height: 1.4em; flex: none; fill: currentColor; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Banda superior ---------- */
.band {
  background:
    radial-gradient(120% 90% at 100% 0%, var(--navy-3) 0%, transparent 55%),
    var(--navy);
  color: #fff;
  padding: 20px 20px 92px;
  position: relative;
  overflow: hidden;
}
.band::after { /* trama sutil, guiño a Informática/Programación */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  pointer-events: none;
}
.band > * { position: relative; z-index: 1; }

.brand { display: flex; align-items: center; gap: 12px; max-width: 640px; margin: 0 auto; }
/* Marca en CSS (sin imagen externa): círculo con "N°4" */
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: .85rem; letter-spacing: -.02em;
}
.brand-name { font-weight: 600; font-size: .95rem; line-height: 1.25; opacity: .92; }

.hero { max-width: 640px; margin: 32px auto 0; }
.hero-kicker { margin: 0 0 6px; color: var(--accent); font-weight: 700; font-size: 1rem; }
.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 8.5vw, 3.25rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero p.lead { margin: 12px 0 0; color: #c9d6e8; max-width: 44ch; }

/* ---------- Tarjeta del formulario ---------- */
.sheet {
  max-width: 640px;
  margin: -60px auto 40px;
  padding: 0 16px;
  position: relative; z-index: 2;
}
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px 18px 28px;
  box-shadow: 0 1px 0 rgba(15,45,82,.06), 0 18px 40px -18px rgba(15,45,82,.35);
}
@media (min-width: 560px) { .card { padding: 32px; } }

.info {
  display: flex; gap: 10px; align-items: flex-start;
  background: #f2f6fb; border-radius: var(--radius); padding: 12px 14px; margin: 0 0 20px;
  color: var(--navy-2); font-size: .98rem;
}
.info .ico { color: var(--navy-3); margin-top: 1px; }
.info p { margin: 0; }

/* Secciones numeradas */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.seccion { margin: 0 0 8px; padding-top: 6px; }
.seccion + .seccion { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 8px; }
.seccion-titulo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 700; margin: 0 0 14px; padding: 0;
}
.paso {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--navy); color: #fff; font-size: .95rem; font-weight: 800;
}

.field { margin-bottom: 18px; }
.field label, .legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
.input, .select {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  font-size: 1.125rem;          /* 18px: el iPhone no hace zoom al tocar el campo */
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .15s;
}
.input:hover, .select:hover { border-color: #aebcd0; }
.input:focus, .select:focus { border-color: var(--navy-3); outline: none; box-shadow: 0 0 0 3px rgba(245,184,46,.55); }
.input::placeholder { color: #8a97ab; }
.input-cp { text-transform: uppercase; max-width: 220px; }
.input-cp::placeholder { text-transform: none; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%2312213a' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 36px;
}
.field.has-error .input, .field.has-error .select { border-color: var(--err); }
.field.has-error .acepto { border-color: var(--err); }
.field-error { color: var(--err); font-weight: 600; font-size: .95rem; margin: 6px 0 0; }
.ayuda { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.opcional { font-weight: 400; color: var(--muted); font-size: .85em; }

.row-2 { display: grid; gap: 0 14px; }
@media (min-width: 520px) { .row-2 { grid-template-columns: 1fr 1fr; } }
/* Número y piso: siempre lado a lado, también en el celular */
.row-2.row-2-keep { grid-template-columns: 1fr 1fr; }

/* Fecha: día y año angostos, mes ancho */
.fecha { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 8px; }
.fecha .select { padding-left: 12px; }

/* ---------- Aviso de privacidad ---------- */
.privacidad {
  margin: 14px 0 20px; padding: 16px 16px 4px;
  background: #f7f9fc; border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
}
.privacidad h2 { margin: 0 0 8px; font-size: 1.1rem; }
.privacidad p, .privacidad ul { margin: 0 0 10px; }
.privacidad ul { padding-left: 1.2em; }
.privacidad li { margin-bottom: 6px; }
.privacidad .legal { color: var(--muted); font-size: .82rem; line-height: 1.4; }

.field .acepto { /* ".field" adelante: si no, ".field label" le saca el padding */
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; margin: 4px 0 0;
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  cursor: pointer; font-weight: 600;
}
.acepto input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--navy); flex: none; }
.acepto:has(input:checked) { border-color: var(--navy); background: #eef3fa; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 12px 22px;
  border: 0; border-radius: var(--radius);
  font-weight: 700; font-size: 1.15rem;
  cursor: pointer; text-decoration: none;
  transition: transform .08s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffc94d; }
.btn-light { background: #fff; color: var(--ink); }
.btn-ghost-light { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.75); }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); }
.btn-block { width: 100%; }

.form-error {
  background: #fdecea; color: var(--err);
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-weight: 600; margin: 0 0 16px;
}
.foot-note { text-align: center; color: var(--muted); font-size: .9rem; margin: 14px 0 0; }

/* ---------- Pantallas de "Enviando…" y de constancia ---------- */
.pass {
  min-height: 100vh;   /* respaldo para navegadores sin dvh */
  min-height: 100dvh;
  background: var(--ok);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 20px 20px 28px;
}
.pass.cargando { background: var(--navy); }
/* Color según el estado de la solicitud */
.pass.estado-espera { background: var(--espera); }
.pass.estado-fuera_zona { background: var(--fuera); }

.pass-inner { max-width: 560px; width: 100%; margin: 0 auto; flex: 1; display: flex; flex-direction: column; }
.pass .brand { margin: 0; }
.pass .brand-mark { background: #fff; color: var(--ink); }

.pass-head { display: flex; align-items: center; gap: 14px; margin: 22px 0 0; }
.pass-check {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: #fff; color: var(--ok);
  display: grid; place-items: center;
  animation: pop .45s cubic-bezier(.2,1.4,.4,1) both;
}
.pass-check .ico { width: 36px; height: 36px; }
.estado-espera .pass-check { color: var(--espera); }
.estado-fuera_zona .pass-check { color: var(--fuera); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.pass-title { margin: 0; font-size: clamp(1.9rem, 8.5vw, 2.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; outline: none; }
.pass-sub { margin: 10px 0 16px; font-size: 1.05rem; color: rgba(255,255,255,.9); }

.pass-dup {
  background: #fff; color: var(--ink); font-weight: 600; font-size: .95rem;
  border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 14px;
}

.pass-ticket {
  background: #fff; color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 18px 18px 20px;
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.45);
}
.ticket-label { margin: 0; color: var(--muted); font-size: .9rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ticket-num {
  margin: 0 0 14px; font-size: clamp(2.6rem, 13vw, 3.4rem); font-weight: 800; line-height: 1.05;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.pass-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; border-top: 1px dashed var(--line); padding-top: 14px; }
.pass-grid div { min-width: 0; }
.pass-grid dt { color: var(--muted); font-size: .88rem; }
.pass-grid dd { margin: 0; font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.pass-grid .wide { grid-column: 1 / -1; }
.pass-num { font-variant-numeric: tabular-nums; }

/* Etiqueta de estado con color (además del color de fondo, por si la imprimen en blanco y negro) */
.estado {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 1rem; font-weight: 800; border: 2px solid currentColor;
}
.tag-ingresante { color: var(--ok); background: var(--ok-soft); }
.tag-espera { color: var(--espera); background: var(--espera-soft); }
.tag-fuera_zona { color: var(--fuera); background: var(--fuera-soft); }

.pass-tip { margin: 16px 0 0; font-size: .95rem; color: rgba(255,255,255,.9); }
.pass-actions { margin-top: auto; padding-top: 20px; display: grid; gap: 12px; }

/* "Enviando…" */
.cargando-centro {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 20px;
}
.cargando-centro .pass-sub { margin: 0; max-width: 22em; }
.cargando-ring {
  width: 76px; height: 76px; border-radius: 50%;
  border: 6px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

/* ---------- Impresión: solo la constancia, en blanco ---------- */
@media print {
  @page { margin: 16mm; }
  body { background: #fff; }
  #view-form, #view-cargando, .pass-actions { display: none !important; }
  .pass { background: #fff !important; color: #000; min-height: 0; padding: 0; }
  .pass-sub, .pass-tip { color: #000; }
  .pass .brand-mark { border: 2px solid #000; }
  .pass-check { border: 2px solid #000; }
  .pass-ticket { box-shadow: none; border: 2px solid #000; }
  .pass-dup { border: 1px solid #000; }
}
