/*************************************************************
 * STYLES.CSS — Encuesta MAT VRAEM
 * Colores de marca: azul #0c3d5e · rojo #de2632
 *************************************************************/

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  background: #0c3d5e;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  min-height: 100vh;   /* fallback */
  min-height: 100dvh;  /* viewport móvil estable (sin saltos con la barra) */
  overflow: hidden;
}

/* =============================  PROGRESO  ============================= */
.progress-info {
  position: fixed;
  top: 10px;
  right: 16px;
  font-size: 15px;
  font-weight: 600;
  opacity: 0.85;
  z-index: 10;
}

.progress-container {
  position: fixed;
  top: 35px;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
  z-index: 10;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #de2632;
  transition: width 0.4s ease;
}

/* =============================  WRAPPER  ============================= */
.wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
}

/* -----------------------------------------------------------
   PANTALLA — clave del responsive:
   overflow-y:auto → el scroll SOLO aparece si el contenido
   no cabe (móvil horizontal, fuente grande). Cuando cabe,
   .contenido se centra con margin:auto y NO se ve scroll.
----------------------------------------------------------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.45s ease, opacity 0.45s ease;
  pointer-events: none;
}

.screen.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.screen.exit-left  { opacity: 0; transform: translateX(-100%); }
.screen.exit-right { opacity: 0; transform: translateX(100%); }

/* El bloque de contenido: centrado vertical cuando cabe,
   con aire arriba para no chocar con la barra de progreso. */
.contenido {
  margin: auto;
  width: 100%;
  padding: 64px 20px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

/* =============================  TIPOGRAFÍA  ============================= */
h1 { font-size: 30px; font-weight: 600; margin-bottom: 16px; }

.question-label {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 22px;
}

.pregunta-img {
  width: 100px;
  margin: 0 auto 15px;
  display: block;
}

/* =============================  CAMPOS  ============================= */
.input-wrapper {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 8px auto;
  width: 100%;
  max-width: 560px;
}

.input-wrapper.selector { cursor: pointer; }

input, textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 18px;
  color: #000;
  font-family: 'Poppins', sans-serif;
  resize: none;
}

input::placeholder, textarea::placeholder { font-size: 18px; color: #666; }

input:disabled { color: #999; cursor: not-allowed; }

/* Campo "¿Cuántas veces?" condicional */
.campo-numero { text-align: left; }
.campo-numero-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0c3d5e;
  margin-bottom: 6px;
}

/* =============================  OPCIONES (radio)  ============================= */
.options-group { margin: 0 auto 10px; width: 100%; max-width: 560px; }

.option {
  display: flex;
  align-items: flex-start;
  background: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  cursor: pointer;
  margin: 10px 0;
  color: #000;
  text-align: left;
}

.option input { position: absolute; opacity: 0; }

.radio-mark {
  width: 22px;
  height: 22px;
  border: 2px solid #0c3d5e;
  border-radius: 50%;
  margin-right: 15px;
  margin-top: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.radio-mark::after {
  content: "";
  width: 12px;
  height: 12px;
  background: #0c3d5e;
  border-radius: 50%;
  opacity: 0;
  transition: 0.2s ease;
}

.option input:checked + .radio-mark::after { opacity: 1; }
.option-text { color: #000; font-size: 18px; }

/* =============================  BOTONES / NAV  ============================= */
.nav-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin: 12px auto 0;
}

.btn {
  background: #de2632;
  color: #fff;
  padding: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  transition: 0.25s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-secundario {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
  flex: 0 0 auto;
  min-width: 90px;
}

/* =============================  VALIDACIÓN  ============================= */
.options-group.error,
.input-wrapper.error,
.campo-numero.error {
  outline: 3px solid rgba(255, 0, 0, 0.6);
  outline-offset: 6px;
  border-radius: 12px;
}

/* =============================  BIENVENIDA / FINAL  ============================= */
.welcome-card {
  background: #fff;
  border-radius: 22px;
  padding: 40px 28px 30px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

.welcome-logos img { max-width: 200px; }
.welcome-title { font-size: 26px; font-weight: 700; color: #1f3c88; margin-bottom: 8px; }
.welcome-subtitle { font-size: 16px; font-weight: 600; color: #3b4a6b; margin-bottom: 16px; }
.welcome-text { font-size: 15px; line-height: 1.6; color: #4a5568; margin-bottom: 28px; }
.welcome-btn { width: 100%; }

.welcome-footer {
  margin-top: 28px;
  background: #f2f2f2;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.welcome-footer img { max-height: 38px; }

/* =============================  PICKER MODAL  ============================= */
.picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 30, 45, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 20px;
}
.picker-overlay.hidden { display: none; }

.picker-box {
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: 75vh;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.picker-title {
  color: #0c3d5e;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
  text-align: center;
}

.picker-search {
  width: 100%;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  color: #000;
  margin-bottom: 12px;
}
.picker-search:focus { border-color: #0c3d5e; }

.picker-list { overflow-y: auto; padding-right: 4px; }

.picker-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #f2f2f2;
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 8px 0;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  color: #000;
  cursor: pointer;
}
.picker-item:hover { background: #e6eef3; }

.picker-empty { text-align: center; color: #888; padding: 20px; }

/* =============================  OVERLAY DE ENVÍO  ============================= */
.sending-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(3, 77, 102, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sending-overlay.hidden { display: none; }
.sending-content { text-align: center; color: #fff; }
.sending-content img { width: 76px; height: auto; margin-bottom: 6px; }
.sending-content p { margin: 0; font-size: 17px; font-weight: 500; opacity: 0.95; }

/* =============================  TOAST DE ERROR  ============================= */
.error-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  background: #b91c1c;
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease;
  z-index: 10000;
}
.error-toast.visible { transform: translateX(-50%) translateY(0); }

.hidden { display: none !important; }

/* =============================  RESPONSIVE  ============================= */
@media (max-width: 480px) {
  h1 { font-size: 26px; }
  .question-label { font-size: 19px; }
  input, .option-text, .btn, textarea { font-size: 16px; }
  .contenido { padding-top: 56px; }
}
