/* Hello Menopausia — Quiz styles
   Palette: Caramelo #ad845c · Índigo #4f5178 · Lino #85b3c6 · Marfil #f2ece1 · Rosa Palo #c97e87
*/
:root {
  --caramelo: #ad845c;
  --indigo: #4f5178;
  --lino: #85b3c6;
  --marfil: #f2ece1;
  --rosa: #c97e87;
  --white: #ffffff;
  --muted: #7a7389;
  --border: #e4d9cc;
  --lino-soft: rgba(133, 179, 198, 0.22);
  --caramelo-soft: rgba(173, 132, 92, 0.18);
  --rosa-soft: rgba(201, 126, 135, 0.2);
  --radius: 14px;
  --radius-pill: 999px;
  --shadow: 0 8px 28px rgba(79, 81, 120, 0.1);
  --shadow-sm: 0 2px 10px rgba(79, 81, 120, 0.07);
  --transition: 0.28s ease;
  --header-h: 64px;
  --nav-h: 72px;
  --tabbar-h: 60px;
  --max: 720px;
  --font: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--indigo);
  background: var(--marfil);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--indigo); }
button, input, select, textarea { font: inherit; color: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 1rem;
  padding-right: 1rem;
}

.site-header .logo {
  height: 36px;
  width: auto;
}

.site-header.dark {
  background: var(--indigo);
  border-bottom-color: transparent;
}

/* Progress */
.progress-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1rem 0.85rem;
}

.progress-meta {
  max-width: var(--max);
  margin: 0 auto 0.45rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
}

.progress-bar {
  max-width: var(--max);
  margin: 0 auto;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--rosa);
  border-radius: var(--radius-pill);
  transition: width var(--transition);
}

/* Main */
.quiz-main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.quiz-main.has-sticky-nav {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 1.25rem);
}

body.has-tabbar .quiz-main {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 2rem);
}

.step {
  display: none;
  animation: fadeSlide 0.32s ease;
}

.step.active { display: block; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.step-kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--caramelo);
  margin-bottom: 0.5rem;
}

.step h1, .step h2 {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: var(--indigo);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.step h1 { font-size: clamp(1.5rem, 4.5vw, 1.85rem); }
.step h2 { font-size: clamp(1.35rem, 4vw, 1.65rem); }

.step .lede {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 1rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.disclaimer-box {
  background: var(--lino-soft);
  border: 1px solid rgba(133, 179, 198, 0.35);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  font-size: 0.9rem;
  color: var(--indigo);
  margin: 1.25rem 0 1.5rem;
  line-height: 1.5;
}

.disclaimer-box strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--caramelo);
}

/* Single question screen */
.q-screen {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: min(52dvh, 420px);
}

.q-screen .step-kicker {
  margin-bottom: 0;
}

.q-text-single {
  margin: 0;
  font-weight: 600;
  color: var(--indigo);
  font-size: clamp(1.25rem, 4.2vw, 1.4rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.q-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.2rem 1.4rem;
  box-shadow: var(--shadow-sm);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.q-card.answered {
  border-color: var(--rosa);
  box-shadow: 0 4px 18px rgba(201, 126, 135, 0.15);
}

.q-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

.q-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.q-toggle label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: var(--marfil);
  color: var(--indigo);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  width: 100%;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.15s ease, box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.q-toggle label:hover {
  border-color: var(--caramelo);
}

.q-toggle label:active {
  transform: scale(0.98);
}

.q-toggle input:focus-visible + label {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* Selected SÍ: Rosa Palo fill */
.q-toggle input[value="si"]:checked + label {
  background: var(--rosa);
  border-color: var(--rosa);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(201, 126, 135, 0.35);
}

/* Selected NO: Índigo outline */
.q-toggle input[value="no"]:checked + label {
  background: var(--white);
  border-color: var(--indigo);
  color: var(--indigo);
  box-shadow: 0 0 0 1px var(--indigo);
}

@media (min-width: 540px) {
  .q-toggle {
    flex-direction: row;
  }
  .q-toggle label {
    flex: 1;
  }
}

/* Step nav (inline) */
.step-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Atrás under q-card (ghost, full-width, thumb-friendly) */
.q-screen .btn-atras {
  margin-top: 0.25rem;
  width: 100%;
  flex: none;
  min-height: 52px;
  border: 2px solid var(--indigo);
  color: var(--indigo);
  background: transparent;
  min-width: 0;
}

.q-screen .btn-atras:hover {
  background: var(--white);
  border-color: var(--indigo);
}

.q-screen .btn-atras:active {
  background: rgba(79, 81, 120, 0.08);
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 52px;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform 0.15s ease, box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }

.btn:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--indigo);
  color: var(--white);
  flex: 1;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover { background: #3f4163; }
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--indigo);
  border: 2px solid var(--border);
  flex: 0 0 auto;
  min-width: 110px;
}

.btn-ghost:hover {
  border-color: var(--indigo);
  background: var(--white);
}

.btn-block { width: 100%; flex: none; }

/* Results */
.banner {
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.banner-warn {
  background: var(--indigo);
  color: var(--white);
}

.banner-ok {
  background: var(--caramelo-soft);
  border: 1px solid rgba(173, 132, 92, 0.35);
  color: var(--indigo);
}

.banner .count {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  opacity: 0.9;
}

.section-label {
  margin: 1.5rem 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--indigo);
}

.labs-grid {
  display: grid;
  gap: 0.7rem;
}

.lab-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1.05rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.lab-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--lino-soft);
  color: var(--indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.lab-card h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--indigo);
}

