/* ==========================================================================
   APAS CUYO — Evento · estilos base
   Tokens tomados de APAS-CUYO-Credencial para que se sienta la misma familia.

   Criterio de diseño: el público son productores de seguros, muchos de 50-70
   años, llenando esto desde el celular. Prima lo explícito sobre lo minimalista:
   labels visibles (no placeholders como label), targets grandes, contraste alto.
   ========================================================================== */

:root {
  --brand-deep:    #1d3557;
  --brand-mid:     #457b9d;
  --brand-soft:    #eaf3fa;
  --brand-tint:    #d6e5f2;

  --bg-app:        #f5f7fa;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-subtle:   #94a3b8;

  --success:       #16a34a;
  --success-soft:  #dcfce7;
  --danger:        #dc2626;
  --danger-soft:   #fee2e2;
  --warning:       #d97706;
  --warning-soft:  #fef3c7;

  --radio:  14px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  /* Evita que el rebote de iOS muestre el fondo del navegador. */
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg-app);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ─── Encabezado ─────────────────────────────────────────────────────────── */
.encabezado {
  background: linear-gradient(160deg, var(--brand-deep), #24466f);
  color: #fff;
  padding: calc(28px + env(safe-area-inset-top)) 20px 30px;
  text-align: center;
}
.encabezado__institucion {
  margin: 0 0 6px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-tint);
}
.encabezado__titulo { margin: 0; font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.encabezado__bajada  { margin: 8px 0 0; font-size: .95rem; color: #c8dcef; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.contenedor { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }

.tarjeta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 22px 18px;
}
.tarjeta + .tarjeta { margin-top: 16px; }

/* ─── Formulario ─────────────────────────────────────────────────────────── */
.campo { margin-bottom: 18px; }

.campo__label {
  display: block;
  margin-bottom: 7px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}
.campo__opcional { font-weight: 400; color: var(--text-subtle); }

.campo__ayuda { margin: 6px 0 0; font-size: .85rem; color: var(--text-muted); }

.campo__control {
  width: 100%;
  /* 16px es el mínimo: por debajo, Safari iOS hace zoom al enfocar. */
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 13px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.campo__control:focus {
  outline: none;
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(69, 123, 157, .18);
}
.campo__control::placeholder { color: var(--text-subtle); }

.campo--error .campo__control { border-color: var(--danger); }
.campo__error {
  display: none;
  margin: 6px 0 0;
  font-size: .85rem;
  font-weight: 500;
  color: var(--danger);
}
.campo--error .campo__error { display: block; }

/* ─── Consentimiento ─────────────────────────────────────────────────────── */
.consentimiento {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
}
.consentimiento input {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin: 1px 0 0;
  accent-color: var(--brand-mid);
}
.consentimiento span { font-size: .88rem; color: var(--text-muted); line-height: 1.45; }

/* ─── Botón ──────────────────────────────────────────────────────────────── */
.boton {
  width: 100%;
  min-height: 52px;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--brand-deep);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.boton:hover:not(:disabled) { background: #24466f; }
.boton:active:not(:disabled) { transform: translateY(1px); }
.boton:disabled { opacity: .55; cursor: not-allowed; }

/* ─── Avisos ─────────────────────────────────────────────────────────────── */
.aviso {
  display: none;
  border-radius: 10px;
  padding: 13px 14px;
  margin-bottom: 18px;
  font-size: .92rem;
}
.aviso--visible { display: block; }
.aviso--ok    { background: var(--success-soft); color: #14532d; border: 1px solid #86efac; }
.aviso--error { background: var(--danger-soft);  color: #7f1d1d; border: 1px solid #fca5a5; }
.aviso--info  { background: var(--brand-soft);   color: var(--brand-deep); border: 1px solid var(--brand-tint); }

/* ─── Pantalla de éxito ──────────────────────────────────────────────────── */
.exito { text-align: center; }
.exito__icono {
  width: 68px; height: 68px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  font-size: 2rem;
  background: var(--success-soft);
  color: var(--success);
  border-radius: 50%;
}
.exito__titulo { margin: 0 0 8px; font-size: 1.4rem; color: var(--brand-deep); }
.exito__texto  { margin: 0 0 22px; color: var(--text-muted); }


.pie { margin-top: 24px; text-align: center; font-size: .82rem; color: var(--text-subtle); }

/* Respeta a quien pidió menos movimiento en el sistema. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ─── Marca en el encabezado ─────────────────────────────────────────────── */
.encabezado .marca-slot { margin-bottom: 16px; }
.encabezado .marca { --marca-alto: 52px; margin: 0 auto; }

@media (max-width: 380px) {
  .encabezado .marca { --marca-alto: 44px; }
}
