/* Reflective&Co intake — matches the Figma wireframe (Step 3 frame + Wireframe kit). */
:root {
  --chrome: #f6f6f6;      /* header / outer shell */
  --page: #ffffff;        /* body panel */
  --card: #f3f3f3;        /* step cards */
  --panel: #e9e9e9;       /* question panel */
  --ink: #1a1a1a;
  --ink-2: #444444;
  --ink-3: #8a8a8a;
  --ink-4: #a0a0a0;
  --line: #d0d0d0;
  --divider: #d4d4d4;
  --track: #d9d9d9;
  --stack-2: #e4e4e4;
  --stack-3: #d9d9d9;
  --blue: #007aff;
  --blue-press: #0066d6;
  --select-fill: #e6f0ff;
  --select-ink: #0060d6;
  --error: #c62828;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--chrome);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 16px 24px; background: var(--chrome);
}
.logo { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; letter-spacing: 0.08em; }
.logo svg { display: block; }
.progress { display: grid; justify-items: center; gap: 6px; }
.progress-track { width: 220px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.progress-fill { height: 100%; background: var(--ink); border-radius: 3px; transition: width 0.4s ease; }
.progress-label { font-size: 11px; color: var(--ink-3); }
.header-actions { justify-self: end; }

/* ---------- Buttons ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 9px 16px;
  font-size: 13px; font-weight: 500; line-height: 1.2;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-press); }
.btn-secondary { background: var(--track); color: var(--ink); }
.btn-secondary:hover { background: #cfcfcf; }
.btn-outline { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-outline:hover { background: #fafafa; }
.btn[disabled] { opacity: 0.45; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; color: var(--select-ink); font-size: 13px; font-weight: 500; }

/* ---------- Layout ---------- */
.body {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px;
  min-height: calc(100vh - 70px);
  padding: 16px; background: var(--page);
  border-radius: 20px 20px 0 0;
}
.nav {
  position: sticky; top: 86px; align-self: start; /* stays put below the sticky header */
  display: grid; align-content: start; gap: 16px; padding: 28px 0 0 16px;
}
.nav button {
  justify-self: start; background: none; border: 0; padding: 0 0 4px;
  font-size: 14px; text-align: left; border-bottom: 1px solid transparent;
}
.nav .done { color: #6b6b6b; }
.nav .done:hover { color: var(--ink); }
.nav .active { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.nav .upcoming { color: var(--ink-4); cursor: default; }
.steps { display: grid; gap: 16px; align-content: start; min-width: 0; }

/* ---------- Step cards ---------- */
.card { background: var(--card); border-radius: 20px; padding: 28px 24px; }
.card-inner { width: min(560px, 100%); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.card-title { margin: 0 0 8px; font-size: 22px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
.meta { display: flex; gap: 16px; color: var(--ink-3); font-size: 14px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.status { flex: none; width: 20px; height: 20px; }

.card.current { padding: 36px 24px 40px; display: grid; gap: 28px; justify-items: center; }
.card.current .card-inner { width: min(560px, 100%); }

.panel {
  width: min(560px, 100%); background: var(--panel); border-radius: 16px;
  padding: 22px 20px; display: grid; gap: 22px;
}
.field { display: grid; gap: 10px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 0; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field-helper { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.field-error { font-size: 12px; color: var(--error); }
.field.has-error .chip:not(.selected), .field.has-error .input { box-shadow: inset 0 0 0 1px var(--error); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 0; border-radius: 999px; padding: 8px 14px;
  background: #fff; color: #333; font-size: 13px; font-weight: 500; line-height: 1.2;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.chip:hover { box-shadow: inset 0 0 0 1px #a8a8a8; }
.chip.selected { background: var(--select-fill); color: var(--select-ink); box-shadow: inset 0 0 0 1.5px var(--blue); }
.chip[disabled] { opacity: 0.4; cursor: default; }

/* Inputs */
.input {
  width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: #fff; font-size: 13px;
}
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6.5L8 10l3.5-3.5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
select.input.placeholder { color: var(--ink-3); }
textarea.input { height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input::placeholder { color: var(--ink-4); }

.divider { height: 1px; background: var(--divider); }
.actions { display: flex; justify-content: space-between; align-items: center; }

/* ---------- Completed stack ---------- */
.stack { position: relative; padding-top: 24px; }
.stack::before, .stack::after {
  content: ""; position: absolute; height: 72px; border-radius: 18px;
}
.stack::before { top: 0; left: 40px; right: 40px; background: var(--stack-3); }
.stack::after { top: 12px; left: 20px; right: 20px; background: var(--stack-2); border-radius: 19px; }
.stack.single::before { display: none; }
.stack.single { padding-top: 12px; }
.stack.single::after { top: 0; }
.stack-front {
  position: relative; z-index: 1; width: 100%; border: 0; text-align: left;
  background: var(--card); border-radius: 20px; padding: 18px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}
.stack-front .card-inner { gap: 12px; }
.stack-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stack-title { font-size: 16px; font-weight: 500; }
.stack-meta { font-size: 12px; color: var(--ink-3); }
.stack-right { display: flex; align-items: center; gap: 10px; flex: none; }
.pill { background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 500; color: var(--ink-2); box-shadow: inset 0 0 0 1px #dadada; }
.chevron { transition: transform 0.2s ease; }
.stack.open .chevron { transform: rotate(180deg); }
.stack.bump .stack-front { animation: drop-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes drop-in {
  from { transform: translateY(40px) scale(0.98); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}
.stack-list { position: relative; z-index: 1; margin-top: 8px; background: var(--card); border-radius: 16px; padding: 6px 24px; }
.stack-row { width: min(560px, 100%); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.stack-row + .stack-row { border-top: 1px solid var(--divider); }

/* ---------- Results ---------- */
.results { display: grid; gap: 24px; width: min(640px, 100%); margin: 0 auto; }
.results h2 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -0.01em; }
.results .lede { margin: 6px 0 0; color: var(--ink-3); }
.saving {
  background: var(--panel); border-radius: 16px; padding: 22px 20px;
  display: grid; gap: 6px;
}
.saving-label { font-size: 12px; font-weight: 500; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.saving-figure { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.saving-note { font-size: 12px; color: var(--ink-3); }
.saving-split { display: flex; gap: 24px; margin-top: 8px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.results .section-title { margin: 0; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.recs { display: grid; gap: 12px; }
.rec { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: inset 0 0 0 1px #e2e2e2; display: grid; gap: 6px; }
.rec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rec-name { font-size: 16px; font-weight: 500; }
.rec-desc { color: var(--ink-2); font-size: 13px; }
.rec-why { margin: 4px 0 0; padding-left: 18px; color: var(--ink-3); font-size: 12px; }
.fit { flex: none; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 3px 10px; }
.fit-strong { background: var(--select-fill); color: var(--select-ink); }
.fit-good { background: #ececec; color: var(--ink-2); }
.fit-later { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1px #dedede; }
.all-tools { background: #fff; border-radius: 14px; box-shadow: inset 0 0 0 1px #e2e2e2; padding: 6px 20px; }
.tool-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 90px; gap: 12px; align-items: center; padding: 10px 0; font-size: 13px; }
.tool-row + .tool-row { border-top: 1px solid #ededed; }
.tool-goal { color: var(--ink-3); font-size: 12px; }
.bar { height: 6px; border-radius: 3px; background: #ececec; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.notice { background: #fff8e1; color: #5d4a00; border-radius: 12px; padding: 12px 14px; font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .body { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .nav { display: none; }
  .header { grid-template-columns: auto 1fr; gap: 12px; padding: 12px 16px; }
  .progress { grid-column: 1 / -1; grid-row: 2; }
  .progress-track { width: 100%; }
  .card, .card.current { padding-left: 16px; padding-right: 16px; }
  .panel { padding: 18px 14px; }
  .tool-row { grid-template-columns: minmax(0, 1fr) 70px; }
  .tool-row .bar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Software fields + results additions ---------- */
.sw-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; padding: 10px 0; font-size: 13px; align-items: baseline; }
.sw-row + .sw-row { border-top: 1px solid #ededed; }
.cta { display: grid; gap: 14px; background: #fff; border-radius: 14px; padding: 20px; box-shadow: inset 0 0 0 1px #e2e2e2; }
.cta-title { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.cta-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 860px) {
  .sw-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cta .actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .cta-buttons { justify-content: stretch; }
  .cta-buttons .btn { flex: 1; }
}

/* ---------- Searchable dropdown ---------- */
.ss { position: relative; }
.ss-input {
  padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.5' stroke='%23777' stroke-width='1.5' fill='none'/%3E%3Cpath d='M10.5 10.5L14 14' stroke='%23777' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.ss-input.ss-free {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6.5L8 10l3.5-3.5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.ss-input[aria-expanded="true"] { box-shadow: inset 0 0 0 1.5px var(--blue); }
.ss-list {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 288px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: #fff; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.ss-opt { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.ss-opt.active { background: #f0f0f0; }
.ss-opt.selected { color: var(--select-ink); font-weight: 500; }
.ss-opt.selected::after { content: "✓"; font-size: 12px; }
.ss-empty { padding: 8px 10px 4px; font-size: 12px; color: var(--ink-3); }

/* ---------- Results sent by email ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sent-head { display: flex; gap: 16px; align-items: flex-start; }
.sent-icon {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--select-fill); color: var(--select-ink); font-weight: 600; font-size: 18px;
}
[data-send="error"] .sent-icon { background: #fdecea; color: var(--error); }
.sent-title { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -0.01em; }
.sent-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--select-fill); border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
