/* ==========================================================================
   GoTeens — parent survey, consent banner and floating survey button
   Additive only: css/style.css is untouched. Everything here reuses the
   variables, radii and button classes already defined there, so the survey
   reads as part of the page rather than a bolted-on widget.
   ========================================================================== */

/* =============================== SURVEY ================================ */
/* Same treatment as .apply, but sitting on the white "parents" background,
   so it takes the light-grey card fill instead of a dark-on-light inversion. */
.survey {
  background: var(--bg-light);
  border: 1px solid var(--line);
  border-radius: clamp(20px, 3vw, 30px);
  padding: clamp(1.6rem, 4vw, 3rem);
  box-shadow: var(--card-shadow);
  scroll-margin-top: 90px;
}

/* One step is on screen at a time; the rest carry [hidden] — style.css already
   forces display:none on [hidden], so no extra rule is needed for those. */
.survey__step { display: grid; gap: 1.2rem; }
.survey__step h2, .survey__step h3 { margin: 0; }
.survey__intro h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.survey__intro .lead { margin-top: 0; }
.survey__note {
  margin: 0; padding: 0.95rem 1.1rem; border-radius: 16px;
  background: var(--tint); border: 1px solid rgba(24, 105, 34, 0.18);
  color: var(--text); font-weight: 600; font-size: 0.97rem;
}
.survey__intro .btn { justify-self: start; }

/* ------------------------------- Progress ------------------------------- */
.survey__progress { display: grid; gap: 0.55rem; margin-bottom: 1.6rem; }
.survey__count {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  letter-spacing: 0.03em; text-transform: uppercase; color: var(--primary);
}
.survey__bar { height: 6px; border-radius: 999px; background: rgba(24, 105, 34, 0.14); overflow: hidden; }
.survey__bar-fill {
  height: 100%; width: 0%; border-radius: 999px; background: var(--primary);
  transition: width 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------- Question ------------------------------- */
.sv-q { font-size: clamp(1.22rem, 2.8vw, 1.6rem); font-family: var(--font-display); font-weight: 700; line-height: 1.3; }
.sv-hint { margin: 0; color: var(--text-secondary); font-size: 0.95rem; font-weight: 600; }

/* Option buttons — same visual language as .card, sized for thumbs. */
.sv-opts { display: grid; gap: 0.6rem; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
.sv-opt {
  display: flex; align-items: center; gap: 0.8rem; width: 100%;
  min-height: 56px; padding: 0.85rem 1.1rem; text-align: left;
  background: var(--white); border: 1.5px solid var(--line); border-radius: 16px;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; line-height: 1.35;
  color: var(--text); cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}
.sv-opt:hover { border-color: var(--primary); background: var(--tint); }
.sv-opt:active { transform: scale(0.99); }
.sv-opt:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24, 105, 34, 0.18); }
.sv-opt.is-selected { border-color: var(--primary); background: var(--tint); color: var(--primary-dark); }

/* Leading marker: a tick for single/multi choice, a rank number for Q5. */
.sv-opt__mark {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--white); color: transparent;
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.sv-opt__mark svg { width: 16px; height: 16px; }
.sv-opt.is-selected .sv-opt__mark { background: var(--primary); border-color: var(--primary); color: var(--white); }
.sv-opt--multi .sv-opt__mark { border-radius: 9px; }
.sv-opt__label { flex: 1 1 auto; }

/* Q5 carries sixteen options — two columns once there is room for them. */
.sv-opts--rank { gap: 0.5rem; }
.sv-opts--rank .sv-opt { min-height: 52px; font-size: 0.96rem; padding: 0.7rem 0.95rem; }

/* Free-text and select steps reuse .field from style.css; spacing only here. */
.survey__step .field { margin: 0; }

