/* wusa.ai — the providers onboarding sheet (/providers/#start). Loaded only on /providers/ and /en/providers/.
   Uses the tokens in site.css only (colour, radius, easing, Thmanyah). One centred column; title, pill dots, subtitle;
   cards and chips for every bounded choice; Back as a quiet ghost button, Next as the wide primary.
   Motion: each step fades and rises 16px over 500ms on cubic-bezier(0.16, 1, 0.3, 1); nothing moves with reduced motion.
   Red is the error colour here (the stop token), as in the spec: the form has no stop signal of its own. */

.ob[hidden], .ob [hidden] { display: none !important; }
html.ob-open, html.ob-open body { overflow: hidden; }

.ob {
  position: fixed; inset: 0; z-index: 80; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; overscroll-behavior: contain;
  animation: ob-fade 0.24s var(--ease-colour) both;
}
.ob::before { /* the soft lavender light behind the column (desktop only) */
  content: ""; position: absolute; top: -220px; inset-inline-start: -220px; width: 620px; height: 620px; border-radius: 50%;
  background: var(--glow); opacity: 0.32; filter: blur(110px); pointer-events: none; display: none;
}
@media (min-width: 900px) { .ob::before { display: block; } }
.ob-form { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; margin: 0; }

/* ---------------------------------------------------------------- top bar: step counter and close */
.ob-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(10px, env(safe-area-inset-top)) clamp(14px, 3vw, 28px) 4px;
}
.ob-count { font-size: 15px; color: var(--muted); line-height: 1.4; }
.ob-x {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--tint); color: var(--ink); transition: background-color var(--t-colour) var(--ease-colour);
}
.ob-x:hover { background: color-mix(in srgb, var(--tint) 70%, var(--glow)); }
.ob-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------------------------------------------------------------- the column */
.ob-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 8px 20px 40px; }
.ob-step { width: 100%; max-width: 600px; margin-inline: auto; }
.ob-step.is-in { animation: ob-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes ob-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes ob-fade { from { opacity: 0; } to { opacity: 1; } }

.ob-head { text-align: center; padding-block: clamp(8px, 4vh, 40px) 8px; }
.ob-title { font: 500 clamp(28px, 1.6vw + 18px, 40px)/1.3 var(--font-display); outline: none; }
.ob-title:focus-visible { outline: 2px solid var(--primary); outline-offset: 6px; }
.ob-sub { margin-block-start: 10px; color: var(--muted); font-size: 17px; line-height: 1.6; }
html[lang="en"] .ob-title { line-height: 1.2; }

/* pill dots: the current step is a long lavender pill, done steps are short lavender pills, the rest are quiet */
.ob-dots { display: flex; justify-content: center; align-items: center; gap: 6px; margin-block-start: 16px; }
.ob-dots i {
  display: block; height: 6px; width: 16px; border-radius: var(--r-pill); background: var(--line);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s var(--ease-colour);
}
.ob-dots i.is-done { background: color-mix(in srgb, var(--primary) 55%, var(--bg)); }
.ob-dots i.is-now { width: 32px; background: var(--primary); }

/* ---------------------------------------------------------------- questions */
.ob-q { margin: 28px 0 0; padding: 0; border: 0; min-width: 0; }
.ob-label {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; padding: 0; margin-block-end: 10px;
  font-size: 16px; font-weight: 500; line-height: 1.5; color: var(--ink);
}
.ob-label label { cursor: pointer; }
.ob-opt-tag, .ob-hint-inline { font-weight: 400; font-size: 14px; color: var(--muted); }
.ob-err { margin-inline-start: auto; font-size: 14px; font-weight: 500; color: var(--stop); }
.ob-err:empty { display: none; }
.ob-err-block { display: block; margin-block-start: 6px; margin-inline-start: 34px; }
.ob-hint { margin-block-start: 6px; font-size: 14px; line-height: 1.55; color: var(--muted); }

/* hidden-but-focusable native inputs inside cards and chips */
.ob-card input, .ob-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }

/* tap-cards (single choice) */
.ob-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ob-cards-1 { grid-template-columns: minmax(0, 1fr); }
.ob-card {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px;
  border-radius: var(--r-inner); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer;
  font-size: 17px; font-weight: 500; line-height: 1.4;
  transition: box-shadow var(--t-colour) var(--ease-colour), background-color var(--t-colour) var(--ease-colour);
}
.ob-card:hover { box-shadow: inset 0 0 0 1.5px var(--glow); }
.ob-card:has(input:checked) { background: var(--tint); box-shadow: inset 0 0 0 2px var(--primary); }
.ob-card:has(input:focus-visible), .ob-chip:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }
.ob-card:last-child:nth-child(odd):not(.ob-card-wide) { grid-column: 1 / -1; }
.ob-ic { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ob-card-wide { flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 18px; }
.ob-desc { font-size: 15px; font-weight: 400; color: var(--muted); line-height: 1.5; }

/* chips (bounded choices; checkboxes for "pick all that apply") */
.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer;
  font-size: 16px; line-height: 1.3;
  transition: box-shadow var(--t-colour) var(--ease-colour), background-color var(--t-colour) var(--ease-colour), color var(--t-colour) var(--ease-colour);
}
.ob-chip:hover { box-shadow: inset 0 0 0 1.5px var(--glow); }
.ob-chip:has(input:checked) { background: var(--tint); box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); font-weight: 500; }
.ob-chip:has(input[type="checkbox"])::before {
  content: ""; width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px currentColor; flex: none; opacity: 0.6;
}
.ob-chip:has(input[type="checkbox"]:checked)::before {
  opacity: 1; background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='m3.5 7.2 2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: none;
}
.ob-chips-sm { margin-block-start: 10px; }
.ob-chips-sm .ob-chip { min-height: 40px; padding: 0 14px; font-size: 15px; }

