/* =========================================================
   Client brief form (also the base styles for /admin/)
   ========================================================= */
:root {
  --bg: #F5F4F0;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --ink: #111114;
  --ink-2: #45454D;
  --ink-3: #6A6A72;
  --line: #E3E0D8;
  --line-strong: #CFCBC1;
  --accent: #2F4BFF;
  --accent-hover: #1F38E0;
  --accent-soft: #E9ECFF;
  --ok: #15803D;
  --ok-soft: #E3F5E9;
  --danger: #C2261B;
  --danger-soft: #FDECEA;
  --warn-soft: #FFF6DB;

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 15.5px/1 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, opacity .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-text { background: none; border: 0; padding: 0 6px; min-height: 40px; color: var(--ink-2); }
.btn-text:hover { color: var(--ink); text-decoration: underline; }
.btn-danger { background: var(--surface); border-color: #F0C4BF; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(245,244,240,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: #fff; font: 700 14px/1 var(--font-display); }
.brand-text { display: grid; line-height: 1.2; }
.brand-text strong { font-size: 15px; font-weight: 600; }
.brand-text span { font-size: 13px; color: var(--ink-3); }
.save-status { font-size: 13.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.save-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-status:empty::before { display: none; }
.progress { height: 3px; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s var(--ease); }

/* ---------- Layout ---------- */
.layout { max-width: 1180px; margin: 0 auto; padding: 32px 20px 80px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
.layout.no-sidebar { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
.sidebar { position: sticky; top: 96px; }
.steps-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps-nav button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; text-align: left; cursor: pointer; color: var(--ink-2); font-size: 15px; font-weight: 500;
}
.steps-nav button:hover { background: rgba(17,17,20,.05); color: var(--ink); }
.steps-nav .num {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid var(--line-strong); font-size: 12.5px; font-weight: 600; color: var(--ink-3); background: var(--surface);
}
.steps-nav [aria-current="step"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.steps-nav [aria-current="step"] .num { border-color: var(--accent); background: var(--accent); color: #fff; }
.steps-nav .is-done .num { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.sidebar-note { margin-top: 24px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); display: grid; gap: 8px; }
.sidebar-note strong { color: var(--ink); font-weight: 600; }

/* ---------- Card / step ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 4vw, 48px); }
.step-kicker { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.step-title { margin-top: 10px; font-size: clamp(30px, 4vw, 42px); }
.step-title:focus { outline: none; }
.step-intro { margin-top: 12px; font-size: 17px; color: var(--ink-2); max-width: 40em; }
.fields { margin-top: 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 20px; }
.field { grid-column: 1 / -1; min-width: 0; }
.field.half { grid-column: span 1; }
fieldset.field { border: 0; margin: 0; padding: 0; }
.field-label, fieldset.field > legend { display: block; padding: 0; margin-bottom: 8px; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.req { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 999px; vertical-align: 1px; }
.hint { margin: -2px 0 10px; font-size: 14px; color: var(--ink-3); }
.error-msg { margin-top: 8px; font-size: 14px; font-weight: 500; color: var(--danger); }

.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 16px; line-height: 1.45;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 96px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 42px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2345454D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 12px center / 20px no-repeat; }
.input::placeholder, .textarea::placeholder { color: #9A9AA2; }
.input:hover, .select:hover, .textarea:hover { border-color: #B9B4A8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47,75,255,.15); }
[aria-invalid="true"] { border-color: var(--danger) !important; }

/* Option pills (radio + checkbox) */
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; display: inline-flex; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 15px; font-weight: 500; cursor: pointer;
  transition: border-color .15s, background-color .15s, color .15s;
}
.options.compact .opt span { min-height: 38px; padding: 7px 13px; border-radius: 999px; font-size: 14.5px; }
.opt span::before {
  content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.opt input[type="checkbox"] + span::before { border-radius: 5px; }
.options.compact .opt span::before { display: none; }
.opt:hover span { border-color: #A9A497; }
.opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: #1A2CB8; }
.opt input:checked + span::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.opt input[type="checkbox"]:checked + span::before { box-shadow: none; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center / 14px no-repeat; }
.opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Style cards */
.style-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.style-card { position: relative; }
.style-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.style-card label { display: block; height: 100%; padding: 8px 8px 12px; border-radius: 16px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.style-card img, .style-card .no-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 10px; background: var(--surface-2); }
.style-card .no-img { display: grid; place-items: center; color: var(--ink-3); font-size: 28px; border: 1px dashed var(--line-strong); }
.style-card strong { display: block; margin-top: 10px; font-size: 15px; font-weight: 600; padding: 0 4px; }
.style-card small { display: block; font-size: 13px; color: var(--ink-3); padding: 0 4px; }
.style-card:hover label { border-color: #A9A497; }
.style-card input:checked + label { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.style-card input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.style-card .look { position: absolute; top: 14px; right: 14px; z-index: 1; padding: 4px 9px; border-radius: 999px; background: rgba(17,17,20,.8); color: #fff; font-size: 12px; font-weight: 600; text-decoration: none; }
.style-card .look:hover { background: var(--ink); }

/* Consent */
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid var(--line); cursor: pointer; font-size: 15px; }
.consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }

/* Colors */
.colors { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.color-item { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 6px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); }
.color-item input[type="color"] { width: 38px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.color-item input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-item input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.15); border-radius: 8px; }
.color-item input[type="text"] { width: 92px; border: 0; font: 500 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; background: none; }
.color-item input[type="text"]:focus { outline: none; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border: 0; border-radius: 9px; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 18px; line-height: 1; }
.icon-btn:hover { background: var(--danger-soft); color: var(--danger); }
.add-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1.5px dashed var(--line-strong); background: transparent; color: var(--ink-2); font-weight: 600; font-size: 15px; cursor: pointer; }
.add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Repeater */
.repeater { display: grid; gap: 12px; }
.rep-item { border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface-2); padding: 16px; }
.rep-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rep-head h3 { font: 600 14px/1 var(--font-body); letter-spacing: 0; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.rep-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rep-fields .sub { display: grid; gap: 6px; }
.rep-fields .sub.wide { grid-column: 1 / -1; }
.rep-fields label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

/* Hours */
.hours { display: grid; gap: 6px; }
.hours-row { display: grid; grid-template-columns: 110px 1fr auto 1fr auto; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); }
.hours-row .day { font-weight: 600; font-size: 15px; }
.hours-row .input { min-height: 40px; padding: 7px 10px; }
.hours-row .dash { color: var(--ink-3); }
.hours-row.is-closed .input { opacity: .35; }
.closed-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.closed-toggle input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.hours-tools { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* Files */
.dropzone {
  position: relative; display: grid; place-items: center; gap: 6px; padding: 28px 20px; text-align: center;
  border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--surface-2); color: var(--ink-2);
  transition: border-color .15s, background-color .15s;
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dropzone strong { color: var(--ink); font-size: 15.5px; }
.dropzone .browse { color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 600; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone small { font-size: 13px; color: var(--ink-3); }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.file-item { position: relative; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.file-thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb .ext { font: 700 13px/1 var(--font-body); letter-spacing: .06em; color: var(--ink-3); padding: 8px 10px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--surface); text-transform: uppercase; }
.file-meta { padding: 8px 10px 10px; display: grid; gap: 6px; }
.file-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 12px; color: var(--ink-3); }
.file-caption { width: 100%; padding: 6px 8px; border-radius: 8px; border: 1.5px solid var(--line); font-size: 13px; }
.file-caption:focus { outline: none; border-color: var(--accent); }
.file-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.file-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.file-item .remove { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(17,17,20,.75); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.file-item .remove:hover { background: var(--danger); }
.file-item.is-error { border-color: #F0C4BF; }
.file-status { font-size: 12px; font-weight: 600; }
.file-status.error { color: var(--danger); }
.file-status.ok { color: var(--ok); }
.file-retry { border: 0; background: none; padding: 0; color: var(--accent); font: 600 12px/1.4 var(--font-body); text-decoration: underline; cursor: pointer; text-align: left; }

/* Step footer */
.step-nav { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.step-nav .spacer { flex: 1; }
.step-count { font-size: 14px; color: var(--ink-3); }

.alert { margin-top: 24px; padding: 14px 16px; border-radius: 12px; font-size: 15px; }
.alert-error { background: var(--danger-soft); color: #8F1B12; border: 1px solid #F3C9C4; }
.alert-warn { background: var(--warn-soft); color: #6B4E00; border: 1px solid #F1DFA4; }

/* Intro + success */
.intro h1 { font-size: clamp(36px, 5.5vw, 58px); letter-spacing: -.035em; }
.intro .lede { margin-top: 16px; font-size: 18.5px; color: var(--ink-2); max-width: 36em; }
.intro-grid { margin-top: 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.intro-tile { padding: 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.intro-tile strong { display: block; font: 700 22px/1.1 var(--font-display); }
.intro-tile span { display: block; margin-top: 6px; font-size: 14.5px; color: var(--ink-2); }
.checklist { margin: 28px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.checklist li { position: relative; padding-left: 30px; font-size: 15.5px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%232F4BFF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 10.5l2.6 2.5L14 7.5'/%3E%3C/svg%3E") center / 20px no-repeat; }
.intro h2 { margin-top: 32px; font-size: 20px; letter-spacing: -.01em; }
.intro-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.welcome-back { margin-top: 24px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); color: #1A2CB8; font-size: 15px; }

.success { text-align: center; padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 72px); }
.success-icon { width: 72px; height: 72px; margin: 0 auto 24px; display: grid; place-items: center; border-radius: 50%; background: var(--ok-soft); }
.success-icon svg { width: 36px; height: 36px; stroke: var(--ok); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.success h1 { font-size: clamp(32px, 5vw, 48px); }
.success p { margin: 14px auto 0; max-width: 32em; font-size: 17.5px; color: var(--ink-2); }
.success .intro-actions { justify-content: center; }

/* Review */
.review { margin-top: 28px; display: grid; gap: 8px; }
.review-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.review-row .count { margin-left: auto; font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.review-row button { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px; }
.review-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); flex: none; }
.review-dot.full { background: var(--ok); }
.review-dot.part { background: #E0A100; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 20px; }
  .sidebar { display: none !important; }
  .style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .layout { padding: 16px 12px 120px; }
  .card { border-radius: 18px; padding: 22px 16px; }
  .fields { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .field.half { grid-column: 1 / -1; }
  .rep-fields { grid-template-columns: minmax(0, 1fr); }
  .intro-grid { grid-template-columns: minmax(0, 1fr); }
  .checklist { grid-template-columns: minmax(0, 1fr); }
  .hours-row { grid-template-columns: 1fr 1fr; row-gap: 6px; }
  .hours-row .day { grid-column: 1 / 2; }
  .hours-row .closed-toggle { grid-column: 2 / 3; justify-self: end; grid-row: 1; }
  .hours-row .dash { display: none; }
  .brand-text span { display: none; }
  .step-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; margin: 0; padding: 12px; background: rgba(255,255,255,.95); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .step-nav .btn { flex: 1; }
  .step-nav .spacer, .step-nav .step-count { display: none; }
  .file-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
