/* ==========================================================================
   STAY FREE ENTERPRISE — FREEDOM COMPASS INTAKE · styles
   Consumes tokens.css custom properties only (no raw hexes except the two
   needle-tint values, which are motion-material states set from JS and kept
   in sync here for the reduced-motion / no-JS resting look).
   Palette governance:
   - Coral = CTA only (the submit button reuses .sf-cta from cta-button.css;
     this file never paints coral on anything else).
   - Gold = material/foil, never additive glow on ivory.
   - Shadows = taupe-tinted elevation tokens, never black.
   Motion vocabulary: drape / diffuse / catch light / drift (GSAP owns the
   needle swing; CSS owns resting states + the reduced-motion instant swap).
   ========================================================================== */

.sf-ci {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: var(--sf-space-7);
  align-items: start;
  max-width: var(--sf-max-content);
  margin-inline: auto;
  padding: var(--sf-space-5);
  background: var(--sf-bg-primary);
  border-radius: var(--sf-radius-lg);
  box-shadow: var(--sf-elevation-1);
}

/* ---------------------------------------------------------------- rail */
.sf-ci__rail {
  position: sticky;
  top: var(--sf-space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sf-space-4);
}

.sf-ci__compass { width: 100%; max-width: 260px; text-align: center; }
.sf-ci__compass-svg { width: 100%; height: auto; display: block; }

.sf-ci__ring {
  fill: none;
  stroke: var(--sf-teal);
  stroke-width: 1.5;
  opacity: 0.55;
}
.sf-ci__ring-inner {
  fill: rgba(14, 74, 60, 0.03);
  stroke: var(--sf-teal);
  stroke-width: 0.75;
  opacity: 0.28;
}
.sf-ci__tick { stroke: var(--sf-teal); stroke-width: 1; opacity: 0.35; }
.sf-ci__tick--long { stroke-width: 1.75; opacity: 0.6; }

.sf-ci__needle-blade,
.sf-ci__needle-tail {
  /* resting tint = rust-taupe (stuck); JS animates toward gold (free).
     kept here so the no-JS / reduced-motion resting state reads correct. */
  fill: #8A6B5A;
  transition: fill var(--sf-dur-slow) var(--sf-ease-out);
}
.sf-ci__needle-tail { opacity: 0.72; }
.sf-ci__hub {
  fill: var(--sf-gold);
  stroke: var(--sf-teal);
  stroke-width: 1.5;
}
/* engraved-edge shadow on the needle = material presence, not glow */
.sf-ci__needle { filter: drop-shadow(0 2px 3px rgba(138, 128, 116, 0.35)); }
.sf-ci__compass.is-free .sf-ci__hub { stroke: var(--sf-gold); }

.sf-ci__compass-word {
  margin-top: var(--sf-space-2);
  font-family: var(--sf-font-display);
  font-size: var(--sf-text-md);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sf-text-secondary);
  transition: color var(--sf-dur-slow) var(--sf-ease-out);
}
.sf-ci__compass.is-free .sf-ci__compass-word { color: var(--sf-teal); }

/* slim progress bar — WORDS carry the meaning; this is texture, no number */
.sf-ci__progress {
  width: 100%;
  max-width: 260px;
  height: 4px;
  border-radius: 999px;
  background: rgba(138, 128, 116, 0.18);
  overflow: hidden;
}
.sf-ci__progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  /* gold-as-material gradient, no emissive bloom */
  background: linear-gradient(90deg, var(--sf-teal), var(--sf-gold));
  transition: width var(--sf-dur-base) var(--sf-ease-out);
}

/* --------------------------------------------------------------- panel */
.sf-ci__panel { min-height: 420px; display: flex; flex-direction: column; }

.sf-ci__back {
  align-self: flex-start;
  background: none;
  border: none;
  padding: var(--sf-space-1) 0;
  margin-bottom: var(--sf-space-3);
  font-family: var(--sf-font-body);
  font-size: var(--sf-text-sm);
  color: var(--sf-text-secondary);
  cursor: pointer;
  transition: color var(--sf-dur-fast) var(--sf-ease-out);
}
.sf-ci__back:hover { color: var(--sf-teal); }
.sf-ci__back[hidden] { display: none; }

/* resume affordance — a returning visitor opens fresh on the first screen but
   can jump back to where they left off (saved state auto-expires after 24h).
   Gold = material text accent, never coral (coral stays CTA-only). */
