/* ──────────────────────────────────────────────────────────────
   Website contact form
   One component, two themes:  .icf--rccc (light)  ·  .icf--tgst (cream card for dark sections)
   Every color, font and radius is a --icf-* variable, so the new site
   builds can map them to their own design tokens.
   ────────────────────────────────────────────────────────────── */

.icf-shell {
  /* Light defaults (RCCC) */
  --icf-font-display: 'Nunito Sans', system-ui, sans-serif;
  --icf-font-body: 'Work Sans', system-ui, sans-serif;
  --icf-card: #FFFDF9;
  --icf-card-border: #EDE6D8;
  --icf-text: #1E1812;
  --icf-muted: #6B6158;
  --icf-line: #EDE6D8;
  --icf-field: #FFFFFF;
  --icf-field-border: #D9CFBF;
  --icf-field-text: #1E1812;
  --icf-placeholder: #A39A90;
  --icf-accent: #2C5F47;
  --icf-accent-hover: #3D7A5E;
  --icf-accent-soft: #EAF2EC;
  --icf-on-accent: #FAF6F0;
  --icf-eyebrow: #C15F43;
  --icf-error: #B3261E;
  --icf-error-soft: #FDF0EE;
  --icf-ring: rgba(44, 95, 71, .28);
  --icf-radius: 12px;
  --icf-radius-sm: 10px;
  --icf-shadow: 0 1px 2px rgba(30, 24, 18, .04), 0 12px 32px -12px rgba(30, 24, 18, .14);
  --icf-rule: linear-gradient(90deg, #E8444C 0%, #F5923E 18%, #F5D33E 36%, #58C066 54%, #3E8EF5 72%, #8E5BD6 90%);

  position: relative;
  background: var(--icf-card);
  border: 1px solid var(--icf-card-border);
  border-radius: var(--icf-radius);
  box-shadow: var(--icf-shadow);
  color: var(--icf-text);
  font-family: var(--icf-font-body);
  font-size: 1rem;
  line-height: 1.5;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.icf-shell::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--icf-rule);
}

