/* Automate it! customer portal. One question per screen, a step menu under
   the progress bar. Brand: ink, cobalt, sky, mist, amber dot (brand file). */
:root {
  --ink: #0A1A3F; --ink-2: #13275A; --cobalt: #2856F6; --cobalt-hover: #1E44D4; --sky: #DCE6FF; --mist: #F3F6FC;
  --slate: #5B6782; --line: #C3D1F5; --amber: #FFB02E; --amber-tint: #FFF3DC; --amber-text: #9A5B00;
  --error: #C8322B; --error-tint: #FCECEB; --ok: #0F8A5F; --ok-tint: #E3F4EC; --white: #fff;
  --head: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-in: 8px; --r-btn: 12px; --r-card: 16px;
  --shadow: 0 1px 2px rgba(10, 26, 63, .05), 0 8px 24px -8px rgba(10, 26, 63, .12);
  --wrap: 560px;
  color-scheme: light;
}
* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--mist); color: var(--ink); font: 16px/1.55 var(--body); min-height: 100dvh; display: flex; flex-direction: column; }
::selection { background: var(--sky); color: var(--ink); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--cobalt) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
a { color: var(--cobalt); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -.02em; margin: 0; color: var(--ink); }
[hidden] { display: none !important; }
h1:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: var(--white); border-bottom: 1px solid var(--sky); }
.brand { display: flex; flex: none; }
.brand img { display: block; border-radius: 9px; }
.who { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.shopname { font: 700 16px var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { color: var(--slate); font-size: 13px; }
.iconbtn { width: 44px; height: 44px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--white); display: grid; place-items: center; cursor: pointer; flex: none; color: var(--ink); }
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:hover { border-color: var(--cobalt); }
.popmenu { position: absolute; right: 16px; top: calc(100% + 6px); min-width: 220px; background: var(--white); border: 1px solid var(--sky); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 6px; }
.popmenu button, .popmenu a { display: block; width: 100%; text-align: left; background: none; border: 0; font: 500 15px var(--body); color: var(--ink); padding: 11px 12px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.popmenu button:hover, .popmenu a:hover { background: var(--mist); }
.popmenu .meta { padding: 8px 12px 10px; color: var(--slate); font-size: 13px; border-bottom: 1px solid var(--sky); margin-bottom: 4px; overflow-wrap: anywhere; }

/* Layout */
.app { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left)) calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; outline: none; }
.panel { background: var(--white); border: 1px solid var(--sky); border-radius: var(--r-card); box-shadow: var(--shadow); padding: clamp(20px, 5vw, 32px); }

/* Progress + step menu */
.progress { position: relative; margin-bottom: 16px; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.steplabel { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--white); font: 500 14px var(--body); color: var(--ink); cursor: pointer; text-align: left; }
.steplabel:hover { border-color: var(--cobalt); }
.steplabel b { font-weight: 600; }
.steplabel .count { color: var(--slate); white-space: nowrap; }
.steplabel .caret { margin-left: auto; width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.steplabel[aria-expanded="true"] .caret { transform: rotate(180deg); }
.bar { height: 6px; border-radius: 3px; background: var(--sky); margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--cobalt); border-radius: 3px; transition: width .35s cubic-bezier(.2,.8,.2,1); }
.steps { position: absolute; z-index: 10; left: 0; right: 0; top: 52px; list-style: none; margin: 0; padding: 6px; background: var(--white); border: 1px solid var(--sky); border-radius: var(--r-card); box-shadow: var(--shadow); max-height: min(70dvh, 520px); overflow: auto; }
.steps button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 10px; border: 0; background: none; border-radius: 10px; font: 500 15px var(--body); color: var(--ink); cursor: pointer; text-align: left; }
.steps button:hover { background: var(--mist); }
.steps button[aria-current="step"] { background: var(--sky); font-weight: 600; }
.steps button:disabled { color: var(--slate); cursor: not-allowed; background: none; }
.dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font: 600 12px var(--body); color: var(--slate); }
.dot.done { background: var(--cobalt); border-color: var(--cobalt); color: var(--white); }
.dot.done svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.steps .state { margin-left: auto; color: var(--slate); font-size: 13px; font-weight: 400; }

