:root {
  --naranja: #F97613;
  --naranja-osc: #e0660a;
  --azul: #3C4B60;
  --azul-osc: #212838;
  --tinta: #181919;
  --verde: #5fa67c;
  --azul-cielo: #6cb4d6;
  --gris-bg: #f4f5f7;
  --gris-borde: #d8dce2;
  --gris-texto: #5b6470;
  --blanco: #ffffff;
  --rojo: #c0392b;
  --radio: 14px;
  --sombra: 0 2px 10px rgba(24, 25, 25, 0.06);
  --sombra-card: 0 4px 18px rgba(24, 25, 25, 0.07);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--tinta);
  background: var(--gris-bg);
  line-height: 1.55;
}

/* ---------------- Header ---------------- */
.site-header {
  background: var(--azul-osc);
  color: var(--blanco);
  border-bottom: 5px solid var(--naranja);
}
.header-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.8rem 1.25rem 1.5rem;
  text-align: center;
}
.brand-logo {
  display: block;
  width: 150px;
  max-width: 55%;
  height: auto;
  margin: 0 auto 1.1rem;
  background: #fff;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.brand-kicker {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--naranja);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.brand-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.brand-sub {
  display: block;
  font-size: 0.95rem;
  color: #c9d0da;
  font-weight: 500;
  margin-top: 0.5rem;
}

/* ---------------- Layout ---------------- */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.intro {
  background: var(--blanco);
  border-radius: var(--radio);
  padding: 1rem 1.2rem;
  box-shadow: var(--sombra);
  margin: 0 0 1.4rem;
  font-size: 0.97rem;
}

/* ---------------- Banner de encargado ---------------- */
.encargado-banner {
  background: #fff6ee;
  border: 1px solid #f7c89a;
  border-left: 5px solid var(--naranja);
  border-radius: var(--radio);
  padding: 0.9rem 1.2rem;
  margin: 0 0 1.4rem;
  font-size: 0.95rem;
  color: var(--azul-osc);
}
.encargado-banner strong { color: var(--naranja-osc); }
.encargado-banner.error {
  background: #fdecea;
  border-color: #f5c6c0;
  border-left-color: var(--rojo);
  color: var(--rojo);
}

/* ---------------- Selfie ---------------- */
.selfie-box { display: flex; gap: 1rem; align-items: center; }
.selfie-thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--gris-bg);
  border: 2px dashed var(--gris-borde);
  display: grid;
  place-items: center;
  font-size: 2rem;
  overflow: hidden;
}
.selfie-thumb img { width: 100%; height: 100%; object-fit: cover; }
.selfie-controls { flex: 1; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-card);
  margin-bottom: 1.4rem;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.3rem;
  background: var(--azul);
  color: var(--blanco);
}
.card-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.step-badge {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--naranja);
  color: var(--blanco);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
}
.card-body { padding: 1.3rem; }

/* ---------------- Fields ---------------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.field { display: flex; flex-direction: column; }
.field.col-full { grid-column: 1 / -1; }
.field label,
.salud-item legend {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
select,
textarea {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--gris-borde);
  border-radius: 10px;
  background: var(--blanco);
  color: var(--tinta);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 72px; }
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--naranja);
  box-shadow: 0 0 0 3px rgba(249, 118, 19, 0.18);
}
input.invalido,
select.invalido {
  border-color: var(--rojo);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}
.hint {
  font-size: 0.82rem;
  color: var(--gris-texto);
  margin: 0.4rem 0 0;
}
.req-mark { color: var(--naranja); font-weight: 700; }
.seccion-desc {
  margin: 0 0 1rem;
  color: var(--gris-texto);
  font-size: 0.92rem;
}

/* ---------------- Grupos de casillas ---------------- */
.check-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.55rem 1rem;
  margin-top: 0.2rem;
}
.check-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid var(--gris-borde);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: border-color 0.15s, background 0.15s;
}
.check-pill:hover { border-color: var(--naranja); }
.check-pill input { accent-color: var(--naranja); width: 18px; height: 18px; }
.check-pill input:checked ~ span { font-weight: 600; }
.check-pill:has(input:checked) { border-color: var(--naranja); background: #fff6ee; }

/* ---------------- Aviso ---------------- */
.aviso {
  background: var(--gris-bg);
  border: 1px solid var(--gris-borde);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.9rem;
  color: var(--gris-texto);
  margin-bottom: 1rem;
}
.aviso p { margin: 0 0 0.7rem; }
.aviso p:last-child { margin-bottom: 0; }
.check-line {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.check-line input { margin-top: 0.2rem; accent-color: var(--naranja); width: 18px; height: 18px; }

/* ---------------- Errores ---------------- */
.form-errores {
  background: #fdecea;
  border: 1px solid #f5c6c0;
  color: var(--rojo);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}
.form-errores ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

/* ---------------- Botones ---------------- */
.actions { text-align: center; }
.btn-enviar {
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--blanco);
  background: var(--naranja);
  border: none;
  border-radius: 12px;
  padding: 0.85rem 2.4rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(249, 118, 19, 0.3);
  transition: background 0.15s, transform 0.1s;
}
.btn-enviar:hover { background: var(--naranja-osc); }
.btn-enviar:active { transform: translateY(1px); }
.btn-enviar:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secundario {
  font: inherit;
  font-weight: 600;
  color: var(--azul);
  background: var(--blanco);
  border: 2px solid var(--azul);
  border-radius: 12px;
  padding: 0.7rem 1.8rem;
  cursor: pointer;
  margin-top: 1rem;
}
.btn-secundario:hover { background: var(--azul); color: var(--blanco); }

/* ---------------- Éxito ---------------- */
.exito {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra-card);
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.exito-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--verde);
  color: var(--blanco);
  font-size: 2.2rem;
  display: grid;
  place-items: center;
}
.exito h2 { margin: 0 0 0.6rem; color: var(--azul-osc); }
.exito #folio { color: var(--naranja); font-size: 1.3rem; }

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--azul-osc);
  color: #c9d0da;
  text-align: center;
  padding: 1.2rem;
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--naranja); text-decoration: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .card-head h2 { font-size: 1.05rem; }
  .brand-title { font-size: 1.4rem; }
}
