/* ==========================================================================
   Peeranha components
   Built only from tokens.css. If you need a value that isn't a token, add the
   token first (and to Figma) - don't hard-code it here.
   Class names: .component, .component__part, .component--variant (BEM).
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-family-brand);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  /* keep the footer at the bottom on short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, p { margin: 0; }
img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Typography: one class per Figma text style ---------- */
.text-display { font-size: var(--font-size-6xl); font-weight: var(--font-weight-semibold); line-height: 1.1;  letter-spacing: -0.02em; }
.text-h1      { font-size: var(--font-size-5xl); font-weight: var(--font-weight-semibold); line-height: 1.15; letter-spacing: -0.015em; }
.text-h2      { font-size: var(--font-size-4xl); font-weight: var(--font-weight-semibold); line-height: 1.2;  letter-spacing: -0.01em; }
.text-h3      { font-size: var(--font-size-3xl); font-weight: var(--font-weight-semibold); line-height: 1.25; letter-spacing: -0.005em; }
.text-h4      { font-size: var(--font-size-2xl); font-weight: var(--font-weight-semibold); line-height: 1.3; }
.text-h5      { font-size: var(--font-size-xl);  font-weight: var(--font-weight-semibold); line-height: 1.35; }

.text-body-lg { font-size: var(--font-size-lg); line-height: var(--line-height-body); }
.text-body-md { font-size: var(--font-size-md); line-height: var(--line-height-body); }
.text-body-sm { font-size: var(--font-size-sm); line-height: var(--line-height-body); }
.text-body-xs { font-size: var(--font-size-xs); line-height: var(--line-height-body); }
.text-semibold { font-weight: var(--font-weight-semibold); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }

.text-label-lg { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); line-height: var(--line-height-label); }
.text-label-md { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); line-height: var(--line-height-label); }
.text-label-sm { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); line-height: var(--line-height-label); }

.text-overline {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

/* Page headings: add .text-h2--responsive to get H2 on desktop, H3 on mobile
   (as in the log in / sign up frames) */
@media (max-width: 767px) {
  .text-h2.text-h2--responsive { font-size: var(--font-size-3xl); line-height: 1.25; letter-spacing: -0.005em; }
  .text-overline { font-size: var(--font-size-xs); }
}

/* ---------- Link ---------- */
.link {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-position: from-font;
}
.link:hover { text-decoration-thickness: 2px; }
.link--strong { color: var(--color-text); font-weight: var(--font-weight-semibold); }
.link--strong:hover { text-decoration-thickness: 2px; }
.link--plain { color: inherit; }
.link--plain:hover { text-decoration-thickness: 2px; }
.link--inverse { color: var(--color-text-inverse); }
.link--inverse:hover { text-decoration-thickness: 2px; }

/* ---------- Button ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  /* 1px border drawn inside the Figma size (Figma strokes are inside) */
  padding: calc(var(--space-2) - 1px) calc(var(--space-3) - 1px);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-label);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, scale var(--duration-press) var(--ease-out);
}
/* Press: a slight squeeze so the button feels it was heard (uses `scale`, not transform) */
.button:active:not(:disabled):not([aria-disabled="true"]) { scale: 0.97; }
@media (prefers-reduced-motion: reduce) { .button:active { scale: 1; } }
.button--primary { background: var(--color-action); color: var(--color-action-text); }
.button--primary:hover { background: var(--color-action-hover); }
.button--secondary { background: var(--color-bg); color: var(--color-text); border-color: var(--color-border-strong); }
/* Hover: the stroke thickens to 2px inward (inset shadow), so the button doesn't grow or shift */
.button--secondary:hover { box-shadow: inset 0 0 0 1px var(--color-border-strong); }

/* Large: full-width form submit (log in, create account) */
.button--lg { padding: calc(var(--space-3) - 1px) calc(var(--space-8) - 1px); }
/* Small: mobile nav */
.button--sm { font-size: var(--font-size-sm); }
.button--block { display: flex; width: 100%; }

.button:disabled,
.button[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.button[aria-busy="true"] { cursor: progress; }

/* Text-style nav links in the header: semibold on hover (Figma annotation) */
.nav-link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--font-size-md);
  line-height: var(--line-height-body);
}
.nav-link:hover { font-weight: var(--font-weight-semibold); }
/* Current page (or, on the home page, the section on screen) */
.nav-link[aria-current] { font-weight: var(--font-weight-semibold); }
/* Reserve the semibold width (hidden copy of the label from data-label) so
   neighbours don't move when a link turns bold on hover. */