/* ------------------------------ Navigation ------------------------------ */
.survey__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin-top: 0.4rem; }
.survey__nav .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.survey__nav .btn--primary[disabled]:hover { background: var(--primary); transform: none; }
.sv-back { background: transparent; border: 1.5px solid var(--line); color: var(--text-secondary); }
.sv-back:hover { background: var(--white); border-color: var(--primary); color: var(--primary); transform: none; }
.survey__status { color: #b42318; font-weight: 600; margin: 0; }
.survey__status:empty { display: none; }
.survey .spinner { border-color: rgba(255, 255, 255, 0.45); border-top-color: #fff; }
.survey.is-sending .spinner { display: inline-block; animation: spin 0.7s linear infinite; }

/* -------------------------------- Success ------------------------------- */
.survey__done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem; padding: clamp(1.5rem, 5vw, 3rem) 1rem; }
.survey__done-tick { color: var(--primary); }
.survey__done-tick svg { width: 64px; height: 64px; }
.survey__done h3 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 0; }
.survey__done p { margin: 0; color: var(--text-secondary); max-width: 30rem; }
.survey__done .btn { margin-top: 0.6rem; }

/* =========================== CONSENT BANNER ============================= */
.consent-banner {
  position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
  padding: 0.9rem var(--gutter);
  padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
  background: var(--bg-darker); color: rgba(255, 255, 255, 0.82);
  border-top: 1px solid var(--line-dark);
  box-shadow: 0 -14px 34px -24px rgba(0, 0, 0, 0.9);
}
.consent-banner__inner {
  width: 100%; max-width: var(--wrap); margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.2rem;
}
.consent-banner p { margin: 0; flex: 1 1 20rem; font-size: 0.92rem; line-height: 1.5; }
.consent-banner a { color: var(--primary-bright); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.consent-banner a:hover { color: var(--white); }
.consent-banner__actions { display: flex; gap: 0.55rem; margin-left: auto; }
.consent-banner .btn { padding: 0.6rem 1.15rem; min-height: 44px; font-size: 0.95rem; }

/* ========================= FLOATING SURVEY CTA ========================== */
/* --fab-gap is raised while the consent banner is up, so the button always
   clears it instead of sitting on top of it. */
:root { --fab-gap: 1.15rem; }
body.has-consent-banner { --fab-gap: 7.5rem; }

.survey-fab {
  position: fixed; z-index: 55;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--fab-gap) + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 0.55rem;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 0.85rem 1.4rem; min-height: 52px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.2;
  color: var(--white); background: var(--primary);
  box-shadow: 0 14px 30px -14px rgba(3, 18, 4, 0.7);
  animation: fab-pulse 2s ease-in-out infinite;
  transition: opacity 0.28s ease, visibility 0.28s ease, bottom 0.28s ease;
}
.survey-fab__icon { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.survey-fab__long { display: none; }
.survey-fab__short { display: inline; }
.survey-fab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--white), 0 0 0 6px var(--primary); }
.survey-fab.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* Slow breathe between the brand green and a slightly lighter mix of the same
   green, plus a soft glow. Both colours come from existing variables, and the
   mix stays dark enough to keep white label text above AA. */
@keyframes fab-pulse {
  0%, 100% {
    background: var(--primary);
    box-shadow: 0 14px 30px -14px rgba(3, 18, 4, 0.7), 0 0 0 0 var(--tint-bright);
  }
  50% {
    background: color-mix(in srgb, var(--primary) 80%, var(--primary-bright));
    box-shadow: 0 14px 30px -14px rgba(3, 18, 4, 0.7), 0 0 0 10px var(--tint-bright);
  }
}

/* ============================= RESPONSIVE ============================== */
@media (min-width: 640px) {
  .sv-opts--rank { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
  .survey-fab {
    left: auto; right: var(--gutter); transform: none;
    padding: 0.95rem 1.6rem; min-height: 56px;
  }
  .survey-fab__long { display: inline; }
  .survey-fab__short { display: none; }
  body.has-consent-banner { --fab-gap: 6rem; }
}

/* ============================ REDUCED MOTION =========================== */
@media (prefers-reduced-motion: reduce) {
  .survey__bar-fill { transition: none; }
  .sv-opt { transition: none; }
  .sv-opt:active { transform: none; }
  .survey-fab {
    animation: none;
    background: var(--primary);
    box-shadow: 0 14px 30px -14px rgba(3, 18, 4, 0.7);
    transition: none;
  }
  .survey.is-sending .spinner { animation: none; }
}