.sf-ci__resume {
  align-self: flex-start;
  background: none;
  border: none;
  padding: var(--sf-space-1) 0;
  margin-bottom: var(--sf-space-3);
  font-family: var(--sf-font-body);
  font-size: var(--sf-text-sm);
  font-weight: 600;
  color: var(--sf-gold-700);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--sf-dur-fast) var(--sf-ease-out);
}
.sf-ci__resume:hover { color: var(--sf-gold); }
.sf-ci__resume:focus-visible { outline: 2px solid var(--sf-gold); outline-offset: 2px; }
.sf-ci__resume[hidden] { display: none; }

.sf-ci__stage { flex: 1; }

.sf-ci__screen { display: flex; flex-direction: column; gap: var(--sf-space-3); }

.sf-ci__question {
  font-family: var(--sf-font-display);
  font-size: var(--sf-text-2xl);
  line-height: 1.1;
  color: var(--sf-text-primary);
  outline: none;
  max-width: 20ch;
}
.sf-ci__help {
  color: var(--sf-text-secondary);
  font-size: var(--sf-text-base);
  max-width: var(--sf-max-prose);
  margin-top: calc(var(--sf-space-2) * -1);
}

/* option groups (branch screen's Financial / Business split) */
.sf-ci__group { display: flex; flex-direction: column; gap: var(--sf-space-2); }
.sf-ci__group + .sf-ci__group { margin-top: var(--sf-space-3); }
.sf-ci__group-label {
  font-size: var(--sf-text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sf-teal);
  font-weight: 600;
}

.sf-ci__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sf-space-2);
}
@media (max-width: 560px) { .sf-ci__options { grid-template-columns: 1fr; } }

.sf-ci__option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: var(--sf-space-3) var(--sf-space-4);
  background: var(--sf-bg-primary);
  border: 1.5px solid rgba(14, 74, 60, 0.22);
  border-radius: var(--sf-radius-md);
  box-shadow: var(--sf-elevation-1);
  cursor: pointer;
  font-family: var(--sf-font-body);
  transition:
    border-color var(--sf-dur-fast) var(--sf-ease-out),
    box-shadow var(--sf-dur-fast) var(--sf-ease-out),
    transform var(--sf-dur-fast) var(--sf-ease-out),
    background-color var(--sf-dur-fast) var(--sf-ease-out);
}
.sf-ci__option:hover {
  border-color: var(--sf-teal);
  box-shadow: var(--sf-elevation-2);
  transform: translateY(-2px);
}
.sf-ci__option:focus-visible {
  outline: 2px solid var(--sf-teal);
  outline-offset: 2px;
}
.sf-ci__option.is-selected {
  border-color: var(--sf-gold);
  background: var(--sf-bg-alt);
  /* engraved gold edge = foil material cue, not additive glow */
  box-shadow: var(--sf-shadow-gold-edge), var(--sf-elevation-2);
}
.sf-ci__option-label {
  font-size: var(--sf-text-md);
  color: var(--sf-text-primary);
  font-weight: 500;
}
.sf-ci__option-hint {
  font-size: var(--sf-text-sm);
  color: var(--sf-text-secondary);
}

/* ------------------------------------------------------------- contact */
.sf-ci__form { display: flex; flex-direction: column; gap: var(--sf-space-3); max-width: var(--sf-max-prose); }
.sf-ci__field { display: flex; flex-direction: column; gap: 4px; }
.sf-ci__field-label {
  font-size: var(--sf-text-sm);
  color: var(--sf-text-secondary);
  font-weight: 500;
}
.sf-ci__input {
  font-family: var(--sf-font-body);
  font-size: var(--sf-text-md);
  padding: var(--sf-space-3);
  background: var(--sf-bg-primary);
  border: 1.5px solid rgba(14, 74, 60, 0.28);
  border-radius: var(--sf-radius-md);
  color: var(--sf-text-primary);
  transition: border-color var(--sf-dur-fast) var(--sf-ease-out);
}
.sf-ci__input:focus {
  outline: none;
  border-color: var(--sf-teal);
  box-shadow: 0 0 0 3px rgba(14, 74, 60, 0.12);
}
.sf-ci__input.is-invalid { border-color: var(--sf-coral); }
.sf-ci__field-error {
  min-height: 1em;
  font-size: var(--sf-text-sm);
  color: var(--sf-coral-hover);
}
.sf-ci__submit { margin-top: var(--sf-space-2); align-self: flex-start; }

