

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #e6f2ff, #cce0ff);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}

.wrap {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
}

h1 {
  text-align: center;
  color: #0056b3;
  margin-bottom: 1rem;
}

.subTitle {
  text-align: center;
  color: #5c6f91;
  margin-top: -0.25rem;
  margin-bottom: 1.25rem;
  font-size: .98rem;
}

fieldset {
  border: none;
  margin-bottom: 1.5rem;
}

legend {
  display: block;
  font-weight: 700;
  color: #003366;
  font-size: 1.1rem;
  line-height: 1.25;
  margin-bottom: 0.6rem;
  padding: 0; /* sin fondo, solo texto */
  background: transparent;
  border: 0;
}

/* Numeración automática de preguntas */
#filtro-form { counter-reset: pregunta; }
.questionVertical > legend::before {
  counter-increment: pregunta;
  content: counter(pregunta) ". ";
  color: #3399ff;
  font-weight: 700;
}

/* Aumentar tamaño de etiquetas específicas */
label[for="nombre"],
label[for="email"],
label[for="telefono"] {
  font-size: 1.05rem;
  font-weight: 600;
}

label {
  display: block;
  margin: 0.5rem 0;
  color: #004080;
}

input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%;
  padding: 0.7rem 0.9rem; /* igual en todos los campos */
  border: 1px solid #b3d1ff;
  border-radius: 6px;
  background: #f8fbff;
  margin-top: 0.3rem;
  margin-bottom: 0.8rem;
  font-size: 1rem; /* tamaño base cómodo */
  line-height: 1.2;
  box-sizing: border-box; /* evita que el borde aumente el ancho total */
}

/* Textarea: auto-ajuste de alto, sin redimensionado manual y nunca supera el ancho */
textarea {
  resize: none;           /* evita que el usuario deforme el layout */
  overflow: hidden;       /* oculta scroll mientras auto-crece */
  min-height: 6.5rem;     /* confortable por defecto (≈4 líneas) */
  max-width: 100%;        /* nunca sobrepasa los márgenes laterales */
}

/* Campo teléfono con prefijo integrado */
.phone-field {
  position: relative;
  margin-top: 0.3rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: stretch;
  width: 100%;
}
.phone-field .prefix-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem .9rem; /* igual que el input */
  background: #eef6ff;
  border: 1px solid #b3d1ff;
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: #003366;
  cursor: pointer;
  width: auto; /* override global button width */
  box-sizing: border-box;
  white-space: nowrap;
  flex: 0 0 auto;
  font: inherit; /* tipografía igual que input */
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.2; /* igual que input */
}
.phone-field .prefix-btn:hover { background: #e6f1ff; }
.phone-field:focus-within .prefix-btn {
  border-color: #3399ff;
  box-shadow: 0 0 0 3px rgba(51,153,255,.15);
}
.phone-field input#telefono:focus {
  outline: none;
  border-color: #3399ff;
  box-shadow: 0 0 0 3px rgba(51,153,255,.15);
}
.phone-field .prefix-btn .dial { font-size: .95em; }
.phone-field .prefix-btn .dial strong { font-weight: 600; }
.phone-field input#telefono {
  border-left: none; /* une con el botón */
  border-radius: 0 6px 6px 0;
  margin-top: 0;
  margin-bottom: 0;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0; /* evitar overflow en flex */
  line-height: 1.2;
  padding-right: 0.9rem; /* asegurar mismo padding derecho */
}
.phone-field .prefix-btn { box-sizing: border-box; white-space: nowrap; }
.prefix-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #b3d1ff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  max-height: 280px;
  overflow-y: auto;
  z-index: 10;
}
.prefix-search {
  position: sticky;
  top: 0;
  background: #fff;
  padding: .5rem;
  border-bottom: 1px solid #eef2ff;
}
.prefix-search input {
  width: 100%;
  padding: .5rem .6rem;
  border: 1px solid #b3d1ff;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
}
.prefix-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  padding: .5rem .75rem;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.prefix-option:hover { background: #f0f6ff; }
.prefix-option .dial { font-weight: 600; color: #003366; }

/* Placeholders más grandes y legibles */
input::placeholder, textarea::placeholder {
  font-size: 1rem;
}

/* Textos de ayuda bajo etiquetas/leyendas */
.hint {
  display: block;
  margin: .15rem 0 .4rem;
  color: #5c6f91;
  font-size: .92rem;
}

/* Más espacio entre subtítulo y respuestas en preguntas */
.questionVertical > legend { margin-bottom: 0.9rem; }
.questionVertical .hint { margin: .3rem 0 .9rem; }

input[type="radio"] {
  margin-right: 0.5rem;
}

button {
  background: #3399ff;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.3s ease;
}

button:hover {
  background: #267fd9;
}

/* Estados del botón durante el envío */
button[disabled] {
  opacity: 0.9;
  cursor: not-allowed;
}

button.is-loading {
  position: relative;
}

button.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-top-color: transparent;
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -7px; /* centra verticalmente sin usar transform */
  animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Confirmación tras envío */
.confirmation {
  background: #ffffff;
  border: 1px solid #e6ecff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.confirmationTitle {
  margin: 0 0 .6rem 0;
  color: #0056b3;
  font-size: 1.9rem;
  text-align: center;
  text-transform: uppercase;
}
.confirmation p {
  margin: 0 0 1rem 0;
  color: #405372;
  text-align: center;
}
.socialLinks {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  justify-content: center;
}
.socialIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: #0056b3; /* azul de los títulos */
  border: none;
  /* usar máscara con el SVG para colorearlo del azul */
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: 62%;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 62%;
}
.socialIcon:hover { transform: scale(1.08); }
.socialIcon .fallbackSvg { display: none; }
/* Rutas relativas a css/: subir a ../assets */
.socialIcon.whatsapp { -webkit-mask-image: url('../assets/whatsapp.svg'); mask-image: url('../assets/whatsapp.svg'); }
.socialIcon.instagram { -webkit-mask-image: url('../assets/instagram.svg'); mask-image: url('../assets/instagram.svg'); }
.socialIcon.tiktok { -webkit-mask-image: url('../assets/tiktok.svg'); mask-image: url('../assets/tiktok.svg'); }

/* Fallback: si mask no está soportado, mostrar el <img> */
@supports not ((-webkit-mask-image: url("") ) or (mask-image: url("") )) {
  .socialIcon { background: transparent; width: auto; height: auto; }
  .socialIcon .fallbackSvg { display: block; width: 48px; height: 48px; }
}