/* text fields */
.ob-input {
  display: block; width: 100%; min-height: 52px; padding: 0 16px; border: 0; border-radius: 14px;
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line);
  font: 400 17px/1.4 var(--font-body); transition: box-shadow var(--t-colour) var(--ease-colour);
}
.ob-input:hover { box-shadow: inset 0 0 0 1.5px var(--glow); }
.ob-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.ob-input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--stop); }
textarea.ob-input { padding: 12px 16px; min-height: 96px; resize: vertical; line-height: 1.6; }
.ob-input::placeholder { color: var(--muted); opacity: 0.7; }
.ob-phone { display: flex; gap: 8px; }
.ob-phone .ob-cc { width: auto; flex: none; padding: 0 12px; cursor: pointer; }
.ob-phone input { flex: 1; min-width: 0; }

.ob-notice {
  display: flex; align-items: center; gap: 12px; margin-block-start: 24px; padding: 12px 16px;
  border-radius: var(--r-inner); background: var(--tint); font-weight: 500; font-size: 16px; line-height: 1.5;
}
.ob-notice-i { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 700; }
.ob-notice-i::before { content: "!"; }

.ob-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 16px; line-height: 1.6; }
.ob-check input { width: 22px; height: 22px; margin: 3px 0 0; flex: none; accent-color: var(--primary); cursor: pointer; }
.ob-check a { color: var(--primary); }
.ob-check:has(input[aria-invalid="true"]) input { outline: 2px solid var(--stop); outline-offset: 2px; }

.ob-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; inset-inline-start: -9999px; }

/* ---------------------------------------------------------------- footer: Back (quiet) and Next (wide) */
.ob-alert {
  margin: 0 auto 8px; width: calc(100% - 40px); max-width: 600px; padding: 10px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--stop) 8%, var(--bg)); color: var(--stop); font-size: 15px; font-weight: 500; line-height: 1.5;
}
.ob-foot {
  display: flex; gap: 10px; padding: 12px max(20px, calc((100% - 600px) / 2)) max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg);
}
.ob-foot .btn { min-height: 52px; }
.ob-back { flex: none; padding: 0 24px; }
.ob-next { flex: 1; position: relative; }
.ob-next[aria-disabled="true"] { background: color-mix(in srgb, var(--primary) 32%, var(--bg)); color: color-mix(in srgb, var(--on-primary) 92%, transparent); cursor: not-allowed; }
.ob-next[aria-disabled="true"]:active { transform: none; }
.ob-spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-inline-end-color: transparent; animation: ob-turn 0.8s linear infinite; }
.ob-next.is-sending .ob-spin { display: inline-block; }
@keyframes ob-turn { to { transform: rotate(360deg); } }
.ob.is-end .ob-foot { display: none; }

/* ---------------------------------------------------------------- done and fallback */
.ob-end { text-align: center; padding-block-start: clamp(16px, 6vh, 64px); }
.ob-tick { width: 60px; height: 60px; margin: 0 auto 18px; }
.ob-tick circle { fill: var(--tint); stroke: var(--primary); stroke-width: 2; }
.ob-tick path { fill: none; stroke: var(--primary); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.ob-ref { margin-block-start: 14px; font-size: 15px; color: var(--muted); }
.ob-ref bdi { color: var(--ink); font-weight: 500; letter-spacing: 0.02em; }
.ob-summary {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 10px 20px; margin: 24px 0 0; padding: 18px 20px;
  border-radius: var(--r-inner); background: var(--tint); text-align: start; font-size: 15px; line-height: 1.55;
}
.ob-summary dt { color: var(--muted); }
.ob-summary dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.ob-end-actions { margin-block-start: 22px; display: flex; justify-content: center; }
.ob-end .ob-label { margin-block-start: 22px; }
.ob-fb-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; margin-block-start: 18px; }
.ob-mail { font-size: 20px; font-weight: 500; color: var(--primary); }
.ob-fb-text { min-height: 210px; padding: 14px 16px; font-size: 15px; line-height: 1.6; text-align: start; white-space: pre-wrap; resize: vertical; }
.ob-status { margin-block-start: 10px; min-height: 1.5em; font-size: 15px; color: var(--muted); }
#ob-h-fb { font-size: clamp(24px, 1.2vw + 17px, 32px); }

/* ---------------------------------------------------------------- confirm before closing */
.ob-confirm { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 20px; background: rgb(28 26 51 / 0.36); animation: ob-fade 0.2s var(--ease-colour) both; }
.ob-confirm-card { width: 100%; max-width: 420px; padding: 28px; border-radius: var(--r-card); background: var(--surface); box-shadow: 0 18px 50px var(--lift); text-align: center; }
.ob-confirm-h { font: 500 26px/1.35 var(--font-display); outline: none; }
.ob-confirm-card p { margin-block-start: 8px; color: var(--muted); }
.ob-confirm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-block-start: 22px; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 560px) {
  .ob-scroll { padding-inline: 16px; }
  .ob-cards { gap: 8px; }
  .ob-card { min-height: 60px; padding: 10px 12px; gap: 10px; font-size: 16px; }
  .ob-ic { width: 22px; height: 22px; }
  .ob-summary { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ob-summary dd + dt { margin-block-start: 10px; }
  .ob-foot { padding-inline: 16px; }
  .ob-back { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .ob, .ob-step.is-in, .ob-confirm { animation: none; }
  .ob-dots i, .ob-card, .ob-chip, .ob-input, .ob-x { transition: none; }
  .ob-spin { animation-duration: 2.4s; }
}
