/* ========================= */
/* RESET */
/* ========================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, #f4f6fa, #eef2f8);
  color: #2c3e50;
  padding: 40px 20px;
}

/* ========================= */
/* CONTENEDOR */
/* ========================= */

.formulario {
  max-width: 1200px;
  margin: auto;
}

h1 {
  text-align: center;
  margin-bottom: 40px;
  font-weight: 600;
  font-size: 1.8rem;
  color: #1e73be;
  letter-spacing: 0.5px;
}

/* ========================= */
/* INTRO */
/* ========================= */

.intro {
  background: white;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 35px;
  border-left: 6px solid #1e73be;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  line-height: 1.6;
}

/* ========================= */
/* FIELDSETS PREMIUM */
/* ========================= */

fieldset {
  background: white;
  border: none;
  border-radius: 14px;
  padding: 35px;
  margin-bottom: 35px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.05);

  /* AQUÍ ESTÁ LA MAGIA */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px 30px;
}

legend {
  grid-column: 1 / -1;
  font-weight: 600;
  font-size: 1.1rem;
  color: #1e73be;
  margin-bottom: 15px;
}

/* ========================= */
/* LABEL */
/* ========================= */

fieldset label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

/* ========================= */
/* INPUTS */
/* ========================= */

input,
select {
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #d0d7e2;
  font-size: 0.9rem;
  background: #f9fbfe;
  transition: all 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: #1e73be;
  background: white;
  box-shadow: 0 0 0 3px rgba(30,115,190,0.15);
}

/* ========================= */
/* AJUSTE INTELIGENTE DE TAMAÑOS */
/* ========================= */

/* Fechas compactas */
input[type="date"] {
  max-width: 190px;
}

/* Edad más pequeña */
input[type="number"] {
  max-width: 130px;
}

/* Teléfono */
input[type="tel"] {
  max-width: 200px;
}

/* Email */
input[type="email"] {
  max-width: 260px;
}

/* ========================= */
/* RADIO Y CHECKBOX */
/* ========================= */

.grupo-radio,
.grupo-checkbox {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 30px;
  align-items: center;
  padding-top: 10px;
}

.grupo-radio span,
.grupo-checkbox span {
  width: 100%;
  font-weight: 600;
  margin-bottom: 5px;
}

.grupo-radio label,
.grupo-checkbox label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

/* ========================= */
/* AVISO LEGAL */
/* ========================= */

.aviso-legal {
  grid-column: 1 / -1;
  background: #f8faff;
  border-left: 5px solid #1e73be;
  padding: 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ========================= */
/* BOTÓN PREMIUM */
/* ========================= */

button[type="submit"] {
  background: linear-gradient(135deg, #1e73be, #155a96);
  color: white;
  border: none;
  padding: 14px 35px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* ========================= */
/* RESPONSIVE */
/* ========================= */

@media (max-width: 768px) {
  fieldset {
    grid-template-columns: 1fr;
  }

  input[type="date"],
  input[type="number"],
  input[type="tel"],
  input[type="email"] {
    max-width: 100%;
  }
}

.subgrupo {
  grid-column: 1 / -1;
  background: #f9fbff;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.subgrupo h4 {
  margin-bottom: 15px;
  color: #1e73be;
  font-weight: 600;
}

/* Compactar select de Nivel Educativo */
select {
  max-width: 260px;
}

.aviso-mapeo {
  grid-column: 1 / -1;
  margin-top: 10px;
  background: #f5f8ff;
  border-left: 4px solid #1e73be;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Forzar salto completo en subgrupos dentro del grid */
.subgrupo {
  grid-column: 1 / -1;
  display: block;
}

/* Radios dentro de subgrupo ocupan fila completa */
.subgrupo .grupo-radio,
.subgrupo .grupo-checkbox {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 30px;
  margin-bottom: 15px;
}

/* Separación clara del aviso */
.subgrupo .aviso-legal {
  margin-top: 15px;
  margin-bottom: 15px;
}

.documento-legal {
  max-width: 900px;
  margin: 60px auto;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  line-height: 1.7;
  font-size: 0.95rem;
}

.documento-legal h1 {
  color: #1e73be;
  margin-bottom: 30px;
}

.documento-legal h4 {
  margin-top: 30px;
  margin-bottom: 10px;
  color: #1e73be;
}