.nav-link[data-label] { display: inline-flex; flex-direction: column; align-items: center; }
.nav-link[data-label]::after {
  content: attr(data-label);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: var(--font-weight-semibold);
  user-select: none;
  pointer-events: none;
}

/* ---------- Form field ---------- */
.form { display: flex; flex-direction: column; gap: var(--space-6); }
.form__fields { display: flex; flex-direction: column; gap: var(--space-4); }
.form__fields--loose { gap: var(--space-5); }
.form__row { display: flex; gap: var(--space-4); }
.form__row > * { flex: 1 1 0; min-width: 0; }

.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field__label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-body);
  color: var(--color-text);
}
.field__label-row { display: flex; align-items: center; justify-content: space-between; }
.field__hint {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-body);
  color: var(--color-text-tertiary);
}
.field__aside { align-self: flex-end; font-size: var(--font-size-sm); }

.input,
.select {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
}
.input::placeholder { color: var(--color-text-tertiary); }
.input:hover, .select:hover { border-color: var(--neutral-500); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: 0 0 0 3px var(--deep-indigo-200);
}
.select {
  appearance: none;
  padding-right: calc(var(--space-3) + 24px + var(--space-2));
  background-image: url("../img/brand/icon-chevron-down.svg");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 24px;
}

/* Checkbox */
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: var(--font-size-sm); }
.checkbox input {
  appearance: none;
  flex: none;
  width: 18px; height: 18px;
  margin: 2px 0 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  cursor: pointer;
}
.checkbox input:checked {
  border-color: var(--color-action);
  background: var(--color-action) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 9.5l3 3 6-6.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}

/* ---------- Error states ---------- */
/* Field-level: set aria-invalid="true" on the input and swap the hint for
   a .field__error linked with aria-describedby. */
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.checkbox input[aria-invalid="true"] { border-color: var(--color-error); }
.input[aria-invalid="true"]:focus,
.select[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--red-100); }

.field__error {
  display: flex;
  gap: var(--space-1);
  align-items: flex-start;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-body);
  color: var(--color-error-text);
}
.field__error::before {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  margin-top: 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 4.5v4' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.25' r='.9'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 4.5v4' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.25' r='.9'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Form-level message (wrong credentials, server error, success) */
.alert {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
}
.alert__title { font-weight: var(--font-weight-semibold); }
.alert--error { background: var(--color-error-bg); border-color: var(--color-error-border); color: var(--color-error-text); }
.alert--success { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success-text); }
.alert .link { color: inherit; }

/* ---------- Card ---------- */
.card {
  width: 100%;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  box-shadow: var(--shadow-card);
}

/* Choice card (sign up step 1 roles) */
.choice-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: inherit;
  text-decoration: none;
}
.choice-card:hover { border-color: var(--color-border-strong); }
.choice-card__body { flex: 1; display: flex; flex-direction: column; gap: var(--space-1); }

/* ---------- Header (logged-out) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--space-5) var(--gutter);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  min-height: var(--nav-height);
  margin: 0 auto;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-bg-nav);
  -webkit-backdrop-filter: blur(var(--blur-nav));
          backdrop-filter: blur(var(--blur-nav));
}
.site-header__logo { display: block; flex: none; }
.site-header__logo img { width: 181px; height: 32px; }
.site-header__links { display: flex; gap: var(--space-4); }
.site-header__actions { display: flex; align-items: center; gap: var(--space-4); }
.site-header__menu-button {
  display: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.site-header { position: sticky; }
.site-header__menu {
  position: absolute;
  top: var(--space-4);
  left: var(--gutter);
  right: var(--gutter);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-bg-nav-mobile);
  -webkit-backdrop-filter: blur(var(--blur-nav));
          backdrop-filter: blur(var(--blur-nav));
}
.site-header__menu[hidden] { display: none; }
/* Opening: the panel grows down from the bar's height while the links fade in one by one.
   Closing (.is-closing, set by base_public.html) folds it back up, a little faster. */