/* -------------------------------------------------------------- result */
.sf-ci__result { gap: var(--sf-space-4); }
.sf-ci__result-kicker {
  font-size: var(--sf-text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sf-gold);
  font-weight: 600;
}
.sf-ci__result-title {
  font-family: var(--sf-font-display);
  font-size: var(--sf-text-3xl);
  line-height: 1.05;
  color: var(--sf-text-primary);
  outline: none;
}
.sf-ci__result-line {
  font-size: var(--sf-text-md);
  color: var(--sf-text-primary);
  max-width: var(--sf-max-prose);
  line-height: 1.5;
}
.sf-ci__result-route {
  font-size: var(--sf-text-base);
  color: var(--sf-text-secondary);
  max-width: var(--sf-max-prose);
  padding: var(--sf-space-3) var(--sf-space-4);
  border-left: 3px solid var(--sf-gold);
  background: var(--sf-bg-alt);
  border-radius: 0 var(--sf-radius-md) var(--sf-radius-md) 0;
}

/* "what to expect" strip (Dana) */
.sf-ci__expect {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sf-space-3);
  padding: 0;
  margin: 0;
}
@media (max-width: 640px) { .sf-ci__expect { grid-template-columns: 1fr; } }
.sf-ci__expect-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sf-space-3);
  background: var(--sf-bg-alt);
  border-radius: var(--sf-radius-md);
}
.sf-ci__expect-num {
  font-family: var(--sf-font-display);
  font-size: var(--sf-text-lg);
  color: var(--sf-teal);
  line-height: 1;
}
.sf-ci__expect-title { font-weight: 600; color: var(--sf-text-primary); font-size: var(--sf-text-base); }
.sf-ci__expect-desc { color: var(--sf-text-secondary); font-size: var(--sf-text-sm); }

/* calendar wrapped in the styled desk frame (never naked — anti-AI #5) */
.sf-ci__calendar-frame {
  margin-top: var(--sf-space-2);
  border: 1.5px solid rgba(14, 74, 60, 0.25);
  border-radius: var(--sf-radius-lg);
  background:
    linear-gradient(180deg, var(--sf-bg-alt), var(--sf-bg-primary) 120px),
    var(--sf-bg-primary);
  box-shadow: var(--sf-elevation-2), var(--sf-shadow-gold-edge);
  overflow: hidden;
}
.sf-ci__calendar-head {
  padding: var(--sf-space-4) var(--sf-space-5) var(--sf-space-2);
  border-bottom: 1px solid rgba(212, 177, 90, 0.35);
}
.sf-ci__calendar-title {
  font-family: var(--sf-font-display);
  font-size: var(--sf-text-lg);
  color: var(--sf-text-primary);
}
.sf-ci__calendar-sub { font-size: var(--sf-text-sm); color: var(--sf-text-secondary); margin-top: 2px; }
.sf-ci__calendar {
  width: 100%;
  min-height: 720px;
  border: none;
  display: block;
  background: transparent;
}
.sf-ci__calendar-fallback {
  padding: var(--sf-space-3) var(--sf-space-5) var(--sf-space-4);
  font-size: var(--sf-text-sm);
  text-align: center;
}
.sf-ci__calendar-link { color: var(--sf-teal); text-decoration: underline; }
.sf-ci__calendar-link:hover { color: var(--sf-coral-hover); }

/* --------------------------------------------------------- responsive */
@media (max-width: 820px) {
  .sf-ci {
    grid-template-columns: 1fr;
    gap: var(--sf-space-4);
  }
  .sf-ci__rail {
    position: static;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--sf-space-3);
  }
  .sf-ci__compass { max-width: 150px; }
  .sf-ci__compass-word { font-size: var(--sf-text-base); }
  .sf-ci__panel { min-height: 0; }
  .sf-ci__question { font-size: var(--sf-text-xl); }
}

/* ----------------------------------------------- reduced motion / no-anim
   JS already jumps states without GSAP under this query; these rules kill
   the CSS transitions so swaps are truly instant (plan perf contract). */
@media (prefers-reduced-motion: reduce) {
  .sf-ci__option,
  .sf-ci__input,
  .sf-ci__progress-fill,
  .sf-ci__needle-blade,
  .sf-ci__needle-tail,
  .sf-ci__compass-word,
  .sf-ci__back,
  .sf-ci__resume { transition: none !important; }
  .sf-ci__option:hover { transform: none; }
}
