/*
 * Snug Research renderer styles. Focused single column (560 to 680 px),
 * minimal chrome, WCAG 2.2 AA. League Spartan headings, EB Garamond body,
 * Snug gold accent. No em or en dashes anywhere.
 */

/*
 * THE SNUG PALETTE, NOT A SECOND ONE. Every value below is taken from
 * modules/soundmoney/learning/theme/tokens.php, which is what the Sound Money
 * learning renderer and the IFP quiz shell already wear. Nothing here is
 * invented: a survey that is one shade off the rest of the site reads as a
 * third-party form, which is exactly what the white card looked like.
 *
 * Ratios are computed, not guessed, and the figures are in the commit message.
 * The two that decide the design:
 *   border #6b6e82 on surface #20222b   3.15:1, clears the 3:1 that a control
 *                                       boundary needs. The old #3d3f4a was
 *                                       1.52:1 and failed.
 *   selected-surface on surface         1.10:1, which is why a selected tile
 *                                       can NEVER be shown by its background
 *                                       alone. It also takes the accent
 *                                       border, at 8.33:1.
 */
.snug-research {
  --rs-bg: #141418;            /* ifp-color-bg */
  --rs-surface: #20222b;       /* ifp-color-surface, the card */
  --rs-ink: #f1efe9;           /* ifp-color-text, 15.98:1 on bg */
  --rs-muted: #b4b2ab;         /* ifp-color-muted, 7.47:1 on surface */
  --rs-border: #6b6e82;        /* ifp-color-border, 3.15:1 on surface */
  --rs-gold: #e6b45a;          /* ifp-color-accent */
  --rs-gold-text: #e6b45a;     /* 8.33:1 on surface, so the accent IS the text */
  --rs-primary-bg: #e6b45a;
  --rs-primary-ink: #141418;   /* ifp-color-accent-text, 9.66:1 on the button */
  --rs-selected-bg: #2d2a1a;   /* ifp-color-selected-surface */
  --rs-focus: #e6b45a;         /* ifp-color-focus */
  color: var(--rs-ink);
  /* v1.9.619: this is a dark surface, so tell the browser, and native UI
     (form controls, autofill, scrollbars) renders for dark instead of a light
     default that would leave controls illegible. */
  color-scheme: dark;
  /* ITEM 5, v1.9.599: ONE surface. The page used to paint --rs-bg while the
     shell inside it painted --rs-surface, so at desktop, where the shell is
     capped at 680px and centred, a darker band showed either side and the
     survey read as a card inside another card. The page and the shell are
     now the same surface; --rs-bg is kept for the input fields, where a
     darker well is doing a real job. */
  background: var(--rs-surface);
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.5;
}

.snug-rs-shell {
  max-width: 680px;
  min-height: 60vh;
  margin: 0 auto;
  padding: 24px 16px 64px;
  box-sizing: border-box;
  color: var(--rs-ink);
}

.snug-research h1,
.snug-research h2,
.snug-rs-q {
  font-family: 'League Spartan', Arial, sans-serif;
  color: var(--rs-ink);
  line-height: 1.25;
}
.snug-rs-h { font-size: 24px; margin: 0 0 16px; }
.snug-rs-h2 { font-size: 20px; margin: 0 0 10px; }
.snug-rs-q { font-size: 21px; font-weight: 700; margin: 0 0 8px; padding: 0; }
.snug-rs-q-sub { font-size: 18px; }

.snug-rs-intro { font-size: 18px; margin: 0 0 14px; }
.snug-rs-note { font-size: 15px; color: var(--rs-muted); margin: 18px 0; }
.snug-rs-helper { font-size: 15px; color: var(--rs-muted); margin: 0 0 12px; }
.snug-rs-sec { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--rs-muted); margin: 0 0 6px; }
.snug-rs-progress { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--rs-muted); margin: 0 0 14px; }
/* Eyebrows and section labels all read from --rs-muted. The track line used
   the gold token and was the one label in a different colour on every
   screen it appeared on. */
.snug-rs-track { font-family: 'League Spartan', Arial, sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: var(--rs-muted); margin: 0 0 8px; }

/* ---- progress within a section, v1.9.598 -------------------------------
   The bar is decoration with a label beside it: the role and aria-valuetext
   carry the same sentence the sighted reader sees, so neither gets a worse
   version of the other. Height and colours are AA against the card: the fill
   is the accent at 8.33:1 and the trough is the border token at 3.15:1. */