.icf-shell.icf--tgst {
  --icf-font-display: 'Raleway', system-ui, sans-serif;
  --icf-font-body: 'Outfit', system-ui, sans-serif;
  /* Cream card on TGST's dark aubergine sections. The site's gold (#C4813A/#DDA05A) is too
     faint for text on cream, so accents use a deeper gold. */
  --icf-card: #F7F2EC;
  --icf-card-border: transparent;
  --icf-text: #1C1220;
  --icf-muted: #5E4F5C;
  --icf-line: rgba(28, 18, 32, .10);
  --icf-field: #FFFDF9;
  --icf-field-border: rgba(28, 18, 32, .22);
  --icf-field-text: #1C1220;
  --icf-placeholder: #9A8C98;
  --icf-accent: #8F5620;
  --icf-accent-hover: #A8692B;
  --icf-accent-soft: rgba(196, 129, 58, .14);
  --icf-on-accent: #FFFDF9;
  --icf-eyebrow: #8F5620;
  --icf-error: #B3261E;
  --icf-error-soft: #FDF0EE;
  --icf-ring: rgba(196, 129, 58, .40);
  --icf-radius: 8px;
  --icf-radius-sm: 8px;
  --icf-shadow: 0 30px 70px -28px rgba(0, 0, 0, .75);
  --icf-rule: linear-gradient(to right, #E8BE7E, #EBA6B8, #BFA9EC, #8ED3D2, #E8C98C);
}

.icf-shell *, .icf-shell *::before, .icf-shell *::after { box-sizing: border-box; }
.icf-shell [hidden] { display: none !important; }

/* ── Layout ─────────────────────────────────────────────────── */
.icf { display: grid; gap: 2rem; margin: 0; }
.icf-section { display: grid; gap: 1.25rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.icf-section + .icf-section { padding-top: 2rem; border-top: 1px solid var(--icf-line); }
.icf-section-head { display: grid; gap: .3rem; padding: 0; }
.icf-eyebrow {
  font-family: var(--icf-font-body); font-size: .72rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--icf-eyebrow);
}
.icf-section-title {
  margin: 0; font-family: var(--icf-font-display); font-weight: 700; font-size: 1.3rem;
  line-height: 1.25; letter-spacing: -.01em; color: var(--icf-text);
}
.icf-row { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .icf-row { grid-template-columns: 1fr; } }   /* phones: one field per line */

/* ── Fields ─────────────────────────────────────────────────── */
.icf-field { display: grid; gap: .5rem; align-content: start; margin: 0; padding: 0; border: 0; min-width: 0; }
.icf-label, .icf-field > legend {
  display: block; padding: 0; font-weight: 600; font-size: .95rem; line-height: 1.35; color: var(--icf-text);
}
/* A fieldset's legend isn't a grid item, so .icf-field's gap never reaches it: space it to match the text fields,
   with a little more when a hint (and its underlined link) sits right above the choices. */
.icf-field > legend { margin-bottom: .5rem; }
.icf-field > legend:has(.icf-hint) { margin-bottom: .75rem; }
.icf-optional { font-weight: 400; color: var(--icf-muted); font-size: .85rem; margin-left: .25rem; }
.icf-hint { display: block; margin-top: .2rem; font-weight: 400; font-size: .87rem; line-height: 1.45; color: var(--icf-muted); }
.icf-hint a { color: var(--icf-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.icf-hint a:hover { color: var(--icf-accent-hover); }
.icf-success strong { color: var(--icf-text); font-weight: 600; overflow-wrap: anywhere; }

.icf-input, .icf-select, .icf-textarea {
  width: 100%; margin: 0; font: inherit; font-size: 1rem; color: var(--icf-field-text);
  background: var(--icf-field); border: 1px solid var(--icf-field-border); border-radius: var(--icf-radius-sm);
  padding: .8rem .95rem; min-height: 3rem; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.icf-input::placeholder, .icf-textarea::placeholder { color: var(--icf-placeholder); }
.icf-textarea { min-height: 7rem; resize: vertical; line-height: 1.55; }
.icf-select {
  padding-right: 2.6rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.2rem) 52%, calc(100% - .85rem) 52%;
  background-size: .35rem .35rem; background-repeat: no-repeat;
}
.icf-input:hover, .icf-select:hover, .icf-textarea:hover { border-color: var(--icf-accent); }
.icf-input:focus, .icf-select:focus, .icf-textarea:focus {
  outline: none; border-color: var(--icf-accent); box-shadow: 0 0 0 4px var(--icf-ring);
}

/* ── Choice tiles, pills and toggles ───────────────────────────
   <label class="icf-choice"><input type="checkbox|radio"><span class="icf-choice-body">…</span></label>
   The real input is visually hidden but stays focusable and announced. */
.icf-choices { display: grid; gap: .6rem; }
.icf-choices--tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14.5rem), 1fr)); }
.icf-choices--two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.icf-choices--stack { grid-template-columns: 1fr; }   /* one option per row: keeps long titles from stretching their neighbours */
.icf-choices--pills { display: flex; flex-wrap: wrap; gap: .5rem; }

.icf-choice { position: relative; display: block; cursor: pointer; margin: 0; }
.icf-choice > input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none;
}
.icf-choice-body {
  position: relative; display: grid; gap: .15rem; align-content: start; height: 100%;
  padding: .85rem 1rem .85rem 2.75rem; border-radius: var(--icf-radius-sm);
  border: 1px solid var(--icf-field-border); background: var(--icf-field); color: var(--icf-field-text);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.icf-choice-body::before {                     /* the box / dot */
  content: ""; position: absolute; left: 1rem; top: 1.02rem; width: 1.1rem; height: 1.1rem;
  border: 1.5px solid var(--icf-field-border); border-radius: 5px; background: var(--icf-field);
  transition: background-color .15s, border-color .15s;
}
.icf-choice > input[type=radio] + .icf-choice-body::before { border-radius: 50%; }
.icf-choice-title { font-weight: 600; font-size: .95rem; line-height: 1.35; }
.icf-choice-desc { font-size: .84rem; line-height: 1.4; color: var(--icf-muted); }

.icf-choice:hover .icf-choice-body { border-color: var(--icf-accent); }
.icf-choice > input:checked + .icf-choice-body {
  border-color: var(--icf-accent); background: var(--icf-accent-soft); box-shadow: inset 0 0 0 1px var(--icf-accent);
}
.icf-choice > input:checked + .icf-choice-body::before {
  border-color: var(--icf-accent); background-color: var(--icf-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 80%; background-position: center; background-repeat: no-repeat;
}
.icf-choice > input[type=radio]:checked + .icf-choice-body::before {
  background-image: none; box-shadow: inset 0 0 0 3px var(--icf-field);
}
.icf-choice > input:focus-visible + .icf-choice-body { box-shadow: 0 0 0 4px var(--icf-ring); border-color: var(--icf-accent); }

/* Pills: compact, centered, no indicator box (for states) */
.icf-choices--pills .icf-choice-body {
  padding: .6rem 1.15rem; min-width: 4.25rem; text-align: center; border-radius: 999px;
}
.icf-choices--pills .icf-choice-body::before { display: none; }
.icf-choices--pills .icf-choice-title { font-size: .95rem; letter-spacing: .02em; }
.icf-choices--pills .icf-choice > input:checked + .icf-choice-body {
  background: var(--icf-accent); color: var(--icf-on-accent); box-shadow: none;
}

/* Compact tiles: title only, tighter, three across on wide cards */
.icf-choices--compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr)); gap: .5rem; }
.icf-choices--compact.icf-choices--two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.icf-choices--compact .icf-choice-body { padding: .7rem .85rem .7rem 2.45rem; align-content: center; }
.icf-choices--compact .icf-choice-body::before { left: .8rem; top: 50%; margin-top: -.55rem; }
.icf-choices--compact .icf-choice-title { font-size: .92rem; }
.icf-choices--compact .icf-choice-desc { font-size: .78rem; }

