/* No Small Ambition survey app styles.
   Rides the child theme's tokens.css (colour/space/type vars) and fluid root.
   Button, input, option, likert and progress state rules live in tokens.css;
   this file adds the survey-specific layout on top. */

.nsa-survey {
  max-width: 26.25rem; /* 420 · phone-first flow, comfortable on desktop */
  margin: 0 auto;
  padding: 0 var(--gutter) var(--space-2xl);
  color: var(--body);
  font-family: Inter, sans-serif;
  font-size: var(--text-body-s);
  line-height: 1.6;
}

/* Chrome */
.nsa-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-s) 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-m);
}
.nsa-chrome__wordmark {
  font: 600 0.9375rem/1.3 Fraunces, serif;
  color: var(--ink);
  text-decoration: none;
}
.nsa-chrome__exit {
  font: 500 var(--text-caption)/1.4 Inter, sans-serif;
  color: var(--muted);
  text-decoration: none;
}
.nsa-chrome__exit:hover { color: var(--plum-600); }

/* Progress */
.nsa-progress-block { margin-bottom: var(--space-m); }
.nsa-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-s);
  margin-bottom: var(--space-2xs);
}
.nsa-progress-row__label {
  font: 500 var(--text-caption)/1.4 Inter, sans-serif;
  color: var(--plum-600);
}
.nsa-progress-row__label:focus { outline: none; }
.nsa-progress-row__step {
  font: 400 var(--text-micro)/1.45 Inter, sans-serif;
  color: var(--muted);
}
.progress {
  height: 0.375rem;
  border-radius: var(--radius-pill);
  background: var(--line);
  overflow: hidden;
}
.progress--on-tint { background: var(--white); }
.progress__fill {
  height: 100%;
  width: calc(var(--step) / var(--total, 8) * 100%);
  border-radius: var(--radius-pill);
  background: var(--plum-600);
  transition: width 300ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .progress__fill { transition: none; }
}

/* Content */
.nsa-main { display: block; }
.nsa-main--centred { text-align: center; }
.nsa-eyebrow {
  font: 600 var(--text-eyebrow)/1.35 Inter, sans-serif;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--plum-600);
  margin: var(--space-m) 0 var(--space-xs);
}
.nsa-title {
  font: 600 1.625rem/1.25 Fraunces, serif;
  color: var(--ink);
  margin: 0 0 var(--space-s);
}
.nsa-title:focus { outline: none; }
.nsa-subheading {
  font: 600 1.125rem/1.32 Fraunces, serif;
  color: var(--ink);
  margin: var(--space-l) 0 var(--space-s);
}
.nsa-body { margin: 0 0 var(--space-s); }
.nsa-section-intro {
  font-size: var(--text-body-xs);
  color: var(--muted);
  margin: 0 0 var(--space-m);
}
.nsa-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-m);
}
.nsa-bullets li {
  position: relative;
  padding-left: 1.25rem;
  font-size: var(--text-body-xs);
  margin-bottom: var(--space-2xs);
}
.nsa-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--plum-600);
}

/* Note card base styles come from the child theme's tokens.css */
.nsa-survey .note { margin: 0 0 var(--space-m); }
.note--centred { text-align: center; }

/* Questions */
.nsa-question {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-l);
  min-width: 0;
}
.nsa-question__legend {
  display: block;
  font: 500 var(--text-question)/1.5 Inter, sans-serif;
  color: var(--ink);
  margin-bottom: var(--space-xs);
  padding: 0;
}

/* Option rows: real inputs, visually hidden, label carries the style */
.nsa-visually-hidden-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.option {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.8125rem var(--space-s);
  margin-bottom: var(--space-2xs);
  cursor: pointer;
  font-size: var(--text-body-xs);
  transition: border-color 120ms ease-out, background-color 120ms ease-out;
}
.option__control {
  flex: 0 0 auto;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid var(--line);
  background: var(--white);
  transition: border-color 120ms ease-out, background-color 120ms ease-out;
}
.option--radio .option__control { border-radius: 50%; }
.option--checkbox .option__control { border-radius: 0.25rem; }
.option.is-selected .option__label { font-weight: 500; color: var(--ink); }
.option--radio.is-selected .option__control {
  border-color: var(--plum-600);
  background: radial-gradient(circle, var(--plum-600) 0 40%, var(--white) 45%);
}
.option--checkbox.is-selected .option__control {
  border-color: var(--plum-600);
  background: var(--plum-600) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-6" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>') center / 0.75rem no-repeat;
}
.option:has(input:focus-visible) {
  border-color: var(--plum-600);
  box-shadow: 0 0 0 3px var(--ring);
}