.snug-rs-prog { margin: 0 0 14px; }
.snug-rs-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--rs-border);
  overflow: hidden;
}
.snug-rs-bar-fill {
  display: block;
  height: 100%;
  background: var(--rs-gold);
}
.snug-rs-screenof {
  font-size: 13px;
  color: var(--rs-muted);
  margin: 6px 0 0;
}

/* ---- the completion hub and the last screen, v1.9.598 ------------------ */
.snug-rs-flash {
  border-left: 3px solid var(--rs-gold);
  padding: 8px 0 8px 12px;
  margin: 0 0 16px;
  color: var(--rs-ink);
}
.snug-rs-donelist { list-style: none; margin: 0 0 16px; padding: 0; }
.snug-rs-done { font-size: 15px; color: var(--rs-muted); margin: 4px 0; }
.snug-rs-endnav { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
/* ITEM 3, v1.9.599: the final screen is three short lines and two buttons,
   and the shell's 60vh floor stretched it into a tall empty panel. It sizes
   to its content instead. A button is a button: no underline inside one,
   wherever the link styling came from. */
.snug-rs-final { min-height: 0; padding-bottom: 32px; }
.snug-rs-final .snug-rs-h { margin-bottom: 12px; }
.snug-research a.snug-rs-btn,
.snug-research a.snug-rs-btn:hover,
.snug-research a.snug-rs-btn:focus {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.snug-rs-field { border: 0; margin: 0 0 20px; padding: 0; }
.snug-rs-statement { border: 1px solid var(--rs-border); border-radius: 4px; padding: 16px; margin-bottom: 16px; }
/* A legend sits IN the border box by default, which is what punched the gap
   beside the area label. Floating it takes it out of the border run, so the
   top border is continuous and the label still reads as the group's name. */
.snug-rs-statement-label {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  padding: 0 0 6px;
  float: left;
  width: 100%;
}
.snug-rs-statement::after { content: ''; display: table; clear: both; }

.snug-rs-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  margin: 6px 0;
  border: 1px solid var(--rs-border);
  border-radius: 4px;
  cursor: pointer;
}
.snug-rs-opt:hover { border-color: var(--rs-gold); }
.snug-rs-input { width: 22px; height: 22px; min-width: 22px; margin: 0; accent-color: var(--rs-primary-bg); }
.snug-rs-opt-label { font-size: 18px; }
/* The background alone is 1.10:1 against the card, which is invisible to
   plenty of people and fails the 3:1 a control state needs. The accent border
   is what actually carries the selected state; the warm fill is support. */
.snug-rs-opt:has(.snug-rs-input:checked) {
  border-color: var(--rs-gold);
  box-shadow: inset 0 0 0 1px var(--rs-gold);
  background: var(--rs-selected-bg);
}

.snug-rs-text {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--rs-border);
  border-radius: 4px;
  background: var(--rs-bg);
  color: var(--rs-ink);
}
.snug-rs-text::placeholder, .snug-rs-optin-input::placeholder { color: var(--rs-muted); }
/* v1.9.619: browser autofill otherwise repaints the email and name fields with
   its own light background and dark text, overriding the dark tokens and
   producing an illegible field. Pin the fill to the surface tokens. */
.snug-rs-text:-webkit-autofill,
.snug-rs-optin-input:-webkit-autofill,
.snug-rs-text:-webkit-autofill:focus,
.snug-rs-optin-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--rs-ink);
  caret-color: var(--rs-ink);
  box-shadow: 0 0 0 1000px var(--rs-bg) inset;
}

.snug-rs-limit, .snug-rs-status { font-size: 15px; color: var(--rs-muted); margin: 10px 0 0; min-height: 1.2em; }

/* ---- over the limit, v1.9.600 -----------------------------------------
   The old message was a grey line inside the fieldset and the walkthrough
   read straight past it. This sits directly above the buttons, carries the
   accent border the rest of the survey uses for "look here", and leads with
   a bold sentence. Cream on the card is 13.78:1; the accent rule and the
   icon disc are non-text at 8.33:1, so both clear what they need to. */
.snug-rs-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--rs-gold);
  border-left-width: 4px;
  border-radius: 4px;
  background: var(--rs-selected-bg);
  color: var(--rs-ink);
  padding: 14px 16px;
  margin: 20px 0 0;
}
.snug-rs-alert[hidden] { display: none; }
.snug-rs-alert-icon {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--rs-gold);
  color: var(--rs-primary-ink);
  font-family: 'League Spartan', Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
}
.snug-rs-alert-body { flex: 1 1 auto; }
.snug-rs-alert-lead {
  font-family: 'League Spartan', Arial, sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 4px;
}
.snug-rs-alert-rest { font-size: 16px; margin: 0; }

