/* KitchenDrop onboarding. Depends on brand.css. */

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(70% 45% at 50% -8%, var(--brand-wash) 0%, transparent 70%),
    var(--bg);
}

/* A phone is the page; anywhere wider it is a card on the page, not a strip
   of it with the rest of the window left bare on either side. */
.setup {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  padding-bottom: 32px;
  background: var(--bg);
}

.setup-legal { margin-top: auto; padding: 28px 22px 0; }

.setup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}

.setup-bar .kd-logo {
  font-size: 1rem;
}

/* ---------- Progress ---------- */

.progress {
  padding: 22px 22px 4px;
}

.progress-bar {
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.progress-bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 0.35s var(--ease);
}

.progress-marks {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
}

/* Each step numbered, and ticked once it is behind you, so "how much is
   left" is read off the marks rather than worked out from a bar. */
.mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-4);
  transition: color 0.2s var(--ease);
}

.mark::before {
  content: attr(data-step);
  display: grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.mark.is-done { color: var(--fg-2); }

.mark.is-done::before {
  content: "";
  border-color: transparent;
  background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.mark.is-current {
  color: var(--fg);
  font-weight: 600;
}

.mark.is-current::before {
  border-color: transparent;
  background: var(--brand-ink);
  color: var(--on-brand);
}

/* ---------- Steps ---------- */

.step {
  display: none;
  padding: 26px 22px 0;
}

.step.is-active {
  display: block;
  animation: kd-step 0.24s var(--ease);
}

@keyframes kd-step {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.step h1 {
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  margin-bottom: 9px;
}

/* The two halves of the last step: what comes in, and what goes out. */
.step-sub {
  margin: 24px 0 12px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.step-lead + .step-sub { margin-top: 0; }

.optional {
  margin-left: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-4);
}

.field-pair > .field { margin-bottom: 0; }
.pair-hint { display: block; margin: 6px 0 18px; font-size: 0.8125rem; line-height: 1.45; color: var(--fg-3); }

.setup-optional {
  margin: 4px 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.setup-optional summary {
  padding: 13px 14px;
  color: var(--fg-2);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.setup-optional summary span {
  margin-left: 5px;
  color: var(--fg-3);
  font-size: 0.75rem;
  font-weight: 500;
}

.setup-optional-body {
  padding: 2px 14px 14px;
  border-top: 1px solid var(--line-soft);
}

.setup-optional-body .field:last-child { margin-bottom: 0; }

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--bad);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
}

.field-error[hidden] { display: none; }

.input[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px var(--bad-wash);
}
.chips-hint { display: block; margin: -2px 0 10px; }

.cuisine-own { margin-top: 14px; }
.cuisine-own label { display: block; margin-bottom: 6px; font-size: 0.8125rem; font-weight: 500; color: var(--fg-2); }

.step-lead {
  max-width: 48ch;
  margin-bottom: 26px;
  font-size: 0.9375rem;
  color: var(--fg-2);
  line-height: 1.6;
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.step-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ---------- Chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 0.45em 0.8em;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--fg-2);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--fg);
}

/* Picked reads the way a picked tone or voice does below it -- the wash and
   the brand edge -- not as a solid orange pill louder than Continue. */
.chip.is-on {
  background: var(--brand-wash);
  border-color: var(--brand);
  color: var(--brand-strong);
  font-weight: 600;
}

/* ---------- Tone cards ---------- */

.tones {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 7px;
}

.tone {
  position: relative;
  padding: 14px 44px 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.tone:hover {
  border-color: var(--line-strong);
}

.tone b {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.tone span {
  display: block;
  font-size: 0.8125rem;
  color: var(--fg-3);
  line-height: 1.5;
}

.tone.is-on {
  border-color: var(--brand);
  background: var(--brand-wash);
}

.tone.is-on::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 15px;
  height: 8px;
  margin-top: -6px;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}

/* ---------- Voice grid ---------- */

.voices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 7px;
}

.voice {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.voice:hover {
  border-color: var(--line-strong);
}

.voice-pick {
  display: block;
  width: 100%;
  padding: 12px 14px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.voice b {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}

.voice span {
  display: block;
  font-size: 0.8125rem;
  color: var(--fg-3);
  margin-top: 1px;
}

.voice.is-on {
  border-color: var(--brand);
  background: var(--brand-wash);
}

/* Its own control inside the card: hearing a voice must not select it. */
.voice .voice-hear {
  display: inline-block;
  margin: 7px 14px 12px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
}

.voice .voice-hear:hover {
  text-decoration: underline;
}

.voice:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-wash);
}

/* Six voices and whichever is chosen; the rest wait behind a link. */
.voices.is-folded .voice:nth-child(n+7):not(.is-on) { display: none; }

.voices-more {
  margin: 10px 0 4px;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-strong);
  cursor: pointer;
}