/* Likert / percent scales */
.likert {
  display: flex;
  gap: var(--space-2xs);
}
.likert__cell {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--white);
  font: 500 var(--text-body-xs)/1 Inter, sans-serif;
  color: var(--body);
  cursor: pointer;
  transition: border-color 120ms ease-out, background-color 120ms ease-out, color 120ms ease-out;
}
.likert__cell:has(input:focus-visible) {
  border-color: var(--plum-600);
  box-shadow: 0 0 0 3px var(--ring);
}
.likert__anchors {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2xs);
  font-size: var(--text-micro);
  color: var(--muted);
}

/* Inputs */
.input, .select {
  width: 100%;
  font: 400 var(--text-body-xs)/1.55 Inter, sans-serif;
  color: var(--ink);
  padding: 0.8125rem var(--space-s);
}
.select {
  appearance: none;
  min-height: 3rem;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M4 6l4 4 4-4" fill="none" stroke="%236E6774" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-repeat: no-repeat;
  background-position: right var(--space-s) center;
  background-size: 1rem;
}
.input--textarea {
  min-height: 6.875rem;
  border-radius: var(--radius-m);
  resize: vertical;
}
.input--short { min-height: 4rem; margin-top: var(--space-2xs); }

/* Country quick-finder combobox */
.nsa-combobox { position: relative; }
.nsa-combobox__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  max-height: 16rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  box-shadow: 0 8px 24px rgba(36, 30, 40, 0.12);
}
.nsa-combobox__option {
  padding: 0.5625rem 0.75rem;
  border-radius: 0.375rem;
  font-size: var(--text-body-xs);
  cursor: pointer;
}
.nsa-combobox__option:hover,
.nsa-combobox__option.is-active {
  background: var(--plum-tint);
  color: var(--plum-600);
}
.nsa-combobox__option[aria-selected="true"] {
  font-weight: 500;
  color: var(--plum-600);
}

/* Conditional reveal (Q25) */
.nsa-conditional {
  background: var(--plum-tint);
  border-left: 3px solid var(--plum-600);
  border-radius: var(--radius-m);
  padding: var(--space-s);
  margin-top: calc(-1 * var(--space-s));
}

/* Actions */
.nsa-btn-full {
  display: block;
  width: 100%;
  border: 0;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  margin-top: var(--space-m);
}
.btn--secondary.nsa-btn-full { border: 1.5px solid var(--plum-600); }
.nsa-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-s);
}
.nsa-back {
  font: 500 var(--text-caption)/1.4 Inter, sans-serif;
  color: var(--muted);
  text-decoration: none;
}
.nsa-back:hover { color: var(--plum-600); }
.nsa-microcopy {
  font-size: var(--text-micro);
  color: var(--muted);
}
.nsa-microcopy--centred {
  display: block;
  text-align: center;
  margin-top: var(--space-xs);
}
.nsa-text-link {
  font: 500 var(--text-caption)/1.4 Inter, sans-serif;
  color: var(--muted);
}
.nsa-text-link:hover { color: var(--plum-600); }
.nsa-error {
  background: var(--plum-tint);
  border-left: 3px solid var(--plum-600);
  border-radius: var(--radius-m);
  padding: var(--space-xs) var(--space-s);
  font-size: var(--text-body-xs);
  color: var(--ink);
}

/* Thank-you opt-in email capture */
.nsa-subscribe {
  background: var(--plum-tint);
  border-radius: var(--radius-l);
  padding: var(--space-m);
  margin: var(--space-l) 0 0;
  text-align: left;
}
.nsa-subscribe__title {
  font: 600 var(--text-card-title)/1.32 Fraunces, serif;
  color: var(--ink);
  margin: 0 0 0.25rem;
}
.nsa-subscribe__hint {
  font-size: var(--text-caption);
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 var(--space-s);
}
.nsa-subscribe__form {
  display: flex;
  gap: var(--space-2xs);
  flex-wrap: wrap;
}
.nsa-subscribe__input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.75rem var(--space-s);
  font-size: var(--text-body-xs);
}
.nsa-subscribe__btn {
  flex: 0 0 auto;
  border: 0;
  cursor: pointer;
}
.nsa-subscribe__msg {
  font-size: var(--text-caption);
  margin: var(--space-2xs) 0 0;
  min-height: 1em;
}
.nsa-subscribe__msg.is-error { color: var(--plum-700); }
.nsa-subscribe.is-done { text-align: center; }
.nsa-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
}

