/* =========================================================
   ME QUIERO MUCHO — Test de aromaterapia (pantalla completa)
   ========================================================= */

.test-page{
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  overflow: hidden;
}

/* ---- Cabecera del test: volver + progreso ---- */
.test-header{
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: .6rem 1rem;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
}

.test-progress{
  flex: 1;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.test-progress__label{
  font-size: .75rem;
  color: var(--color-text-soft);
  font-family: var(--font-title);
  font-weight: 600;
}

.test-progress__track{
  height: 6px;
  border-radius: 999px;
  background: var(--color-pink-light);
  overflow: hidden;
}

.test-progress__fill{
  height: 100%;
  background: var(--color-pink);
  border-radius: 999px;
  transition: width var(--dur-transition) var(--ease-soft);
}

.test-dots{
  display: flex;
  gap: .35rem;
  justify-content: center;
  flex-wrap: wrap;
}

.test-dots__dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-pink-light);
  transition: background-color .3s ease, transform .3s ease;
}

.test-dots__dot.is-active{
  background: var(--color-pink);
  transform: scale(1.3);
}
.test-dots__dot.is-answered{
  background: var(--color-pink-dark);
}

/* ---- Track deslizante (viewport de preguntas) ---- */
.test-viewport{
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
}

/* Indicador de "hay más contenido más abajo": un degradado suave más
   una flechita que rebota, pegado a la parte inferior del viewport.
   Se muestra solo cuando la pregunta activa tiene contenido oculto
   por debajo (ver updateScrollCue() en js/test.js) y desaparece en
   cuanto se llega al final, o si el usuario tiene activada la
   reducción de movimiento. */
