/*
 * Wedge funnel intake quiz styling ([ALM-779]). Used by:
 *   - app/views/layouts/intake_quiz.html.erb
 *   - app/views/intake_quizzes/new.html.erb
 *   - app/views/intake_quizzes/handoff.html.erb
 * Mobile-first; max-width caps for desktop.
 */

:root {
  --plaster: #F6F1E9;
  --plaster-warm: #EDE7DB;
  --plaster-deep: #E2DACB;
  --beam: #2C4A3E;
  --beam-light: #3A6355;
  --beam-muted: rgba(44, 74, 62, 0.08);
  --honey: #C49A3C;
  --honey-light: #D4AD5A;
  --ink: #2A2520;
  --ink-mid: #5C5347;
  --ink-light: #8A8076;
  --white: #FEFCF8;
  --error: #B85440;
}

.intake-shell {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  color: var(--ink);
  background: var(--plaster);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.intake-shell__top {
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
}

.intake-shell__brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--beam);
  text-decoration: none;
}

.intake-shell .flash {
  background: rgba(184, 84, 64, 0.1);
  color: var(--error);
  padding: 0.85rem 1.25rem;
  border-left: 3px solid var(--error);
  font-size: 0.95rem;
  max-width: 640px;
  margin: 0 auto 1rem;
  width: calc(100% - 2rem);
  border-radius: 0 0.25rem 0.25rem 0;
}

.intake-shell__main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem);
}

.intake {
  width: 100%;
  max-width: 620px;
  background: var(--white);
  border: 1px solid var(--beam-muted);
  border-radius: 0.75rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: 0 4px 24px rgba(42, 37, 32, 0.04);
}

.intake__header {
  margin-bottom: 2rem;
}

.intake__eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--honey);
  margin-bottom: 0.75rem;
}

.intake__progress {
  height: 6px;
  background: var(--plaster-deep);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.intake__progress-bar {
  height: 100%;
  background: var(--beam);
  border-radius: 999px;
  transition: width 0.25s ease;
  width: 16.66%;
}

.intake__progress-label {
  font-size: 0.85rem;
  color: var(--ink-light);
}

.intake__form {
  margin: 0;
}

.intake__errors {
  background: rgba(184, 84, 64, 0.08);
  border-left: 3px solid var(--error);
  padding: 0.85rem 1rem;
  border-radius: 0 0.25rem 0.25rem 0;
  margin-bottom: 1.5rem;
  color: var(--error);
}
.intake__errors p { font-weight: 500; margin-bottom: 0.4rem; }
.intake__errors ul { margin: 0; padding-left: 1.25rem; font-size: 0.95rem; }

.intake__step {
  border: 0;
  padding: 0;
  margin: 0;
}

.intake__legend {
  display: block;
  margin-bottom: 1.5rem;
  padding: 0;
}

.intake__step-heading {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 3.5vw, 1.85rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.intake__step-sub {
  display: block;
  font-size: 1rem;
  color: var(--ink-mid);
  line-height: 1.5;
}

.intake__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-mid);
  margin-bottom: 0.5rem;
}

.intake__input,
.intake__textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid rgba(44, 74, 62, 0.2);
  border-radius: 0.4rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.intake__textarea { resize: vertical; min-height: 6.5rem; }

.intake__input:focus,
.intake__textarea:focus {
  outline: none;
  border-color: var(--beam);
  box-shadow: 0 0 0 3px var(--beam-muted);
}

.intake__hint {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-top: 0.5rem;
}

