/* Guided three-step layout. Accent is the blue from the RSE logo. */
:root {
  --navy: #0B1633;
  --accent: #0a76bc;
  --accent-dark: #075d95;
  --accent-tint: #EAF4FB;
  --ink: #111827;
  --muted: #4B5563;
  --line: #E3E6EE;
  --field: #C9CFDC;
  --bg: #F5F6FA;
  --ok: #0E7C4A;
  --ok-tint: #E7F6EF;
  --error: #B42318;
  --radius: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--bg);
}

input, textarea, button { font: inherit; color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h2:focus { outline: none; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Header ---------- */
.hero { background: var(--navy); color: #fff; }

.hero-inner {
  padding-top: 24px;
  padding-bottom: 88px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

.logo-chip {
  display: inline-flex;
  background: #fff;
  border-radius: 8px;
  padding: 4px 10px;
}
.logo-chip img { display: block; height: 32px; width: auto; }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #B8C2DD;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -1px;
}

.lead { margin: 0; max-width: 600px; font-size: 17px; line-height: 1.55; color: #C9D1E6; }

/* ---------- Main ---------- */
.main { margin-top: -56px; padding-bottom: 64px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Progress */
.progress {
  padding: 18px 20px;
  box-shadow: 0 12px 32px -18px rgba(11, 22, 51, .35);
}
.progress ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.progress li { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.progress .bar { height: 4px; border-radius: 4px; background: var(--line); }
.progress-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.progress .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: #F1F3F8; color: var(--muted);
}
.progress li.is-active .bar { background: var(--accent); }
.progress li.is-active .progress-label { color: var(--ink); }
.progress li.is-active .dot { background: var(--accent); color: #fff; }
.progress li.is-done .bar { background: var(--ok); }
.progress li.is-done .progress-label { color: var(--ink); }
.progress li.is-done .dot { background: var(--ok-tint); color: var(--ok); }

/* Steps: each section shows one of head (upcoming), summary (done) or body (active). */
.step { overflow: hidden; }
.step-head, .step-summary, .step-body { display: none; }
.step[data-state="upcoming"] .step-head { display: flex; }
.step[data-state="done"] .step-summary { display: flex; }
.step[data-state="active"] .step-body { display: flex; }

.step-head { align-items: center; gap: 16px; padding: 20px 24px; }
.step-num {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--field);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--muted);
}
.step-head-title { font-weight: 600; color: var(--muted); }

.step-summary { align-items: center; gap: 16px; padding: 20px 24px; flex-wrap: wrap; }
.tick {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ok-tint); color: var(--ok);
  display: flex; align-items: center; justify-content: center;
}
.tick svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
}
.summary-text { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.summary-label {
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
}
.summary-main { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.summary-meta { font-size: 14px; color: var(--muted); }

.change, .secondary {
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--field);
  border-radius: 10px;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.change:hover, .secondary:hover { border-color: var(--accent); color: var(--accent); }

.step-body { flex-direction: column; gap: 22px; padding: 24px; }
.step-body h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.2px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
fieldset.field { border: 0; margin: 0; padding: 0; gap: 10px; }
legend { padding: 0; display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
label, .label { font-size: 14px; font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }

input:not([type="checkbox"]):not([type="radio"]), textarea {
  width: 100%;
  border: 1.5px solid var(--field);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 16px;
}
input:not([type="checkbox"]):not([type="radio"]) { height: 52px; padding: 0 14px; }
textarea { padding: 14px; resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: #8A92A3; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.error { margin: 0; font-size: 13px; color: var(--error); }
.error:empty { display: none; }

.status { margin: 0; font-size: 14px; color: var(--muted); }
.status:empty { display: none; }
.status.is-error { color: var(--error); }
.status.is-loading::before {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  margin-right: 8px;
  vertical-align: -1px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Search */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 6px 0 14px;
  border: 1.5px solid var(--field);
  border-radius: var(--radius-sm);
  background: #fff;
}
.search-bar:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-icon {
  flex: none; width: 20px; height: 20px;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}
.search-bar input:not([type="checkbox"]) {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  outline: none;
}
.search-bar input::-webkit-search-cancel-button { cursor: pointer; }
.search-button {
  flex: none;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.search-button:hover { background: var(--accent-dark); }

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.results:empty { display: none; }
.results li + li { border-top: 1px solid var(--line); }

.event-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px;
  border: 0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.event-row:hover { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); }
.event-when { flex: none; width: 116px; display: flex; flex-direction: column; gap: 2px; }
.when-date { font-size: 15px; font-weight: 700; white-space: nowrap; }
.when-sub { font-size: 13px; color: var(--muted); white-space: nowrap; }
.event-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.event-name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.event-place { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.link-button {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.link-button:hover { color: var(--accent-dark); text-decoration: underline; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  min-width: 48px;
  min-height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--field);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }

.chip-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--field);
  border-radius: var(--radius-sm);
  background: #fff;
}
.chip-input.is-on { border-color: var(--accent); background: var(--accent-tint); }
.chip-input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip-input input:not([type="checkbox"]) {
  width: 64px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
#budget-exact-box input { width: 110px; text-align: left; }
.unit { font-size: 13px; color: var(--muted); }
.unit-strong { font-weight: 700; font-size: 15px; }

/* Actions */
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.back {
  min-height: 48px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
}
.back:hover { color: var(--ink); }
.primary {
  margin-left: auto;
  height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}
.primary:hover { background: var(--accent-dark); }
.primary:disabled { opacity: .6; cursor: progress; }

.privacy { margin: 0; font-size: 13px; color: var(--muted); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Done */
.done {
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  box-shadow: 0 12px 32px -18px rgba(11, 22, 51, .35);
}
.done h2 { margin: 4px 0 0; font-size: 24px; }
.done p { margin: 0; color: var(--muted); }
.tick-lg { width: 56px; height: 56px; }
.tick-lg svg { width: 28px; height: 28px; }
.reference { font-size: 14px; }
.reference strong {
  margin-left: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .5px;
}
.done .secondary { margin-top: 8px; }

/* Footer */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: #fff; }
.site-footer .wrap { padding-top: 20px; padding-bottom: 20px; font-size: 13px; color: var(--muted); }

/* Small screens */
@media (max-width: 520px) {
  .step-body { padding: 20px 16px; }
  .step-summary, .step-head { padding: 16px; }
  .progress { padding: 14px; }
  .progress .text { font-size: 12px; }
  .event-row { gap: 12px; padding: 12px; }
  .event-when { width: 100px; }
  .actions .primary { flex: 1 1 100%; order: -1; }
  .actions .back { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .status.is-loading::before { animation: none; }
}
