/* wellness.css — Oneness Lifestyles · The Wellness Survey (batch 17, v2.0.16).
   A gentle opt-in, ten quiet questions, and an optional on-device upload —
   everything held privately on the person's own phone. No network calls.
   Palette tokens are byte-identical to the frozen reference
   (captures/site/styles.css). WCAG: text >= 18px, contrast >= 4.5:1,
   touch targets >= 44px, keyboard reachable, focus visible,
   reduced-motion honored. */

/* ---------- Brand palette (from captures/site/styles.css, byte-identical) ---------- */
:root {
  --brand-blue: #283890;   /* deep blue — primary (theme-color) */
  --brand-green: #6dbc45;  /* vibrant lime green — accent CTA */
  --brand-sand: #c1a178;   /* warm sand — accent */
  --brand-teal: #25c4b8;   /* fun accent */
  --brand-pink: #ff4d8d;   /* fun accent */
  --bg: #f7faff;           /* page background */
  --surface: #ffffff;      /* cards / surfaces */
  --text: #141414;         /* body text */
  --text-2: #3f3f3f;       /* secondary text */
  --line: #dfe5f6;         /* soft blue-grey divider */

  /* WCAG-safe derivations (frozen tokens above are unchanged) */
  --brand-green-deep: #5fae3d;  /* green pill hover (from reference CSS) */
  --brand-green-text: #357a24;  /* link green, >= 4.5:1 on white/surface */
  --brand-sand-light: #e0cbaa;  /* footer link sand, >= 4.5:1 on brand blue */
  --brand-teal-text: #0a6b63;  /* dark teal kicker, >= 4.5:1 on white */
}

/* ---------- Base / reset ---------- */
* {
  box-sizing: border-box;
}

html {
  font-size: 18px;   /* WCAG: root 18px so 1rem = 18px and no text falls below the floor */
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;   /* WCAG: base text >= 18px */
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Accessibility: visible focus + skip link ---------- */
:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
}

.site-footer :focus-visible {
  outline-color: var(--brand-sand-light);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  display: inline-block;
  padding: 12px 20px;
  min-height: 44px;
  background-color: var(--brand-blue);
  color: #ffffff;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus-visible {
  left: 0;
  outline-offset: 0;
}

/* ---------- Layout container ---------- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background-color: var(--surface);
  border-bottom: 4px solid var(--brand-sand);
}

.site-name {
  margin: 1em 0;
  color: var(--brand-blue);
  font-weight: bold;
  letter-spacing: 0.04em;
}

.site-name a {
  display: inline-block;
  padding: 10px 0;          /* WCAG: comfortable touch target */
  color: var(--brand-blue);
  text-decoration: none;
}

/* ---------- Survey hero ---------- */
.survey-hero {
  text-align: center;
  padding: 56px 20px 20px;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(37, 196, 184, 0.24), transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 77, 141, 0.16), transparent 55%),
    linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%);
}

.survey-kicker {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--brand-teal-text);   /* >= 4.5:1 on bg */
}

.survey-heading {
  margin: 0 0 14px;
  font-size: 2.2rem;
  color: var(--brand-blue);
}

.survey-lede {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-2);
}

/* Welcome-back card for returning visitors (the .stored-note look) */
.survey-welcome {
  max-width: 560px;
  margin: 22px auto 0;
  padding: 14px 16px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-sand);
  border-radius: 12px;
  color: var(--text-2);
}

/* ---------- Survey section / card ---------- */
.survey-section {
  padding: 32px 20px 72px;
}

.survey-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 36px 26px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(20, 20, 20, 0.08);
}

/* ---------- Survey form ---------- */
.survey-form {
  margin: 0;
}

.survey-label {
  display: block;
  margin: 18px 0 8px;
  font-weight: bold;
  color: var(--text);
}

.survey-label:first-of-type {
  margin-top: 0;
}

.survey-input {
  display: block;
  width: 100%;
  min-height: 48px;               /* WCAG: touch target >= 44px */
  padding: 10px 16px;
  font: inherit;
  color: var(--text);
  background-color: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
}

.survey-input:focus-visible {
  border-color: var(--brand-blue);
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
}

.survey-feedback {
  margin: 12px 0 0;
  min-height: 1.6em;
  color: var(--text-2);
}

/* ---------- Consent block ---------- */
.consent-block {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 2px solid var(--line);
}

.consent-checkbox {
  width: 24px;
  height: 24px;
  margin: 0 12px 0 2px;
  accent-color: var(--brand-blue);
  vertical-align: middle;
}

.consent-label {
  display: inline-block;
  min-height: 44px;               /* WCAG: touch target >= 44px */
  line-height: 1.5;
  vertical-align: middle;
  font-weight: bold;
  color: var(--text);
  cursor: pointer;
}

.consent-statement {
  margin: 14px 0 0;
  color: var(--text);
}

.consent-note {
  margin: 8px 0 0;
  color: var(--text-2);
}

/* ---------- Questions (fieldsets) ---------- */
.question {
  margin: 0 0 28px;
  padding: 0;
  border: none;
}

.question-text {
  padding: 0;
  margin: 0;
}

.question-label {
  display: block;
  font-weight: bold;
  font-size: 1.125rem;            /* >= 18px (WCAG floor) */
  color: var(--text);
}

.question-hint {
  display: block;
  margin-top: 4px;
  font-size: 1rem;                /* >= 18px (WCAG floor) */
  font-style: italic;
  color: var(--text-2);
}

.question.is-missing {
  box-shadow: 0 0 0 3px rgba(255, 77, 141, 0.35);
  border-radius: 8px;
}

/* ---------- Answer pills (the .choice-btn look) ---------- */
.answer-list {
  margin-top: 12px;
}