/* Thank you */
.nsa-success-mark {
  width: 4rem;
  height: 4rem;
  margin: var(--space-l) auto var(--space-m);
  border-radius: 50%;
  background: var(--plum-tint);
  color: var(--plum-600);
  font-size: 1.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nsa-main--centred .nsa-btn-full { margin-top: var(--space-l); }

/* Sheets */
.nsa-overlay { position: fixed; inset: 0; z-index: 9999; }
.nsa-scrim { position: absolute; inset: 0; background: var(--scrim); }
.nsa-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--white);
  border-radius: 1.5rem 1.5rem 0 0;
  padding: var(--space-s) var(--space-m) var(--space-l);
  max-width: 26.25rem;
  margin: 0 auto;
  animation: nsa-slide-up 300ms ease-out;
}
@keyframes nsa-slide-up {
  from { transform: translateY(2rem); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .nsa-sheet { animation: nsa-fade 200ms ease-out; }
  @keyframes nsa-fade { from { opacity: 0; } to { opacity: 1; } }
}
@media (min-width: 768px) {
  /* Centred dialog on desktop per the modal mocks (440px, stacked buttons) */
  .nsa-sheet {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    border-radius: var(--radius-xl);
    max-width: 27.5rem;
    padding: 2.25rem 2.25rem 2rem;
    box-shadow: 0 0.75rem 1.25rem rgba(0, 0, 0, 0.25);
  }
  .nsa-sheet__grabber { display: none; }
  .nsa-sheet__title { font-size: 1.5rem; }
  .nsa-sheet__panel { padding: 0.875rem 1rem; }
  .nsa-sheet__panel .progress--on-tint { background: var(--line); }
  @keyframes nsa-slide-up {
    from { transform: translateY(calc(-50% + 1rem)); opacity: 0; }
    to   { transform: translateY(-50%); opacity: 1; }
  }
}

/* ---- Desktop: card-on-cream layout (Figma desktop survey frames) ---- */
@media (min-width: 768px) {
  body:has(.nsa-survey) { background: var(--cream); }

  .nsa-survey {
    max-width: 42.5rem; /* 680 card */
    padding: 3rem var(--gutter) 4.5rem;
  }

  /* Progress sits above the card */
  .nsa-progress-block { margin-bottom: 1.25rem; }
  .nsa-progress-row { margin-bottom: 0.5rem; }
  .nsa-progress-row__step { font-size: var(--text-caption); }

  /* The step content becomes a white card */
  .nsa-main {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
  }

  .nsa-title { font-size: 2rem; }
  .nsa-question { margin-bottom: 1.75rem; }
  .option { margin-bottom: var(--space-xs); }
  .option__control { width: 1.25rem; height: 1.25rem; }
  .option--checkbox .option__control { border-radius: 0.375rem; }

  .likert { gap: 0.5rem; }
  .likert__cell { min-height: 3rem; font-size: var(--text-body-s); }
  .likert--percent { gap: 0.375rem; }
  .likert--percent .likert__cell { min-height: 2.75rem; font-size: var(--text-body-xs); }
  .likert__anchors { font-size: var(--text-caption); }

  .nsa-btn-full { margin-top: 2.25rem; }
  .nsa-bottom-row { margin-top: var(--space-xs); }

  /* Thank-you: narrower centred card, auto-width button */
  .nsa-main--centred {
    max-width: 35rem;
    margin-inline: auto;
    padding: 3rem;
  }
  .nsa-main--centred .nsa-btn-full { display: inline-block; width: auto; }
  .nsa-success-mark { margin-top: 0; }
}
.nsa-sheet:focus { outline: none; } /* focused for a11y on open; no visible ring on the panel itself */
.nsa-sheet__grabber {
  width: 2.25rem;
  height: 0.25rem;
  border-radius: var(--radius-pill);
  background: var(--line);
  margin: 0 auto var(--space-s);
}
.nsa-sheet__title {
  font: 600 var(--text-sheet-title)/1.3 Fraunces, serif;
  color: var(--ink);
  margin: 0 0 var(--space-xs);
}
.nsa-sheet__body { margin: 0 0 var(--space-xs); }
.nsa-sheet__caption {
  font-size: var(--text-caption);
  color: var(--muted);
  margin: 0 0 var(--space-2xs);
}
.nsa-sheet__panel {
  background: var(--plum-tint);
  border-radius: var(--radius-m);
  padding: var(--space-s);
  margin: var(--space-s) 0;
}
.nsa-sheet__panel-label {
  font: 500 var(--text-caption)/1.4 Inter, sans-serif;
  color: var(--plum-600);
  margin: 0 0 var(--space-2xs);
}
.nsa-sheet__link-row {
  text-align: center;
  margin-top: var(--space-s);
}
.nsa-sheet .nsa-btn-full { margin-top: var(--space-xs); }
.nsa-no-scroll { overflow: hidden; }

/* Utility */
.nsa-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Closed state */
.nsa-survey--closed { text-align: center; padding-top: var(--space-3xl); }