/* A disabled control has to LOOK unavailable, not just refuse the click. */
.snug-rs-btn:disabled,
.snug-rs-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--rs-surface);
  color: var(--rs-muted);
  border-color: var(--rs-border);
}

.snug-rs-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.snug-rs-nav-right { display: flex; gap: 12px; align-items: center; margin-left: auto; }

.snug-rs-btn {
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  min-height: 44px;
  padding: 11px 22px;
  border: 1px solid var(--rs-border);
  border-radius: 4px;
  background: var(--rs-surface);
  color: var(--rs-ink);
  cursor: pointer;
}
.snug-rs-primary { background: var(--rs-primary-bg); color: var(--rs-primary-ink); border-color: var(--rs-primary-bg); }
.snug-rs-back, .snug-rs-skip { background: var(--rs-surface); color: var(--rs-ink); }
/* The disabled styling lives in one place, above, since v1.9.600. This rule
   sat further down the file and quietly won on source order, so a blocked
   Continue still showed a default cursor. */

.snug-rs-module { display: block; width: 100%; text-align: left; margin: 8px 0; }
.snug-rs-modchoices { margin: 12px 0; }
.snug-rs-module-skip { border-style: dashed; }

.snug-rs-section { border-top: 1px solid var(--rs-border); margin-top: 28px; padding-top: 20px; }
.snug-rs-link { color: var(--rs-ink); text-decoration: underline; text-decoration-color: var(--rs-gold); text-underline-offset: 3px; }

.snug-rs-optin { margin: 12px 0 0; }
.snug-rs-optin-heading { font-size: 18px; margin: 0 0 10px; }
.snug-rs-optin-label { display: block; font-size: 15px; color: var(--rs-muted); margin: 10px 0 4px; }
.snug-rs-optin-input { width: 100%; max-width: 360px; box-sizing: border-box; font: inherit; min-height: 44px; padding: 8px 12px; border: 1px solid var(--rs-border); border-radius: 4px; background: var(--rs-bg); color: var(--rs-ink); }

.snug-rs-preview { background: var(--rs-selected-bg); color: var(--rs-ink); border: 1px solid var(--rs-gold); border-radius: 4px; padding: 10px 14px; margin: 0 auto 16px; max-width: 680px; font-size: 15px; }
.snug-rs-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Off-screen honeypot. */
.snug-rs-hp-wrap { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* FOCUS, AND THE ONE PLACE IT IS NOT DRAWN.

   Every screen change moves focus to the question heading, because a screen
   reader user who is not told the screen changed is lost. That focus is
   PROGRAMMATIC: nobody tabbed to it, so a heavy box around the heading is
   reporting something the sighted reader did not do, and it looked like an
   error state. WCAG 2.4.7 is about keyboard focus being visible on things you
   can reach by keyboard; a tabindex="-1" heading is not in the tab order.

   So the outline is removed from exactly that case, on :focus AND on
   :focus-visible, scoped to this survey. Every interactive control keeps its
   ring. Same approach as IFP v0.9.0. */
/* ITEM 6, v1.9.599: outline-color is stated on its own line as well as in
   the shorthand. The shorthand alone was resolving to the element's own
   colour on some controls rather than to the token, so a focused link drew a
   near-cream ring instead of the Snug gold. Nothing in the theme overrides
   this: a sweep of every readable stylesheet on the live page found no other
   rule that sets a focus outline inside .snug-research. The control types are
   also named so specificity cannot be lost to a later theme rule. */
.snug-research :focus-visible,
.snug-research a:focus-visible,
.snug-research button:focus-visible,
.snug-research input:focus-visible,
.snug-research select:focus-visible,
.snug-research textarea:focus-visible {
  outline: 3px solid var(--rs-focus);
  outline-color: var(--rs-focus);
  outline-offset: 2px;
}
.snug-research [tabindex="-1"]:focus,
.snug-research [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }

@media (max-width: 620px) {
  .snug-rs-shell { padding: 20px 16px 56px; }
  .snug-rs-endnav { gap: 10px; }
  .snug-rs-h { font-size: 22px; }
  .snug-rs-q { font-size: 20px; }
  .snug-rs-nav { gap: 10px; }
  .snug-rs-btn { padding: 11px 18px; }
}

/* ─────────────────────────────────────────────────────────────────────
   v1.9.640: the not-open / closed landing.

   One template serves both states, so these rules are shared and only the
   pill differs. The module is a DARK surface, so the amber below is stated
   against it rather than borrowed from a light mockup: #d97706 measures
   4.97:1 on --rs-surface and 5.77:1 on --rs-bg, and the dark ink on the
   amber button is 5.77:1, so every pairing here clears AA.
   ───────────────────────────────────────────────────────────────────── */
.snug-research {
  /* The site's amber. Kept distinct from --rs-gold, which is the survey
     engine's own accent and stays the colour of Begin and Continue. */
  --rs-amber: #d97706;
}

.snug-rs-landing { max-width: 680px; }

.snug-rs-crumb {
  font-size: 14px;
  color: var(--rs-muted);
  margin: 0 0 18px;
}
.snug-rs-crumb-sep { margin: 0 8px; }
.snug-rs-crumb-link { color: var(--rs-muted); text-underline-offset: 3px; }
.snug-rs-crumb-link:hover,
.snug-rs-crumb-link:focus { color: var(--rs-ink); }

.snug-rs-landing-eyebrow {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rs-muted);
  margin: 0 0 10px;
}