.lab-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.products-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 540px) {
  .products-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--caramelo-soft);
}

.product-body {
  padding: 0.95rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.4rem;
}

.product-body h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--indigo);
}

.product-body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  flex: 1;
}

.product-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.55rem;
  min-height: 42px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--indigo);
  color: var(--white);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background var(--transition);
}

.product-link:hover { background: #3f4163; }
.product-link:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

/* Form */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--indigo);
}

.field .hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.field input,
.field select {
  min-height: 50px;
  padding: 0.7rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:hover,
.field select:hover {
  border-color: var(--caramelo);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79, 81, 120, 0.15);
}

.field input.invalid,
.field select.invalid {
  border-color: var(--rosa);
}

.field-error {
  font-size: 0.78rem;
  color: var(--rosa);
  display: none;
}

.field.has-error .field-error { display: block; }

.success-panel {
  text-align: center;
  padding: 2rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.success-panel .check {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--indigo);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.success-panel h2 {
  margin: 0 0 0.5rem;
  color: var(--indigo);
}

.success-panel p {
  margin: 0;
  color: var(--muted);
}

/* Hub */
.hub {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.hub-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hub-hero h1 {
  font-size: clamp(1.6rem, 5vw, 2rem);
  color: var(--indigo);
  margin: 1rem 0 0.5rem;
  letter-spacing: -0.02em;
}

.hub-hero p { color: var(--muted); margin: 0; }

.quiz-list {
  display: grid;
  gap: 1rem;
}

.quiz-tile {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.quiz-tile:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.quiz-tile h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: var(--indigo);
}

.quiz-tile p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.quiz-tile .chip {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--indigo);
  background: var(--lino-soft);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
}

/* Footer */
.site-footer {
  background: var(--indigo);
  color: rgba(242, 236, 225, 0.85);
  padding: 1.5rem 1rem calc(1.5rem + var(--safe-bottom));
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.5;
}

body.has-tabbar .site-footer,
.site-footer.footer-collapsed {
  display: none;
}

.site-footer .logo {
  height: 28px;
  width: auto;
  margin: 0 auto 0.85rem;
  opacity: 0.95;
}

.site-footer p { margin: 0; max-width: 36rem; margin-inline: auto; }
.site-footer a { color: var(--white); }

/* Loading */
.loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* Fixed phone-style bottom tab bar */
.app-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 0.35rem 0.5rem var(--safe-bottom);
  padding-left: calc(0.5rem + var(--safe-left));
  padding-right: calc(0.5rem + var(--safe-right));
  background: rgba(242, 236, 225, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(79, 81, 120, 0.08);
}

.app-tabbar[hidden] {
  display: none !important;
}

.tabbar-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--indigo);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 48px;
  padding: 0.25rem 0.35rem;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.tabbar-btn:hover {
  background: rgba(79, 81, 120, 0.08);
}

.tabbar-btn:active {
  transform: scale(0.94);
  background: rgba(201, 126, 135, 0.18);
  color: var(--rosa);
}

.tabbar-btn:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

.tab-icon {
  display: block;
  flex-shrink: 0;
}

.tab-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: inherit;
  opacity: 0.9;
}

/* Disclaimer modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  padding-left: calc(1.25rem + var(--safe-left));
  padding-right: calc(1.25rem + var(--safe-right));
  background: rgba(79, 81, 120, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

.modal-dialog {
  width: 100%;
  max-width: 420px;
  max-height: min(80dvh, 560px);
  overflow: auto;
  background: var(--marfil);
  color: var(--indigo);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--indigo);
}

.modal-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--indigo);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease;
}

.modal-close:hover {
  background: rgba(79, 81, 120, 0.1);
}

.modal-close:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

.modal-body {
  padding: 1rem 1.1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--indigo);
  overflow: auto;
}

.modal-body p {
  margin: 0 0 0.85rem;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-footer {
  padding: 0.75rem 1.1rem 1.1rem;
  border-top: 1px solid var(--border);
}