/* ---- multi-select chips (Q2 mind tags) ---- */
.intake__choices--multi {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.intake__chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.intake__chip-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.intake__chip-label {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  background: var(--plaster-warm);
  color: var(--ink-mid);
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.intake__chip-input:checked + .intake__chip-label {
  background: var(--beam);
  color: var(--white);
  border-color: var(--beam);
}
.intake__chip-input:focus-visible + .intake__chip-label {
  outline: 3px solid var(--honey);
  outline-offset: 2px;
}

/* ---- radio choices (Q4 deadline) ---- */
.intake__choices--single {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.intake__choice {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(44, 74, 62, 0.15);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.intake__choice:hover { background: var(--plaster); }
.intake__choice-input { margin-top: 0.25rem; flex-shrink: 0; accent-color: var(--beam); }
.intake__choice-input:checked ~ .intake__choice-body .intake__choice-label { color: var(--beam); }
.intake__choice:has(.intake__choice-input:checked) {
  border-color: var(--beam);
  background: var(--beam-muted);
}
.intake__choice-body { display: flex; flex-direction: column; gap: 0.15rem; }
.intake__choice-label { font-weight: 500; color: var(--ink); }
.intake__choice-hint { font-size: 0.9rem; color: var(--ink-mid); }

/* ---- budget slider (Q3) ---- */
.intake__slider { width: 100%; position: relative; }
.intake__slider-value {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.25rem;
  font-weight: 500;
  color: var(--beam);
  text-align: center;
  margin-bottom: 1.25rem;
  transition: color 0.1s ease;
}
.intake__slider-input {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: linear-gradient(
    to right,
    var(--beam) var(--fill, 21%),
    var(--plaster-deep) var(--fill, 21%)
  );
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.intake__slider-input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
}
.intake__slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  background: var(--beam);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: 0 1px 4px rgba(42, 37, 32, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.intake__slider-input:hover::-webkit-slider-thumb {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(44, 74, 62, 0.3);
}
.intake__slider-input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(196, 154, 60, 0.3), 0 1px 4px rgba(42, 37, 32, 0.25);
}
.intake__slider-input::-moz-range-track {
  height: 6px;
  background: var(--plaster-deep);
  border-radius: 999px;
  border: none;
}
.intake__slider-input::-moz-range-progress {
  height: 6px;
  background: var(--beam);
  border-radius: 999px;
}
.intake__slider-input::-moz-range-thumb {
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  background: var(--beam);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: 0 1px 4px rgba(42, 37, 32, 0.25);
  transition: transform 0.12s ease;
}
.intake__slider-input:hover::-moz-range-thumb {
  transform: scale(1.15);
}
.intake__slider-input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(196, 154, 60, 0.3);
}
.intake__slider-ticks {
  position: relative;
  margin-top: 0.625rem;
  height: 1.25rem;
}
.intake__slider-tick {
  position: absolute;
  font-size: 0.75rem;
  color: var(--ink-light);
  transform: translateX(-50%);
  white-space: nowrap;
}
.intake__slider-tick--first { transform: translateX(0); }
.intake__slider-tick--last  { transform: translateX(-100%); }

/* ---- per-step inline error from Stimulus ---- */
.intake__step-error {
  margin-top: 1rem;
  color: var(--error);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ---- bottom actions ---- */
.intake__actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2rem;
  align-items: center;
}
.intake__actions:has(.intake__btn--ghost) { justify-content: space-between; }
.intake__actions:not(:has(.intake__btn--ghost)) { justify-content: flex-end; }

.intake__btn {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.02rem;
  padding: 0.8rem 1.4rem;
  border-radius: 0.4rem;
  cursor: pointer;
  border: 0;
  transition: background 0.15s ease, transform 0.1s ease;
}
.intake__btn:focus-visible {
  outline: 3px solid var(--honey);
  outline-offset: 2px;
}

.intake__btn--primary {
  background: var(--beam);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(44, 74, 62, 0.16);
}
.intake__btn--primary:hover {
  background: var(--beam-light);
  transform: translateY(-1px);
}
.intake__btn--submit { font-weight: 500; }

.intake__btn--ghost {
  background: transparent;
  color: var(--ink-mid);
}
.intake__btn--ghost:hover {
  color: var(--ink);
  background: var(--plaster);
}

.intake__footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--beam-muted);
  font-size: 0.85rem;
  color: var(--ink-light);
  text-align: center;
}
.intake__footer a {
  color: var(--ink);
  text-decoration: underline;
}

/* ---- handoff (post-submit) view ---- */
.intake--handoff {
  text-align: center;
}
.intake__handoff-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 500;
  color: var(--ink);
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}
.intake__handoff-sub {
  color: var(--ink-mid);
  margin-bottom: 2rem;
}
.intake__handoff-form { margin: 0 auto; max-width: 320px; }
.intake__handoff-form .intake__btn { width: 100%; }