@media (prefers-reduced-motion: no-preference) {
  .site-header__menu:not([hidden]) { animation: menu-open 360ms var(--ease-drawer) both; }
  .site-header__menu:not([hidden]) .site-header__menu-links > * { animation: menu-item-in 320ms var(--ease-out) both; }
  .site-header__menu-links > :nth-child(1) { animation-delay: 80ms; }
  .site-header__menu-links > :nth-child(2) { animation-delay: 120ms; }
  .site-header__menu-links > :nth-child(3) { animation-delay: 160ms; }
  .site-header__menu-links > :nth-child(4) { animation-delay: 190ms; }
  .site-header__menu-links > :nth-child(n+5) { animation-delay: 220ms; }
  .site-header__menu.is-closing { animation: menu-close 220ms var(--ease-out) both; }
  .site-header__menu.is-closing .site-header__menu-links > * { animation: none; }
}
@keyframes menu-open {
  from { clip-path: inset(0 0 calc(100% - var(--nav-height)) 0 round var(--radius-md)); }
  to   { clip-path: inset(0 0 0 0 round var(--radius-md)); }
}
@keyframes menu-close {
  from { clip-path: inset(0 0 0 0 round var(--radius-md)); opacity: 1; }
  to   { clip-path: inset(0 0 calc(100% - var(--nav-height)) 0 round var(--radius-md)); opacity: 0; }
}
@keyframes menu-item-in {
  from { opacity: 0; transform: translateY(-0.375rem); }
  to   { opacity: 1; transform: none; }
}
.site-header__menu-top { display: flex; align-items: center; justify-content: space-between; min-height: calc(var(--nav-height) - 2 * var(--space-4)); }
.site-header__menu-close { display: flex; padding: 0; border: 0; background: none; cursor: pointer; }
.site-header__menu-links { display: flex; flex-direction: column; gap: var(--space-4); }
.site-header__menu-links .nav-link { padding: var(--space-2) 0; }
.site-header__menu-divider { margin: 0; border: 0; border-top: 1px solid var(--neutral-900); }

@media (max-width: 767px) {
  .site-header { padding: var(--space-4) var(--gutter); }
  .site-header__bar { background: var(--color-bg-nav-mobile); }
  .site-header__logo img { width: 124px; height: 24px; content: url("../img/brand/logo-sm.svg"); }
  .site-header__links,
  .site-header__actions .button--secondary { display: none; }
  .site-header__actions .button { font-size: var(--font-size-sm); }
  .site-header__menu-button { display: block; }
}
@media (min-width: 768px) {
  .site-header__menu, .site-header__menu:not([hidden]) { display: none; }
}

/* Scrolled state: once the page moves, the bar gets more solid
   so it reads clearly over content. (.is-scrolled is set by peeranha-motion.js) */
.site-header__bar { transition: background-color 200ms ease, box-shadow 200ms ease; }
.site-header.is-scrolled .site-header__bar {
  background: rgb(242 245 255 / 0.85);
}

@media (max-width: 767px) {
  .site-header.is-scrolled .site-header__bar { background: rgb(223 231 255 / 0.85); }
  .site-header__bar { position: relative; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header__bar { transition: none; }
}

/* Minimal header (auth pages): logo only */
.site-header--minimal .site-header__bar { justify-content: flex-start; }

/* ---------- Page layouts ---------- */
.page-main {
  display: block;
  flex: 1 0 auto;
  /* Header + main always fill the screen, so the footer starts below the fold
     on short pages (header height = nav bar + its vertical padding). */
  min-height: calc(100svh - var(--nav-height) - 2 * var(--space-4));
}

/* Centred auth/status block: log in, sign up, forgot password, 404 */
.auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-20) var(--gutter) var(--space-30);
}
.auth__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  max-width: var(--heading-width);
  text-align: center;
}
.auth__body { width: 100%; max-width: var(--form-width); }
.auth__switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-1-5);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}
@media (max-width: 767px) {
  .auth { gap: var(--space-6); padding: var(--space-6) var(--gutter) var(--space-14); }
}

/* Status pages (404, generic error) */
.status-code {
  font-size: var(--font-size-6xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text-link);
}
.status-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); }

/* Long-form legal pages */
/* .legal pages use .page for layout; these are the bits specific to them */