.scroll-cue{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: .1rem;
  padding-bottom: .3rem;
  background: linear-gradient(to bottom, transparent, var(--color-bg) 75%);
  color: var(--color-pink-dark);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.scroll-cue.is-visible{
  opacity: 1;
}
.scroll-cue__arrow{
  font-size: 1rem;
  line-height: 1;
  animation: scroll-cue-bounce 1.4s ease-in-out infinite;
}
@keyframes scroll-cue-bounce{
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}
@media (prefers-reduced-motion: reduce){
  .scroll-cue__arrow{ animation: none; }
}

.test-track{
  display: flex;
  height: 100%;
  transition: transform var(--dur-transition) var(--ease-soft);
  will-change: transform;
}

.test-slide{
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: .85rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.test-slide__inner{
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding-top: .5rem;
}

.test-slide__title{
  font-family: var(--font-title);
  color: var(--color-pink);
  text-transform: uppercase;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 .85rem;
  line-height: 1.25;
}

.test-slide__hint{
  text-align: center;
  font-size: .85rem;
  color: var(--color-text-soft);
  margin: -.75rem 0 1.25rem;
}

/* ---- Pantalla de respiración ---- */
.breathing{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  flex: 1;
  padding: 2.5rem 0 3rem;
}

.breathing__deco{
  width: 15vw;
  max-width: 58px;
  min-width: 32px;
  flex-shrink: 0;
  opacity: .85;
}

.breathing__deco--left{ transform: rotate(-90deg); }
.breathing__deco--right{ transform: rotate(90deg); }

.breathing__circle{
  width: 230px;
  height: 230px;
  max-width: 62vw;
  max-height: 62vw;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.breathing__ring{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: breathe-scale 8s ease-in-out infinite;
  transform-origin: center;
}

/* Tres anillos concéntricos de color plano, cada vez más oscuro hacia
   el exterior (igual que el vídeo de referencia: claro en el centro,
   oscuro en el borde), con un ligero desfase de tiempo entre ellos
   para el efecto de ondas — todo con CSS, sin depender de ningún
   archivo de vídeo. */
.breathing__ring--4{
  background: #FFA8C7;
  animation-delay: -0.6s;
}
.breathing__ring--3{
  inset: 18.25%;
  background: #FFB9D2;
  animation-delay: -0.4s;
}
.breathing__ring--2{
  inset: 32.9%;
  background: #FFC2D8;
  animation-delay: -0.2s;
}
.breathing__ring--1{
  inset: 40.85%;
  background: #FFCDDE;
  animation-delay: 0s;
}

/* Ciclo de 8s: crece (inspira) durante el primer ~45%, luego encoge
   (expira) el resto — y vuelve a empezar sin cortes, en bucle infinito
   real por CSS (no depende de ningún vídeo ni de JavaScript). El
   texto se sincroniza por JavaScript leyendo este mismo movimiento
   fotograma a fotograma (ver startBreathingAnimation en js/test.js). */
@keyframes breathe-scale{
  0%   { transform: scale(.8); }
  45%  { transform: scale(1.22); }
  100% { transform: scale(.8); }
}

.breathing__word{
  position: absolute;
  z-index: 2;
  color: #000;
  font-family: var(--font-body);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity .4s ease;
}

.breathing__word.is-visible{
  opacity: 1;
}

/* ---- Colores (pregunta 2) ---- */
.color-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 1.25rem;
  max-width: 380px;
  margin: 0 auto;
}

.color-option{
  background: none;
  border: none;
  cursor: pointer;
  padding: .35rem;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  transition: transform .18s ease;
}

.color-option__swatch{
  display: block;
  width: 100%;
  max-width: 100px;
  aspect-ratio: 1/1;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid transparent;
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
}

.color-option__swatch svg,
.color-option__swatch img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.color-option__label{
  font-size: .75rem;
  color: var(--color-text-soft);
  font-weight: 600;
}

.color-option.is-selected .color-option__swatch{
  border-color: var(--color-pink);
  transform: scale(1.06);
}

.color-option.is-selected{ transform: translateY(-2px); }

/* ---- Checkboxes ---- */
.check-list{
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.check-item{
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #fff;
  border: 2px solid var(--color-pink-light);
  border-radius: var(--radius-md);
  padding: .55rem 1rem;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, transform .12s ease;
}

.check-item:active{ transform: scale(.99); }

.check-item.is-checked{
  background: var(--color-pink-light);
}

.check-item input[type="checkbox"]{
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-pink);
  border-radius: 5px;
  background: #fff;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.check-item input[type="checkbox"]:checked{
  background: var(--color-pink);
}
.check-item input[type="checkbox"]:checked::after{
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-item__label{
  font-size: .95rem;
  color: var(--color-text);
}

.check-item--other{
  flex-wrap: wrap;
}

.check-item--other input[type="text"]{
  flex: 1;
  min-width: 100px;
  border: none;
  background: transparent;
  border-bottom: 2px solid var(--color-pink-light);
  padding: .3rem .1rem;
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--color-text);
}
.check-item--other input[type="text"]:focus{ outline: none; border-bottom-color: var(--color-pink); }

/* ---- Campos de texto libre ---- */
.field{
  margin-bottom: 1rem;
}

.field__label{
  display: block;
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--color-pink-dark);
  font-size: .85rem;
  text-transform: uppercase;
  margin-bottom: .4rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field textarea{
  width: 100%;
  border: 2px solid var(--color-pink-light);
  border-radius: var(--radius-md);
  padding: .8rem .9rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color .18s ease;
}

.field input:focus,
.field textarea:focus{
  outline: none;
  border-color: var(--color-pink);
}

.field textarea{
  min-height: 3rem;
  resize: none;
  overflow-y: hidden;
  line-height: 1.5;
}

.field--sub{
  margin-top: .5rem;
  padding-left: .5rem;
  border-left: 3px solid var(--color-pink-light);
}

/* ---- Consentimiento ---- */
.consent{
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  background: #fff;
  border: 2px solid var(--color-pink-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
  cursor: pointer;
}

.consent input[type="checkbox"]{
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--color-pink);
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
  margin-top: .1rem;
  cursor: pointer;
  position: relative;
}
.consent input[type="checkbox"]:checked{
  background: var(--color-pink);
}
.consent input[type="checkbox"]:checked::after{
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent__text{
  font-size: .85rem;
  color: var(--color-text-soft);
  line-height: 1.6;
}
.consent__text a{ color: var(--color-pink-dark); }

/* ---- Mensaje de error de validación ---- */
.field-error{
  display: none;
  color: var(--color-pink-dark);
  font-size: .82rem;
  font-weight: 600;
  margin-top: .6rem;
}
.field-error.is-visible{ display: block; }

/* ---- Navegación inferior (anterior / siguiente) ---- */
.test-nav{
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .25rem 1.25rem calc(.6rem + env(safe-area-inset-bottom, 0px));
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.test-nav__arrows{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.test-nav__arrow{
  border: none;
  background: none;
  padding: .5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform .15s ease, opacity .15s ease;
}

.test-nav__arrow img{
  width: 48px;
  height: auto;
}

.test-nav__arrow--prev img{
  transform: scaleX(-1);
}

.test-nav__arrow:hover{ transform: scale(1.08); }
.test-nav__arrow:active{ transform: scale(.94); }

/* Swipe hint para móvil, desaparece tras interactuar */
.swipe-hint{
  flex-shrink: 0;
  text-align: center;
  font-size: .72rem;
  color: var(--color-text-soft);
  margin: 0;
}
@media (min-width: 900px){
  :root{
    --max-width: 620px;
  }
  .swipe-hint{ display: none; }
  .breathing__circle{
    width: 300px;
    height: 300px;
  }
  .breathing{
    gap: 2.5rem;
  }
  .breathing__deco{
    width: 20vw;
    max-width: 92px;
    min-width: 48px;
  }
  .color-option__swatch{
    max-width: 118px;
  }
  .color-grid{
    grid-template-columns: repeat(4, 1fr);
    max-width: 520px;
  }
}

/* ---- Pantalla de confirmación ---- */
.confirmation{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  gap: 1.25rem;
}

.confirmation__image{
  width: 100%;
  max-width: 220px;
  height: auto;
}

.confirmation__text{
  color: var(--color-text);
  max-width: 36ch;
  line-height: 1.6;
}

/* ---- Estado de envío / error ---- */
.submit-status{
  text-align: center;
  font-size: .85rem;
  min-height: 1.2em;
  margin-top: .75rem;
}
.submit-status.is-error{ color: var(--color-pink-dark); font-weight: 600; }
.submit-status.is-loading{ color: var(--color-text-soft); }

@media (prefers-reduced-motion: reduce){
  .breathing__ring--4{ background: #FFA8C7; }
  .breathing__ring--3{ background: #FFB9D2; }
  .breathing__ring--2{ background: #FFC2D8; }
  .breathing__ring--1{ background: #FFCDDE; }
}