.answer-pill {
  display: block;
  width: 100%;
  min-height: 48px;               /* WCAG: touch target >= 44px */
  margin: 0 0 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: bold;
  text-align: left;
  color: var(--brand-blue);
  background-color: var(--surface);
  border: 2px solid var(--brand-blue);
  border-radius: 999px;
  cursor: pointer;
}

.answer-pill:last-child {
  margin-bottom: 0;
}

.answer-pill:hover {
  background-color: var(--bg);
}

/* Visually-hidden radio inputs, kept focusable for the keyboard.
   States are driven by the adjacent-sibling combinator — no :has(). */
.answer-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.answer-input:checked + .answer-pill {
  background-color: var(--bg);
  border-color: var(--brand-blue);
}

.answer-input:focus-visible + .answer-pill {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
}

/* ---------- Optional upload ---------- */
.upload-block {
  border-top: 2px solid var(--line);
  padding-top: 24px;
}

.upload-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.upload-trigger {
  display: block;
  width: 100%;
  margin: 14px 0 0;
  min-height: 48px;
  cursor: pointer;
}

.upload-meta {
  margin: 12px 0 0;
  color: var(--text-2);
}

.upload-remove {
  display: block;
  width: 100%;
  margin: 12px 0 0;
  min-height: 48px;
  cursor: pointer;
}

.upload-note {
  margin: 12px 0 0;
  color: var(--text-2);
}

/* ---------- Disclaimer + no-JS note ---------- */
.survey-disclaimer {
  margin: 22px 0 0;
  padding: 14px 16px;
  background-color: var(--bg);
  border-left: 4px solid var(--brand-sand);
  border-radius: 8px;
  color: var(--text-2);
}

.noscript-note {
  margin: 0 0 40px;
  text-align: center;
  color: var(--text-2);
}

/* ---------- Success ---------- */
.success-heading {
  margin: 0 0 14px;
  font-size: 1.6rem;
  color: var(--brand-blue);
  line-height: 1.3;
}

.success-note {
  margin: 14px 0 0;
  color: var(--text-2);
}

/* ---------- Sign-off ---------- */
.signoff {
  margin: 26px 0 0;
  padding: 22px 18px;
  background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
}

.signoff-text {
  margin: 0;
  font-size: 1.15rem;             /* >= 18px (WCAG floor) */
  font-weight: bold;
  color: var(--brand-blue);
}

/* ---------- Skip + back link ---------- */
.optin-skip {
  margin: 22px 0 0;
  color: var(--text-2);
}

.survey-back {
  margin: 22px 0 0;
}

.survey-back a,
.optin-skip a {
  display: inline-block;
  padding: 12px 0;               /* WCAG: comfortable touch target */
  color: var(--brand-green-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Small print: the gentle medical note at the foot of the page. */
.site-footer p.footer-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
  color: var(--brand-sand-light);
  max-width: 34em;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Links ---------- */
a {
  color: var(--brand-green-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Buttons (brand lime green — dark text for readable contrast) ---------- */
.btn {
  display: inline-block;
  padding: 12px 30px;
  min-height: 44px;               /* WCAG: touch target >= 44px */
  border-radius: 999px;
  background-color: var(--brand-green);
  color: var(--text);             /* >= 4.5:1 on brand green */
  font-weight: bold;
  text-decoration: none;
  font-size: 1.125rem;            /* >= 18px (WCAG floor) */
  transition: background-color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  background-color: var(--brand-green-deep);
}

.btn-ghost {
  background-color: var(--surface);
  border: 2px solid var(--brand-blue);
  color: var(--brand-blue);       /* >= 4.5:1 on white */
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background-color: var(--bg);
  border-color: var(--brand-blue);
}

.btn-block {
  display: block;
  width: 100%;
  margin: 14px 0 0;
  min-height: 48px;
  cursor: pointer;
  text-align: center;
}

/* ---------- AMA Wellness Bot CTA ---------- */
.bot-cta {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.bot-cta-text {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--text-2);
}

.btn-telegram {
  background-color: #2AABEE;  /* Telegram blue — brand colour of the app */
  color: #ffffff;             /* >= 4.5:1 on Telegram blue */
}

.btn-telegram:hover,
.btn-telegram:focus-visible {
  background-color: #229ED9;
}

.bot-cta-note {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--text-2);
}

/* ---------- AMA Wellness Bot — floating button (always visible) ---------- */
.bot-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #2AABEE;  /* Telegram blue */
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease;
  z-index: 100;
}

.bot-float:hover,
.bot-float:focus-visible {
  background-color: #229ED9;
  transform: scale(1.08);
}

.bot-float:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .bot-float {
    transition: none;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 24px;
  background-color: var(--brand-blue);
  color: #e7ebfa;      /* >= 4.5:1 on brand blue */
  text-align: center;
  font-size: 1rem;     /* 1rem = 18px (root is 18px); >= WCAG floor */
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  display: inline-block;
  padding: 8px 4px;
  color: var(--brand-sand-light);  /* >= 4.5:1 on brand blue */
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Hidden (always wins, even over display set elsewhere) ---------- */
[hidden] {
  display: none !important;
}

/* ---------- Responsive (mobile-first; text never below 18px) ---------- */
@media (min-width: 1024px) {
  .survey-hero {
    padding: 90px 24px 24px;
  }
  .survey-heading {
    font-size: 2.8rem;
  }
  .survey-section {
    padding: 40px 24px 96px;
  }
  .survey-card {
    padding: 44px 40px;
  }
}

/* ---------- JS reveal (only active when JS is on) ---------- */
.js-enabled .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.js-enabled .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-enabled .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
