:root {
  --canvas: #f3f5f1;
  --surface: #ffffff;
  --ink: #17211b;
  --ink-soft: #5d675f;
  --ink-faint: #899189;
  --accent: #176b4d;
  --accent-deep: #104c38;
  --accent-soft: #dceee5;
  --line: rgba(23, 33, 27, .12);
  --danger: #a83636;
  --font-interface: 'Manrope', sans-serif;
  --font-display: 'Fraunces', serif;
  --ease-spring: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background-color: var(--canvas);
  background-image: linear-gradient(rgba(23, 107, 77, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 107, 77, .035) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--font-interface);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
[hidden] { display: none !important; }

.client-header {
  display: flex;
  width: min(100% - 32px, 920px);
  min-height: 72px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
}
.client-header small { font-size: .75rem; }
.client-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; text-decoration: none; }
.client-brand span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 7px; background: var(--ink); color: #fff; }
.client-header-actions { display: flex; align-items: center; gap: 18px; }
.install-button { display: inline-flex; min-height: 40px; align-items: center; padding: 9px 14px; border-radius: 7px; background: var(--accent); color: #fff; box-shadow: 0 7px 18px rgba(23,107,77,.18); font-size: .75rem; font-weight: 700; text-decoration: none; }
.install-button:hover { background: var(--accent-deep); }
.install-button:focus-visible { outline: 3px solid rgba(23,107,77,.25); outline-offset: 2px; }

.client-main { display: grid; min-height: calc(100vh - 72px); min-height: calc(100svh - 72px); place-items: start center; padding: clamp(32px, 8vh, 88px) 16px calc(48px + env(safe-area-inset-bottom)); }
.brief-flow, .message-state { width: min(100%, 680px); }
progress { display: block; width: 100%; height: 3px; margin-bottom: 46px; border: 0; border-radius: 0; background: rgba(23, 33, 27, .08); color: var(--accent); }
progress::-webkit-progress-bar { background: rgba(23, 33, 27, .08); }
progress::-webkit-progress-value { background: var(--accent); transition: width .3s ease; }
progress::-moz-progress-bar { background: var(--accent); }

[data-step] { min-height: 355px; }
.step-exit-forward { animation: step-exit-forward 220ms var(--ease-in) both; }
.step-exit-backward { animation: step-exit-backward 220ms var(--ease-in) both; }
.step-enter-forward { animation: step-enter-forward 460ms var(--ease-spring) both; }
.step-enter-backward { animation: step-enter-backward 460ms var(--ease-spring) both; }
.step-label { margin: 0 0 12px; color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { max-width: 620px; margin: 0; outline: none; font: 700 clamp(2rem, 7vw, 3.7rem)/1.04 var(--font-display); }
.step-copy, .message-state > p:last-of-type { max-width: 540px; margin: 16px 0 30px; color: var(--ink-soft); font-size: .95rem; line-height: 1.7; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 32px; }
.choice-grid label { position: relative; min-width: 0; }
.choice-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice-grid span { display: flex; min-height: 62px; align-items: center; padding: 14px 16px; border-radius: 7px; background: rgba(255,255,255,.72); box-shadow: 0 5px 18px rgba(23,33,27,.05); cursor: pointer; transition: background .2s ease, box-shadow .2s ease, transform .2s ease; }
.choice-grid input:checked + span { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.choice-grid input:focus-visible + span { outline: 3px solid rgba(23,107,77,.25); outline-offset: 2px; }

.field { display: grid; gap: 8px; margin-top: 28px; }
.field > span { color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; min-height: 50px; padding: 13px 14px; border: 0; border-radius: 7px; outline: 1px solid var(--line); background: rgba(255,255,255,.82); color: var(--ink); }
.field textarea { min-height: 132px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); }
.field [aria-invalid="true"] { outline-color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.brief-review { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin: 28px 0 0; }
.brief-review div { padding: 15px 0; border-bottom: 1px solid var(--line); }
.brief-review dt { margin-bottom: 5px; color: var(--ink-faint); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.brief-review dd { margin: 0; overflow-wrap: anywhere; line-height: 1.45; }
.brief-error { margin: 16px 0 0; color: var(--danger); font-size: .82rem; }

.brief-actions { display: flex; min-height: 54px; margin-top: 34px; align-items: center; justify-content: flex-end; gap: 12px; }
.continue-button, .back-button { min-height: 46px; padding: 11px 20px; border: 0; border-radius: 7px; cursor: pointer; font-weight: 700; text-decoration: none; }
.continue-button { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; box-shadow: 0 9px 24px rgba(23,107,77,.2); }
.continue-button:hover { background: var(--accent-deep); }
.continue-button:disabled { cursor: wait; opacity: .55; }
.back-button { background: transparent; color: var(--ink-soft); }
.back-button:hover { background: rgba(23,33,27,.05); }
.continue-button:focus-visible, .back-button:focus-visible { outline: 3px solid rgba(23,107,77,.25); outline-offset: 2px; }
.message-state { padding-top: 40px; }
.message-state .continue-button { margin-top: 12px; }

@keyframes step-exit-forward { to { opacity: 0; transform: translateY(-28px) scale(.98); } }
@keyframes step-exit-backward { to { opacity: 0; transform: translateY(28px) scale(.98); } }
@keyframes step-enter-forward { from { opacity: 0; transform: translateY(32px) scale(.97); } }
@keyframes step-enter-backward { from { opacity: 0; transform: translateY(-32px) scale(.97); } }
@media (max-width: 560px) {
  .client-header small { display: none; }
  .client-header-actions { gap: 0; }
  .install-button { min-height: 36px; padding: 8px 11px; font-size: .7rem; }
  .client-main { padding-top: 28px; }
  progress { margin-bottom: 34px; }
  [data-step] { min-height: 390px; }
  .choice-grid, .field-row, .brief-review { grid-template-columns: 1fr; }
  .choice-grid span { min-height: 56px; }
  .brief-actions { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--canvas) 24%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}