/* ── "Time to complete" line ────────────────────────────────── */
.icf-intro {
  display: inline-flex; align-items: center; gap: .45rem; justify-self: start; margin: 0 0 -.75rem;
  padding: .35rem .8rem; border-radius: 999px; background: var(--icf-accent-soft);
  color: var(--icf-accent); font-size: .82rem; font-weight: 600;
}
.icf-intro svg { width: 1rem; height: 1rem; }

/* ── Collapsible optional questions ─────────────────────────── */
.icf-more { border: 1px solid var(--icf-line); border-radius: var(--icf-radius-sm); background: transparent; }
.icf-more > summary {
  display: flex; align-items: center; gap: .5rem; padding: .9rem 1rem; cursor: pointer; list-style: none;
  font-weight: 600; font-size: .95rem; color: var(--icf-text); border-radius: var(--icf-radius-sm);
}
.icf-more > summary::-webkit-details-marker { display: none; }
.icf-more > summary::after {
  content: ""; margin-left: auto; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .15s; color: var(--icf-muted);
}
.icf-more[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.icf-more > summary:hover { color: var(--icf-accent); }
.icf-more > summary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--icf-ring); }
.icf-more .icf-optional { margin-left: 0; }
.icf-more-body { display: grid; gap: 1.25rem; padding: .25rem 1rem 1.15rem; }

/* Partner names (relationship services): one row per partner */
.icf-partner-list { display: grid; gap: .5rem; }
.icf-partner-row { display: flex; gap: .5rem; align-items: center; }
.icf-partner-row .icf-input { flex: 1; min-width: 0; }
.icf-remove {
  flex: none; display: grid; place-items: center; width: 2.75rem; height: 3rem; padding: 0; cursor: pointer;
  border: 1px solid var(--icf-field-border); border-radius: var(--icf-radius-sm); background: transparent;
  color: var(--icf-muted); font: inherit; font-size: 1.35rem; line-height: 1;
}
.icf-remove:hover { color: var(--icf-error); border-color: var(--icf-error); }
.icf-remove:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--icf-ring); }
.icf-add {
  justify-self: start; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .2rem; margin-top: -.1rem;
  border: 0; background: none; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 600; color: var(--icf-accent);
}
.icf-add svg { width: 1rem; height: 1rem; }
.icf-add:hover { color: var(--icf-accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.icf-add:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--icf-ring); border-radius: 6px; }

/* Note revealed by a choice (e.g. "Not sure yet") */
.icf-reveal {
  margin: 0; padding: .7rem .9rem; border-left: 3px solid var(--icf-accent); border-radius: 0 var(--icf-radius-sm) var(--icf-radius-sm) 0;
  background: var(--icf-accent-soft); color: var(--icf-text); font-size: .88rem; line-height: 1.5;
}