.legal__meta { font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.legal__toc {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
}
.legal__toc ol { margin: var(--space-2) 0 0; padding-left: var(--space-6); font-size: var(--font-size-sm); }
.legal__toc li + li { margin-top: var(--space-1); }

.prose { font-size: var(--font-size-md); line-height: var(--line-height-body); }
.prose h2 {
  margin: var(--space-12) 0 var(--space-4);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  scroll-margin-top: 8rem;
}
.prose h3 {
  margin: var(--space-6) 0 var(--space-2);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
}
.prose p, .prose ul, .prose ol { margin: 0 0 var(--space-4); }
.prose ul, .prose ol { padding-left: var(--space-6); }
.prose li + li { margin-top: var(--space-1); }
.prose a { color: var(--color-text); text-decoration: underline; text-underline-position: from-font; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose table { width: 100%; margin: 0 0 var(--space-4); border-collapse: collapse; font-size: var(--font-size-sm); }
.prose th, .prose td { padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.prose th { background: var(--color-bg-subtle); font-weight: var(--font-weight-semibold); }

/* Placeholder that must be filled before launch */
.todo {
  padding: 0 var(--space-1);
  border-radius: 2px;
  background: var(--deep-indigo-200);
  color: var(--deep-indigo-900);
  font-weight: var(--font-weight-semibold);
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-14);
  padding: var(--space-20) var(--gutter);
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
}
.site-footer__logo { width: 100%; max-width: var(--container-max); }
.site-footer__logo img { width: 100%; height: auto; }
.site-footer__legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max);
  font-size: var(--font-size-sm);
}
.site-footer__links { display: flex; gap: var(--space-2); }

@media (max-width: 767px) {
  .site-footer { gap: var(--space-8); padding: var(--space-12) var(--gutter); }
  .site-footer__logo img { content: url("../img/brand/logo-footer-sm.svg"); }
  .site-footer__legal { align-items: flex-start; }
  .site-footer__links { flex-direction: column; align-items: flex-end; }
  .site-footer__links .sep { display: none; }
}

/* ---------- Django integration (base_public.html) ---------- */

/* Pages not yet redesigned keep their old Tailwind body inside this container */
.page-main--contained {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-8) var(--gutter);
}

/* Flash messages (Django messages framework) */
.site-messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.auth__messages { display: flex; flex-direction: column; gap: var(--space-2); }

/* Text-only button (e.g. "Log out" in the header) */
.button--text {
  padding-left: 0;
  padding-right: 0;
  background: none;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-semibold);
}
.button--text:hover { color: var(--color-text); }
.site-header__actions form { display: contents; }
.site-header__menu form { margin: 0; }
.site-header__menu .nav-link { display: block; width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.site-header__menu .nav-link[aria-current] { font-weight: var(--font-weight-semibold); }

/* Choice card: extra line (Founding Reviewer bonus) */
/* Promo tab sitting on top of a choice card (Figma 132:926) */
.choice-promo { display: flex; flex-direction: column; }
.choice-promo__tab {
  margin-bottom: calc(-1 * var(--space-1));
  padding: var(--space-1) var(--space-2) var(--space-2);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--deep-indigo-200);
  color: var(--deep-indigo-600);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-body);
}
.choice-promo__tab strong { font-weight: var(--font-weight-semibold); }
.choice-promo__tab .link { position: relative; z-index: 1; color: inherit; }
.choice-promo .choice-card { position: relative; }

/* Multi-select (areas of expertise): looks like .select, opens a panel of checkboxes */
.multi-select { position: relative; }
.multi-select > summary {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  padding: var(--space-2) calc(var(--space-3) + 24px + var(--space-2)) var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  position: relative;
  background: var(--color-bg);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  list-style: none;
  cursor: pointer;
}
.multi-select > summary::-webkit-details-marker { display: none; }
/* Same chevron and flip as the FAQ accordion: points up while the panel is open */
.multi-select > summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--space-3);
  width: 24px;
  height: 24px;
  margin-top: -12px;
  background: url("../img/brand/icon-chevron-down-dark.svg") no-repeat center / 24px;
  transition: transform 150ms ease;
}
.multi-select[open] > summary::after { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .multi-select > summary::after { transition: none; } }
.multi-select > summary:hover { border-color: var(--neutral-500); }
.multi-select[open] > summary { border-color: var(--color-focus); box-shadow: 0 0 0 3px var(--deep-indigo-200); }
.multi-select__placeholder { color: var(--color-text-tertiary); }
.multi-select__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: 20rem;
  margin-top: var(--space-1);
  padding: var(--space-3);
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  box-shadow: var(--shadow-card);
}
.multi-select__group { display: flex; flex-direction: column; gap: var(--space-3); }
.multi-select__group-title { margin-bottom: var(--space-3); padding: 0; font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold); color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.multi-select .checkbox.is-disabled { opacity: 0.4; }
.multi-select[aria-invalid="true"] > summary { border-color: var(--color-error); }