.snug-rs-landing-title { margin: 0 0 14px; }

.snug-rs-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 11px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid var(--rs-border);
  color: var(--rs-ink);
}
.snug-rs-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
/* The dot carries the state colour; the label stays at full contrast so
   the meaning never rests on colour alone. */
.snug-rs-pill--soon   { border-color: var(--rs-amber); }
.snug-rs-pill--soon .snug-rs-pill-dot   { background: var(--rs-amber); }
.snug-rs-pill--closed .snug-rs-pill-dot { background: var(--rs-muted); }

.snug-rs-landing-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--rs-ink);
  margin: 20px 0 0;
}
.snug-rs-landing-status {
  font-size: 16px;
  line-height: 1.65;
  color: var(--rs-muted);
  margin: 14px 0 0;
}

.snug-rs-details {
  margin: 26px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--rs-border);
  border-bottom: 1px solid var(--rs-border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 24px;
}
/* Each label/value pair is one grid cell. Without the wrapper every dt and
   dd is its own item and three columns interleave labels with values. */
.snug-rs-detail { min-width: 0; }
.snug-rs-details dt {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rs-muted);
  margin: 0 0 6px;
}
.snug-rs-details dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--rs-ink);
}
.snug-rs-details dd a { color: var(--rs-gold-text); text-underline-offset: 3px; }

.snug-rs-landing-actions { margin: 26px 0 0; }
.snug-rs-landing-privacy { margin: 16px 0 0; font-size: 15px; }
.snug-rs-landing-privacy a { color: var(--rs-muted); text-underline-offset: 3px; }
.snug-rs-landing-privacy a:hover,
.snug-rs-landing-privacy a:focus { color: var(--rs-ink); }

/* Phone: one column, and the details stack rather than squeezing three
   columns into 320px where every value would wrap mid-word. */
@media (max-width: 620px) {
  .snug-rs-details { grid-template-columns: 1fr; gap: 16px; }
  .snug-rs-landing-lead { font-size: 17px; }
  .snug-rs-landing-actions .snug-rs-btn { display: block; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .snug-research * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/*
 * The one session Turnstile widget. v1.9.642.
 *
 * It lives on body rather than inside the survey root, because every screen
 * change clears the root and a remounted widget means a new token. In
 * execute + interaction-only mode this host is empty for a visitor
 * Cloudflare is happy with, so it must take up no room until there is
 * actually a challenge inside it.
 */
.snug-rs-ts-host {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 9999;
}
.snug-rs-ts-host:empty { display: none; }
.snug-rs-ts-host > div:empty { display: none; }

/*
 * The single signup, signed in. v1.9.643.
 *
 * A respondent with an account sees who we will write to instead of an
 * empty box they have to fill in again. The override field stays hidden
 * until asked for, so this path renders no email input at all.
 */
.snug-rs-signedin {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  margin: 0 0 10px;
  border: 1px solid #30323c;
  border-radius: 6px;
  background: #1b1b20;
}
.snug-rs-signedin-label {
  font: 700 11px/1.4 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9a978f;
}
.snug-rs-signedin-name { font-weight: 700; color: #f1efe9; }
.snug-rs-signedin-email { font-size: 14px; color: #b4b2ab; }

.snug-rs-linkbtn {
  display: inline-block;
  padding: 0;
  margin: 0 0 10px;
  border: 0;
  background: none;
  color: #c9a45a;
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}
.snug-rs-linkbtn:hover { color: #b8923f; }

.snug-rs-optin-override[hidden] { display: none; }