.voices-more:hover { text-decoration: underline; }
.voices-more[hidden] { display: none; }

/* ---------- Done ---------- */

.done {
  padding-top: 8px;
}

.done-art {
  width: 100%;
  height: 168px;
  object-fit: cover;
  border-radius: var(--r-lg);
  margin-bottom: 22px;
  box-shadow: var(--shadow-2);
}

.done-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.channel-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.channel-link:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.channel-link > svg:first-child {
  width: 21px;
  height: 21px;
  flex: none;
}

.channel-link span {
  flex: 1;
}

.channel-link b {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
}

.channel-link em {
  display: block;
  font-size: 0.8125rem;
  font-style: normal;
  color: var(--fg-3);
}

.channel-link .chev {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--fg-4);
}

.done-links .btn {
  margin-top: 7px;
}

.done-links .btn:first-child {
  margin: 0 0 7px;
}

.done-plan {
  color: var(--fg);
  font-weight: 500;
}

.done-later {
  align-self: center;
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--fg-3);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.done-later:hover { color: var(--fg); }
.done-later[hidden] { display: none; }

@media (max-width: 420px) {
  .field-pair,
  .voices {
    grid-template-columns: 1fr;
  }

  .step h1 {
    font-size: 1.5rem;
  }
}

@media (min-width: 640px) {
  body { padding: 40px 16px 56px; }

  .setup {
    min-height: 0;
    align-self: flex-start;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-2);
    overflow: hidden;
  }

  .setup-bar { padding: 16px 28px; }
  .progress { padding: 24px 28px 4px; }
  .step { padding: 28px 28px 0; }
}

/* The messaging opt-in under the WhatsApp number. Only shown once a number is
   typed, and unticked when it appears. */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--fg-2);
  cursor: pointer;
}
.consent-row[hidden] { display: none; }
.consent-row input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Location suggestions stay next to the input, with enough room for addresses. */
.restaurant-search { position: relative; }
.restaurant-suggestions {
  margin-top: 6px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.restaurant-suggestions[hidden], .identity-review[hidden] { display: none; }
.restaurant-suggestion {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.restaurant-suggestion:last-child { border-bottom: 0; }
.restaurant-suggestion b { display: block; font-size: 0.9375rem; }
.restaurant-suggestion span { display: block; margin-top: 3px; color: var(--fg-2); font-size: 0.8125rem; overflow-wrap: anywhere; }
.restaurant-suggestion:hover, .restaurant-suggestion[aria-selected="true"] { background: var(--brand-wash); }
.restaurant-suggestion:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
.lookup-manual { margin-top: 8px; padding: 6px 0; border: 0; background: transparent; color: var(--brand-strong); font: inherit; font-size: 0.8125rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.identity-review h1 { margin-bottom: 8px; font-size: 1.375rem; }
.identity-summary { margin: 22px 0; padding: 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.identity-source { color: var(--fg-3); font-size: 0.75rem; }
.identity-summary h3 { margin: 10px 0 8px; font-size: 1.125rem; }
.identity-summary p { margin: 6px 0 0; color: var(--fg-2); overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .identity-review .step-foot { flex-wrap: wrap; }
  .identity-review .step-foot .btn { flex: 1 1 auto; }
}