/* Grey info box inside legal text (e.g. data controller details) */
.legal__box {
  margin: var(--space-3) 0 var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  font-size: var(--font-size-sm);
}
.legal__box p { margin: 0; }
.legal__notice { padding: var(--space-4); border-radius: var(--radius-sm); background: var(--brand-deep-indigo); color: var(--color-text-inverse); font-weight: var(--font-weight-semibold); }
.legal__notice--closed { background: var(--color-bg-subtle); color: var(--color-text); }
.prose strong { font-weight: var(--font-weight-semibold); }

.form__fields--tight { gap: var(--space-3); }
fieldset.multi-select__group { margin: 0; padding: 0; border: 0; }

/* Whole card clickable via its main link; inner links stay clickable on top */
.choice-card { position: relative; }
.choice-card__link { color: inherit; text-decoration: none; }
.choice-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.choice-card:focus-within { border-color: var(--color-border-strong); }
.field__errors { display: flex; flex-direction: column; gap: var(--space-1); }
.legal__table { margin-bottom: var(--space-4); overflow-x: auto; }
.legal__table table { margin: 0; }
.prose section { margin: 0; }
.prose section:first-child h2 { margin-top: 0; }

/* Show / hide password (added by static/js/peeranha-forms.js) */
.password-field { position: relative; }
.password-field .input { padding-right: calc(var(--space-3) + 20px + var(--space-3)); }
.password-field__toggle {
  position: absolute;
  top: 50%;
  right: var(--space-2);
  display: flex;
  padding: var(--space-1);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  transform: translateY(-50%);
}
.password-field__toggle:hover { color: var(--color-text); }
.password-field .input::-ms-reveal { display: none; }
.field__error[hidden], .field__hint[hidden] { display: none; }

.text-center { text-align: center; }

/* Progress bar (Founding Reviewer places taken) */
.legal__notice { display: flex; flex-direction: column; gap: var(--space-3); }
.progress {
  appearance: none;
  width: 100%;
  height: var(--space-2);
  border: 0;
  border-radius: var(--space-1);
  background: var(--neutral-100);
  color: var(--brand-midnight-tide);
  overflow: hidden;
}
.progress::-webkit-progress-bar { background: var(--neutral-100); border-radius: var(--space-1); }
.progress::-webkit-progress-value { background: var(--brand-midnight-tide); border-radius: var(--space-1); }
.progress::-moz-progress-bar { background: var(--brand-midnight-tide); border-radius: var(--space-1); }

/* ---------- Content page layout (Figma "faq" 94:410 / 94:905) ----------
   Used by FAQ, About, Contact, Terms, Privacy, Founding Reviewer terms:
   1152px content area, everything left-aligned, reading column of 800px. */