/* Question */
.q { display: flex; flex-direction: column; gap: 18px; }
.q h1 { font-size: clamp(26px, 6vw, 32px); font-weight: 800; line-height: 1.12; text-wrap: balance; }
.q .help { color: var(--slate); margin: -8px 0 0; max-width: 60ch; }
.fields { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 500; font-size: 14px; }
.field small { color: var(--slate); font-size: 13px; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=password], input[type=time], select, .codebox {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-in); background: var(--white);
  font: 16px var(--body); color: var(--ink); caret-color: var(--cobalt);
}
input::placeholder { color: #7C87A3; }
input:hover, select:hover { border-color: #9DB2EA; }
input:focus, select:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 20%, transparent); }
input[aria-invalid="true"] { border-color: var(--error); }
.row2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
@media (max-width: 380px) { .row2 { grid-template-columns: minmax(0,1fr); } }
.codebox { font: 600 26px/1 var(--body); letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* Chips and choices */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 480px) { .chips.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); } .chips.week .chip { min-width: 0; padding-inline: 4px; } }
.chip { min-height: 44px; min-width: 56px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font: 500 15px var(--body); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--cobalt); }
.chip[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: var(--white); }
.choices { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--white); cursor: pointer; text-align: left; font: inherit; color: inherit; }
.choice:hover { border-color: var(--cobalt); }
.choice[aria-pressed="true"], .choice[aria-checked="true"] { border-color: var(--cobalt); background: color-mix(in srgb, var(--sky) 45%, var(--white)); }
.choice .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; margin-top: 1px; }
.choice[role="radio"] .box { border-radius: 50%; }
.choice[aria-pressed="true"] .box, .choice[aria-checked="true"] .box { background: var(--cobalt); border-color: var(--cobalt); }
.choice .box svg { width: 14px; height: 14px; fill: none; stroke: var(--white); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.choice[aria-pressed="true"] .box svg, .choice[aria-checked="true"] .box svg { opacity: 1; }
.choice b { display: block; font-weight: 600; }
.choice .desc { color: var(--slate); font-size: 14px; }
.choice .price { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.choice .price small { display: block; max-width: 7.5em; margin-left: auto; color: var(--slate); font-weight: 400; font-size: 12px; }

/* Buttons */
.actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap: 10px; margin-top: 8px; }
.actions.single { grid-template-columns: minmax(0,1fr); }
@media (max-width: 767px) {
  .q > .actions { position: sticky; bottom: 0; z-index: 5; margin: 8px calc(-1 * clamp(20px, 5vw, 32px)) calc(-1 * clamp(20px, 5vw, 32px)); padding: 12px clamp(20px, 5vw, 32px) calc(12px + env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--sky); border-radius: 0 0 var(--r-card) var(--r-card); }
}
.btn { min-height: 48px; padding: 12px 18px; border-radius: var(--r-btn); border: 1px solid transparent; font: 600 16px var(--body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.btn.primary { background: var(--cobalt); color: var(--white); }
.btn.primary:hover { background: var(--cobalt-hover); }
.btn.ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--cobalt); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn img, .btn svg { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--slate); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--sky); }
.textlink { background: none; border: 0; padding: 0; color: var(--cobalt); font: 500 15px var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: start; min-height: 44px; }

/* Messages */
.msg { border-radius: var(--r-btn); padding: 12px 14px; font-size: 15px; }
.msg.error { background: var(--error-tint); color: #8E211C; }
.msg.ok { background: var(--sky); color: var(--ink-2); }
.msg.note { background: var(--mist); color: var(--ink-2); border: 1px solid var(--sky); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Logo picker, color picker */
.logo { display: flex; align-items: center; gap: 14px; }
.logo .preview { width: 72px; height: 72px; border-radius: 14px; border: 1px dashed var(--line); background: var(--mist) center/contain no-repeat; flex: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.swatch.custom { display: grid; place-items: center; background: var(--white); position: relative; overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Lists (team, review, shops) */
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--sky); border-radius: var(--r-card); }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--sky); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; overflow-wrap: break-word; word-break: normal; }
.list li.member { flex-wrap: wrap; }
.list li.member .grow { flex-basis: 100%; }
.list li.member .badge { margin-right: auto; }
.list .meta { color: var(--slate); font-size: 13px; }
.badge { font: 600 12px var(--body); border-radius: 999px; padding: 3px 10px; background: var(--mist); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--cobalt); color: var(--white); }
.badge.wait { background: var(--sky); color: var(--ink-2); }
a.rowlink { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; }
a.rowlink .edit { color: var(--cobalt); font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
a.rowlink:hover .edit { color: var(--cobalt-hover); }

/* Done */
.live-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--amber); display: inline-block; margin-right: 8px; vertical-align: middle; }
.foot { margin-top: auto; padding-top: 24px; text-align: center; color: var(--slate); font-size: 13px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
