/*
 * TruDesign — "Verdant OS" intake (Claude Design, direction 1a)
 * Single-scroll Webform: dark nav, sticky live progress, marketing left-rail,
 * chip-style selectors (real radios/checkboxes styled as pills), dark success card.
 * Type roles: Sora = display + UI · Space Mono = labels/data/progress.
 */

/* ---- Base --------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--paper);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: var(--lh-tight); letter-spacing: -0.02em; margin: 0 0 var(--s-3); text-wrap: balance; }
p { margin: 0 0 var(--s-3); }
strong, b { font-weight: 700; }

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute; left: var(--s-3); top: var(--s-3);
  background: var(--forest); color: var(--forest-ink);
  padding: var(--s-2) var(--s-3); border-radius: var(--radius); z-index: 100;
  transform: translateY(-160%); transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); color: var(--forest-ink); }

/* Hide the default page-title block on the intake route — the left rail is the h1. */
.intake-page .block-page-title-block,
.intake-page [data-drupal-selector="page-title"] { display: none; }

/* ======================================================================== *
 *  INTAKE SHELL (page--trudesign-intake.html.twig)
 * ======================================================================== */

/* ---- Nav ---------------------------------------------------------------- */
.intake-nav { background: var(--forest); color: var(--forest-ink); }
.intake-nav__inner {
  max-width: var(--wrap); margin: 0 auto; gap: var(--s-4);
  padding: 14px clamp(20px, 4vw, 36px);
  display: flex; align-items: center; justify-content: space-between;
}
.intake-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 17px; color: var(--forest-ink); text-decoration: none;
}
.intake-brand:hover { color: var(--forest-ink); }
.intake-brand__mark {
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--lime); color: var(--forest);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; font-family: var(--font-mono);
}
.intake-nav__back {
  font-size: 13px; color: #b7c9ac; text-decoration: none; font-family: var(--font-mono);
}
.intake-nav__back:hover { color: var(--lime); }

/* ---- Sticky progress ---------------------------------------------------- */
.intake-progress {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule);
}
.intake-progress__inner {
  max-width: var(--wrap); margin: 0 auto; gap: 14px;
  padding: 12px clamp(20px, 4vw, 36px);
  display: flex; align-items: center;
}
.intake-progress__label {
  font-family: var(--font-mono); font-size: 11px; color: var(--green);
  letter-spacing: 0.06em; white-space: nowrap;
}
.intake-progress__track {
  flex: 1; height: 5px; background: #e0e4d9; border-radius: 3px; overflow: hidden;
}
.intake-progress__fill {
  display: block; height: 100%; background: var(--green);
  border-radius: 3px; width: 0; transition: width .35s ease;
}

/* ---- Two-column grid ---------------------------------------------------- */
.intake-grid {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(36px, 6vw, 64px) clamp(20px, 4vw, 36px) 120px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(28px, 5vw, 56px); align-items: start;
}

/* ---- Left rail ---------------------------------------------------------- */
.intake-rail { position: sticky; top: 70px; }
.intake-rail__eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--green); margin-bottom: 16px;
}
.intake-rail__title {
  font-size: var(--fs-display); line-height: 1.05; font-weight: 700; margin: 0 0 18px;
}
.intake-rail__lead { font-size: 16px; line-height: 1.6; color: var(--muted-2); margin: 0 0 28px; max-width: 42ch; }
.intake-rail__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.intake-rail__list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: #41503c; line-height: 1.5; }
.intake-rail__list .tick { color: var(--green); font-size: 16px; margin-top: 1px; }
.intake-quote {
  margin: 32px 0 0; padding: 20px;
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: 14px;
}
.intake-quote blockquote { margin: 0; font-size: 13px; line-height: 1.55; color: #5b6b57; font-style: italic; }
.intake-quote figcaption { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 12px; }

/* ---- Plan-signup shell (Care / Care+) — centered single column ---------- */
.plan-shell { padding: clamp(36px,6vw,64px) clamp(20px,4vw,36px) 120px; }
.plan-shell__inner { max-width: 640px; margin: 0 auto; counter-reset: sec; }
.plan-shell__eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--green); margin: 0 0 14px; }
.plan-shell__title { font-size: clamp(28px,5vw,40px); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 14px; }
.plan-shell__lead { font-size: 16px; line-height: 1.6; color: var(--muted-2); margin: 0 0 28px; max-width: 52ch; }
.plan-fee-note { font-size: 13px; line-height: 1.5; color: var(--muted); background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; margin: 0; }

/* ======================================================================== *
 *  WEBFORM (the funnel)
 * ======================================================================== */
.intake-main { counter-reset: sec; }
.webform-submission-form { display: flex; flex-direction: column; gap: 14px; }