.page {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  width: 100%;
  max-width: calc(var(--content-width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-16) var(--gutter) var(--space-30);
}
.page__intro { display: flex; flex-direction: column; gap: var(--space-4); max-width: var(--reading-width); }
.page__title { font-size: var(--font-size-5xl); font-weight: var(--font-weight-semibold); line-height: 1.15; letter-spacing: -0.015em; }
.page__subtitle { font-size: var(--font-size-lg); line-height: var(--line-height-body); }
.page__meta { font-size: var(--font-size-sm); font-style: normal; color: var(--color-text-secondary); }
.page__body { display: flex; flex-direction: column; gap: var(--space-10); max-width: var(--reading-width); }
@media (max-width: 767px) {
  .page { padding-bottom: var(--space-16); }
  .page__title { font-size: var(--font-size-3xl); line-height: 1.25; letter-spacing: -0.005em; }
  .page__subtitle { font-size: var(--font-size-md); }
}

.faq__body { display: flex; flex-direction: column; gap: var(--space-16); max-width: none; }

/* ---------- Wide content pages (Pricing, FAQ, Terms, Privacy) ----------
   Same 1296px content width as the landing and Pricing. Long text keeps its 800px
   reading column: on desktop the page's navigation (FAQ search and topics, legal
   "On this page") moves into a sticky column on the left. Below 1100px it stacks. */
.page--wide { max-width: calc(var(--container-max) + 2 * var(--gutter)); }
.page--wide .page__intro { max-width: none; }
@media (min-width: 1100px) {
  .page--wide .page__body,
  .page--wide .faq__body {
    display: grid;
    grid-template-columns: 18.5rem minmax(0, var(--reading-width));
    column-gap: var(--space-20);
    align-items: start;
    max-width: none;
  }
  .page--wide .legal__toc,
  .page--wide .faq__filters {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: calc(var(--nav-height) + 2 * var(--space-5) + var(--space-6));   /* below the sticky header (bar + its 20px padding) */
  }
  .page--wide .page__body > :not(.legal__toc),
  .page--wide .faq__groups { grid-column: 2; grid-row: 1; }
}
.faq__filters { display: flex; flex-direction: column; gap: var(--space-6); max-width: var(--reading-width); }
.faq__groups { display: flex; flex-direction: column; gap: var(--space-12); max-width: var(--reading-width); }
.faq__group { display: flex; flex-direction: column; gap: var(--space-4); scroll-margin-top: 8rem; }
.faq__group[hidden] { display: none; }
.faq__group-title { font-size: var(--font-size-2xl); font-weight: var(--font-weight-semibold); line-height: 1.3; }
.faq__list { display: flex; flex-direction: column; gap: var(--space-4); }

.faq__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  scroll-margin-top: 8rem;
}
.faq__item[hidden] { display: none; }
.faq__question {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}
.faq__question::-webkit-details-marker { display: none; }
.faq__question:focus { outline: none; }
.faq__question:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; border-radius: var(--radius-sm); }
.faq__chevron { flex: none; transition: transform 150ms ease; }
.faq__item[open] .faq__chevron { transform: rotate(180deg); }
.faq__answer {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-3) var(--space-3);
  font-size: var(--font-size-md);
  line-height: var(--line-height-body);
  color: var(--color-text-secondary);
}
.faq__answer ol { margin: 0; padding-left: var(--space-6); }
.faq__answer li + li { margin-top: var(--space-1); }
.faq__empty { color: var(--color-text-secondary); }
/* Search keyword highlight (the usual yellow marker) */
.search-hit { padding: 0 1px; border-radius: 2px; background: #ffe066; color: inherit; }
.faq__empty[hidden] { display: none; }

/* Search field */
.search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}
.search:focus-within { border-color: var(--color-focus); box-shadow: 0 0 0 3px var(--deep-indigo-200); }
.search__icon { flex: none; }
.search__input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: var(--font-size-md);
  line-height: var(--line-height-body);
  outline: none;
}
.search__input::placeholder { color: var(--neutral-700); }
.search__input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.search__clear { display: flex; flex: none; padding: 0; border: 0; background: none; cursor: pointer; }
.search__clear[hidden] { display: none; }

/* Pills (topic filter) */
.pills { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  color: var(--color-text);
  font: inherit;
  font-size: var(--font-size-md);
  line-height: var(--line-height-body);
  white-space: nowrap;
  cursor: pointer;
}
.pill:hover { border-color: var(--neutral-500); }
.pill[aria-pressed="true"] { font-weight: var(--font-weight-semibold); }
/* reserve the semibold width so the active pill doesn't change size */
.pill[data-label]::after { content: attr(data-label); height: 0; overflow: hidden; visibility: hidden; font-weight: var(--font-weight-semibold); }

@media (max-width: 767px) {
  .faq__body { gap: var(--space-10); }
  .faq__groups { gap: var(--space-10); }
  .faq__group-title { font-size: var(--font-size-xl); line-height: 1.35; }
  .faq__question { font-size: var(--font-size-md); line-height: var(--line-height-body); }
  .faq__answer { font-size: var(--font-size-sm); }
  /* pills scroll sideways on one line */
  .pills {
    flex-wrap: nowrap;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .pills::-webkit-scrollbar { display: none; }
}

/* Label + value list (Contact page) */
.info-list { display: flex; flex-direction: column; gap: var(--space-8); margin: 0; }
.info-list dt { margin-bottom: var(--space-2); }
.info-list dd { margin: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.prose ul.list-plain { padding-left: 0; list-style: none; }
.prose ul.list-plain li + li { margin-top: var(--space-3); }
.prose .lead { font-size: var(--font-size-lg); }

/* ==========================================================================
   Content landing (all logged-out pages). peeranha-motion.js marks the page
   (.motion-ready) and sets .is-visible when a block enters the view: a short rise,
   a fade and a 4px blur that clears. [data-reveal-group] children follow one after
   another. On pages built with .page, the script tags the blocks itself.
   Off with reduced motion; nothing is hidden if the script doesn't run.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .motion-ready [data-reveal],
  .motion-ready [data-reveal-group] > * {
    opacity: 0;
    transform: translateY(1.25rem);
    filter: blur(4px);
    transition:
      opacity var(--duration-enter) var(--ease-out),
      transform var(--duration-enter) var(--ease-out),
      filter var(--duration-enter) var(--ease-out);
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .motion-ready [data-reveal].is-visible,
  .motion-ready [data-reveal-group].is-visible > * { opacity: 1; transform: none; filter: none; }
}