/* ── Out-of-state ("Somewhere else") ────────────────────────── */
.icf-notice {
  display: grid; gap: .6rem; padding: 1rem 1.1rem; border-radius: var(--icf-radius-sm);
  background: var(--icf-accent-soft); border: 1px solid var(--icf-line); font-size: .92rem; line-height: 1.5;
}
.icf-notice p { margin: 0; color: var(--icf-text); }
.icf-notice a { color: var(--icf-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.icf-notice a:hover { color: var(--icf-accent-hover); }
.icf-is-out-of-state .icf-section ~ .icf-section,
.icf-is-out-of-state .icf-footer { display: none; }

/* ── Errors ─────────────────────────────────────────────────── */
.icf-error {
  display: flex; gap: .4rem; align-items: flex-start; margin: 0;
  font-size: .86rem; line-height: 1.4; color: var(--icf-error);
}
.icf-error:empty { display: none; }
.icf-error::before { content: "!"; flex: none; display: grid; place-items: center; width: 1.05rem; height: 1.05rem;
  margin-top: .05rem; border-radius: 50%; background: var(--icf-error); color: var(--icf-card); font-size: .72rem; font-weight: 700; }
.icf-invalid .icf-input, .icf-invalid .icf-select, .icf-invalid .icf-textarea,
.icf-invalid .icf-choice-body { border-color: var(--icf-error); }
.icf-invalid .icf-input:focus, .icf-invalid .icf-textarea:focus { box-shadow: 0 0 0 4px var(--icf-error-soft); }

/* ── Footer: privacy note, submit, status ───────────────────── */
.icf-footer { display: grid; gap: 1.1rem; padding-top: 1.75rem; border-top: 1px solid var(--icf-line); }
.icf-privacy {
  display: flex; gap: .7rem; align-items: flex-start; margin: 0;
  font-size: .85rem; line-height: 1.5; color: var(--icf-muted);
}
.icf-privacy svg { flex: none; width: 1.1rem; height: 1.1rem; margin-top: .1rem; color: var(--icf-accent); }
.icf-privacy a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.icf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.icf-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3.1rem; padding: .85rem 1.9rem; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 1rem; letter-spacing: .01em;
  background: var(--icf-accent); color: var(--icf-on-accent); transition: background-color .15s, transform .15s;
}
.icf-submit:hover { background: var(--icf-accent-hover); }
.icf-submit:active { transform: translateY(1px); }
.icf-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--icf-ring); }
.icf-submit:disabled { opacity: .65; cursor: progress; }
.icf-submit svg { width: 1.05rem; height: 1.05rem; }
.icf-call { font-size: .9rem; color: var(--icf-muted); }
.icf-call a { color: var(--icf-text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.icf-call a:hover { text-decoration: underline; }
.icf-status { margin: 0; font-size: .9rem; }
.icf-status:empty { display: none; }
.icf-status.icf-fail { color: var(--icf-error); padding: .8rem 1rem; border-radius: var(--icf-radius-sm); background: var(--icf-error-soft); }

/* ── Success ────────────────────────────────────────────────── */
.icf-success { display: grid; gap: .9rem; justify-items: start; padding: 1rem 0; outline: none; }
.icf-success-icon {
  display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%;
  background: var(--icf-accent-soft); color: var(--icf-accent);
}
.icf-success-icon svg { width: 1.6rem; height: 1.6rem; }
.icf-success h3 { margin: 0; font-family: var(--icf-font-display); font-size: 1.55rem; line-height: 1.2; color: var(--icf-text); }
.icf-success p { margin: 0; color: var(--icf-muted); max-width: 34rem; }
.icf-success .icf-next { display: grid; gap: .5rem; margin: .4rem 0 0; padding: 0; list-style: none; color: var(--icf-text); font-size: .95rem; }
.icf-success .icf-next li { position: relative; padding-left: 1.05rem; }
.icf-success .icf-next li::before { content: ""; position: absolute; left: 0; top: .55rem; width: .45rem; height: .45rem; border-radius: 50%; background: var(--icf-accent); }

/* Spam trap */
.icf-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 520px) {
  .icf-choices--pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
  .icf-choices--pills .icf-choice-body { min-width: 0; padding: .6rem .4rem; }
  .icf-choices--pills .icf-choice--elsewhere { grid-column: 1 / -1; }   /* own row under the four states */
  .icf-choices--compact, .icf-choices--compact.icf-choices--two { grid-template-columns: 1fr 1fr; }
  .icf-choices--compact.icf-choices--clinicians { grid-template-columns: 1fr; }   /* names + credentials need the width */
  .icf-choices--compact .icf-choice-body { padding: .65rem .7rem .65rem 2.2rem; }
  .icf-choices--compact .icf-choice-body::before { left: .7rem; }
  .icf-choices--compact .icf-choice-title { font-size: .88rem; }
  .icf-actions { flex-direction: column; align-items: stretch; text-align: center; }
  .icf-submit { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .icf-shell * { transition: none !important; }
}