/* Sections → numbered cards */
.webform-section {
  counter-increment: sec; margin: 0;
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); padding: clamp(24px, 3.5vw, 34px);
}
.webform-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-h3); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 22px;
}
.webform-section-title::before {
  content: counter(sec);
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  background: var(--forest); color: var(--lime);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Element spacing inside a section — fields live in .webform-section-wrapper,
   so the gap must hang off the wrapper's children, not the section's. */
.webform-section-wrapper > .form-item,
.webform-section-wrapper > .js-form-wrapper,
.webform-section-wrapper > fieldset { margin-bottom: 26px; }
.webform-section-wrapper > *:last-child { margin-bottom: 0; }

/* Labels + text controls */
.form-item > label,
.fieldset-legend,
.webform-flex label {
  display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px;
}
.form-text, .form-email, .form-tel, .form-url, .form-number, .form-select, textarea.form-textarea {
  width: 100%; background: #fff; color: var(--ink);
  border: 1px solid var(--rule-soft); border-radius: 11px;
  padding: 13px 15px; font-size: 15px; font-family: inherit;
  outline: none; transition: box-shadow .15s, border-color .15s;
}
textarea.form-textarea { resize: vertical; line-height: 1.5; }
.form-text:focus, .form-email:focus, .form-tel:focus, .form-url:focus,
.form-number:focus, .form-select:focus, textarea.form-textarea:focus {
  border-color: var(--green); box-shadow: 0 0 0 3px rgba(63, 107, 46, 0.14);
}
input::placeholder, textarea::placeholder { color: #9aa693; }
.form-required::after { content: " *"; color: var(--green); }
.description, .webform-element-description {
  color: var(--muted); font-size: var(--fs-small); margin-top: 6px; line-height: 1.5;
}

/* Custom select arrow */
.form-select {
  -webkit-appearance: none; appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237a8676' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}

/* Flexbox rows (name/email · org/budget) */
.webform-flexbox { display: flex; flex-wrap: wrap; gap: 16px; }
.webform-flex { flex: 1 1 200px; }

/* ---- CHIPS (radios/checkboxes as pills) --------------------------------- */
fieldset.js-webform-type-radios,
fieldset.js-webform-type-checkboxes { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
fieldset.js-webform-type-radios .fieldset-wrapper,
fieldset.js-webform-type-checkboxes .fieldset-wrapper { margin: 0; }
.js-webform-radios, .js-webform-checkboxes {
  display: flex; flex-wrap: wrap; gap: 9px;
}
.webform-type-radio, .webform-type-checkbox { position: relative; margin: 0; }
.webform-type-radio .form-radio,
.webform-type-checkbox .form-checkbox {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.webform-type-radio label.option,
.webform-type-checkbox label.option {
  display: block; cursor: pointer; user-select: none;
  font-size: 14px; font-weight: 500; color: #48543f;
  background: #fff; border: 1px solid var(--rule-soft);
  padding: 10px 16px; border-radius: var(--radius-pill);
  transition: background .15s, border-color .15s, color .15s;
}
.webform-type-radio label.option:hover,
.webform-type-checkbox label.option:hover { border-color: var(--green); }
.form-radio:checked + label.option,
.form-checkbox:checked + label.option {
  background: var(--green); border-color: var(--green); color: var(--paper); font-weight: 600;
}
.form-radio:focus-visible + label.option,
.form-checkbox:focus-visible + label.option {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

/* Managed file (optional screenshots) */
.js-form-managed-file { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.js-form-managed-file .form-file {
  font-size: 13px; border: 1px dashed var(--rule-soft); border-radius: 11px; padding: 10px 12px; background: #fff;
}
.js-form-managed-file .button {
  font-family: inherit; font-size: 13px; font-weight: 600;
  background: var(--panel-2); color: var(--green); border: 1px solid var(--rule);
  border-radius: 10px; padding: 8px 14px; cursor: pointer;
}

/* ---- Submit ------------------------------------------------------------- */
.form-actions { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.webform-button--submit {
  background: var(--lime); color: var(--forest); border: none; font-family: inherit;
  font-weight: 600; font-size: 16px; padding: 16px 30px; border-radius: 12px; cursor: pointer;
  transition: background .15s;
}
.webform-button--submit:hover { background: var(--lime-hover); }
.intake-privacy { font-size: 12px; color: #9aa693; margin: 4px 0 0; }

/* ---- Success (inline confirmation) → dark card -------------------------- */
.webform-confirmation {
  background: var(--forest); color: var(--forest-ink);
  border-radius: 20px; padding: clamp(32px, 5vw, 52px); text-align: center;
}
.webform-confirmation__title {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--forest-ink); margin: 0 0 12px;
}
.webform-confirmation::before {
  content: "✓"; display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--lime); color: var(--forest); font-size: 28px; margin-bottom: 22px;
}
.webform-confirmation__message { font-size: 16px; line-height: 1.6; color: #b7c9ac; margin: 0 auto 28px; max-width: 38ch; }
.webform-confirmation a.button, .webform-confirmation .button {
  display: inline-block; background: var(--lime); color: var(--forest); text-decoration: none;
  font-weight: 600; font-size: 15px; padding: 13px 24px; border-radius: 11px; border: none;
}

/* ---- Accessibility: focus + motion ------------------------------------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 46rem) {
  .intake-rail { position: static; }
}
