/* The setup wizard, copied from Lite (lite-merged.html, "ONBOARDING V2" and the WhatsApp notice).
   Every rule is Lite's own, scoped under .lite-setup so the CRM's stylesheets and Lite's keep apart;
   Lite's tokens and base type are set on the scope instead of :root and html. body.onboarding-active
   in Lite is .lite-setup here. Two rules are not Lite's and are marked: the "Don't share chats"
   instruction and the acknowledgement checkbox, both drawn from Lite's own neighbours. */
.lite-setup {
  --ink: #172033;
  --muted: #687386;
  --line: #e5e3df;
  --soft: #f7f7f5;
  --navy: #18243a;
  --green: #147a52;
  --green-soft: #edf8f3;
  --blue: #2f62a4;
  --blue-soft: #edf3fb;
  --amber: #95600b;
  --amber-soft: #fff7e7;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: #fbfaf8;
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.lite-setup *, .lite-setup *::before, .lite-setup *::after { box-sizing: border-box; }
.lite-setup button, .lite-setup input, .lite-setup select { font: inherit; color: inherit; letter-spacing: normal; }
.lite-setup button { cursor: pointer; }
.lite-setup button:focus-visible, .lite-setup input:focus-visible, .lite-setup select:focus-visible, .lite-setup summary:focus-visible {
  outline: 3px solid rgba(47, 98, 164, .22);
  outline-offset: 2px;
}
.lite-setup h1:focus { outline: none; }

.lite-setup .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 0 13px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 780;
  box-shadow: none;
}
.lite-setup .btn:hover { background: var(--soft); }
.lite-setup .btn.primary { border-color: var(--navy); background: var(--navy); color: #fff; }
.lite-setup .btn.primary:hover { background: #23324d; }
.lite-setup .btn:disabled { cursor: not-allowed; opacity: .48; }
.lite-setup .btn.primary:disabled:hover { background: var(--navy); }
.lite-setup .select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 0 11px;
  font-size: 11px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' stroke='%23586470' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px;
  padding-right: 38px;
}

/* WhatsApp notice and card */
.lite-setup .wa-setup-card { margin-top: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(26,35,55,.04); }
.lite-setup .wa-setup-card .wa-connection-notice { border: 0; }
.lite-setup .wa-setup-card .wa-notice-warning { margin-top: 18px; padding: 12px 14px; border-left: 3px solid #dbac61; border-radius: 0 7px 7px 0; background: #fff8ed; color: #756044; font-size: 11px; }
.lite-setup .wa-setup-actions { display: grid; gap: 11px; padding: 0 28px 26px; }
.lite-setup .wa-setup-actions .btn { display: inline-flex; width: 100%; min-height: 46px; align-items: center; justify-content: center; gap: 10px; padding: 12px 18px; border-radius: 9px; font-size: 12px; }
.lite-setup .wa-setup-actions .btn svg { width: 18px; height: 18px; }
.lite-setup .wa-connection-notice { padding: 22px 28px; border-top: 1px solid var(--line); }
.lite-setup .wa-connection-notice h3 { margin: 0 0 8px; color: var(--ink); font-size: 15px; line-height: 1.4; }
.lite-setup .wa-notice-intro, .lite-setup .wa-notice-warning { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.lite-setup .wa-notice-warning { margin-top: 10px; }
.lite-setup .wa-notice-warning strong { color: var(--ink); font-weight: 650; }
.lite-setup .wa-notice-details { margin-top: 14px; }
.lite-setup .wa-notice-details summary { display: flex; width: fit-content; align-items: center; gap: 7px; border-radius: 4px; color: var(--blue); font-size: 12px; font-weight: 650; cursor: pointer; list-style: none; }
.lite-setup .wa-notice-details summary::-webkit-details-marker { display: none; }
.lite-setup .wa-notice-details summary svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .15s ease; }
.lite-setup .wa-notice-details[open] summary svg { transform: rotate(180deg); }
.lite-setup .wa-notice-list { display: grid; gap: 14px; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); list-style: none; }
.lite-setup .wa-notice-item h4 { margin: 0 0 4px; color: var(--ink); font-size: 12px; line-height: 1.45; }
.lite-setup .wa-notice-item p, .lite-setup .wa-notice-footnote { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.lite-setup .wa-notice-footnote { margin-top: 16px; }
/* Not Lite's: the "Don't share chats" instruction. The notice's intro line, with the choice set in
   the warning's strong ink so the label to look for on the phone stands out. */
.lite-setup .wa-notice-instruction { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.lite-setup .wa-notice-instruction strong { color: var(--ink); font-weight: 650; white-space: nowrap; }
/* Not Lite's: the acknowledgement checkbox. Lite's registration terms checkbox (.registration-terms). */
.lite-setup .wa-ack { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 4px 0; color: var(--ink); font-size: 12px; line-height: 1.6; cursor: pointer; }
.lite-setup .wa-ack input { flex: 0 0 16px; width: 16px; height: 16px; min-height: 0; margin: 2px 0 0; accent-color: var(--navy); cursor: pointer; }
@media (max-width: 600px) {
  .lite-setup .wa-setup-actions { padding: 0 20px 22px; }
  .lite-setup .wa-connection-notice { padding: 20px; }
}

/* Connection form */
.lite-setup .onboarding-form { display: grid; gap: 15px; margin-top: 24px; }
.lite-setup .onboarding-field { display: grid; gap: 7px; }
.lite-setup .onboarding-field > span { font-size: 10px; font-weight: 800; }
.lite-setup .onboarding-field .select { width: 100%; min-height: 46px; font-size: 11px; }

/* ONBOARDING V2 — focused three-step account connection flow. */
.lite-setup main { width: min(1360px, calc(100% - 48px)); margin: auto; padding: 36px 0 54px; }
.lite-setup .setup-header { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #fffdfa; }
.lite-setup .setup-header img { width: 110px; height: auto; }
.lite-setup .setup-top-actions { display: flex; margin-left: auto; align-items: center; color: var(--muted); font-size: 11px; }
.lite-setup .setup-exit { min-height: 40px; border: 0; border-radius: 9px; background: transparent; padding: 0 10px; color: var(--ink); font-weight: 820; }
.lite-setup .setup-exit:hover { background: var(--soft); }
.lite-setup .setup-wizard {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  gap: 28px;
  align-items: start;
  justify-content: center;
}
.lite-setup .setup-wizard-sidebar,
.lite-setup .setup-wizard-summary {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e1e1df;
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 10px 35px rgba(26, 35, 55, .055);
}
.lite-setup .setup-plan {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  padding: 22px 18px;
}
.lite-setup .setup-plan-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; background: #eef2ff; color: #1769ee; }
.lite-setup .setup-plan-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lite-setup .setup-plan b, .lite-setup .setup-plan small { display: block; }
.lite-setup .setup-plan b { font-size: 13px; }
.lite-setup .setup-plan small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.lite-setup .setup-steps { margin: 0; padding: 22px 12px; list-style: none; }
.lite-setup .setup-step {
  position: relative;
  display: grid;
  min-height: 58px;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 8px 12px;
  color: #657084;
  font-size: 11px;
  font-weight: 720;
}
.lite-setup .setup-step + .setup-step::before { content: ""; position: absolute; left: 29px; top: -7px; height: 14px; border-left: 1px dashed #d9dde3; }
.lite-setup .setup-step-index { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #d9dde3; border-radius: 50%; background: #fff; color: var(--ink); font-size: 11px; }
.lite-setup .setup-step.active { background: var(--navy); color: #fff; }
.lite-setup .setup-step.active .setup-step-index { border-color: #fff; background: transparent; color: #fff; }
.lite-setup .setup-step.done { color: var(--green); }
.lite-setup .setup-step.done .setup-step-index { border-color: #78c69f; background: var(--green-soft); color: var(--green); }
.lite-setup .setup-wizard-main { min-width: 0; display: flex; flex-direction: column; padding: 8px 0 0; }
.lite-setup .setup-kicker { color: #8d631c; font-size: 10px; font-weight: 850; letter-spacing: .16em; }
.lite-setup .setup-wizard-main h1 { max-width: 760px; margin: 14px 0 0; color: #0d1c3b; font-size: clamp(28px, 2.5vw, 36px); line-height: 1.15; letter-spacing: -.045em; }
.lite-setup .setup-lead { margin: 13px 0 0; color: #657084; font-size: 13px; line-height: 1.55; }
.lite-setup .setup-task {
  display: grid;
  flex: 0 0 auto;
  margin-top: 28px;
  border: 1px solid #dedfdf;
  border-radius: 16px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 28px rgba(26,35,55,.04);
}
.lite-setup .setup-connection-task { padding: 24px; }
.lite-setup .setup-connection-task h2 { margin: 0; font-size: 18px; line-height: 1.4; }
.lite-setup .setup-connection-task .onboarding-form { margin-top: 22px; }
.lite-setup .setup-task h2 { margin: 22px 0 0; font-size: 24px; letter-spacing: -.025em; }
.lite-setup .setup-task p { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.lite-setup .setup-connected { display: inline-flex; min-height: 42px; align-items: center; gap: 8px; margin-top: 24px; border-radius: 999px; background: var(--green-soft); padding: 0 15px; color: var(--green); font-size: 11px; font-weight: 820; }
.lite-setup .setup-connected::before { content: "✓"; display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; }
.lite-setup .setup-provider-grid { display: grid; min-height: 430px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; border: 0; background: transparent; box-shadow: none; }
.lite-setup .setup-provider-card { display: flex; min-width: 0; flex-direction: column; align-items: center; border: 1px solid #dedfdf; border-radius: 16px; background: rgba(255,255,255,.88); padding: 34px 30px 28px; text-align: center; }
.lite-setup .setup-provider-card.connected { border-color: #9bcfb2; box-shadow: 0 0 0 2px rgba(20,122,82,.08); }
.lite-setup .setup-provider-logo { display: grid; width: 76px; height: 76px; place-items: center; border-radius: 18px; background: #f3f5f8; }
.lite-setup .setup-provider-logo svg { width: 48px; height: 48px; }
.lite-setup .setup-provider-card h2 { margin-top: 20px; font-size: 20px; }
.lite-setup .setup-provider-state { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; border-radius: 999px; background: #f3f4f6; padding: 5px 9px; color: var(--muted); font-size: 9px; }
.lite-setup .setup-provider-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lite-setup .setup-provider-card.connected .setup-provider-state { background: var(--green-soft); color: var(--green); }
.lite-setup .setup-provider-card p { min-height: 40px; margin: 18px 0 0; line-height: 1.6; }
.lite-setup .setup-provider-card .btn { width: 100%; min-height: 48px; margin-top: auto; border-color: #1769ee; color: #1769ee; font-size: 11px; }
.lite-setup .setup-provider-card .setup-connected { width: 100%; min-height: 48px; justify-content: center; margin-top: auto; border-radius: 9px; }
.lite-setup .setup-complete-task { min-height: 430px; align-content: center; justify-items: center; padding: 36px; }
.lite-setup .setup-success-mark { display: grid; width: 92px; height: 92px; place-items: center; border-radius: 50%; background: #e6f6eb; color: #11934c; font-size: 44px; }
.lite-setup .setup-complete-list { width: min(520px, 100%); margin-top: 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.lite-setup .setup-complete-row { display: grid; min-height: 66px; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 0 18px; }
.lite-setup .setup-complete-row + .setup-complete-row { border-top: 1px solid var(--line); }
.lite-setup .setup-complete-row svg { width: 28px; height: 28px; }
.lite-setup .setup-complete-row b { font-size: 11px; }
.lite-setup .setup-complete-row span:last-child { color: var(--green); font-size: 9px; font-weight: 800; }
.lite-setup .setup-complete-note { margin-top: 24px; color: var(--muted); font-size: 11px; }
.lite-setup .setup-wizard-footer { display: flex; min-height: 74px; align-items: center; justify-content: flex-end; gap: 18px; }
.lite-setup .setup-wizard-footer .btn { min-width: 140px; min-height: 46px; font-size: 11px; }
.lite-setup .setup-wizard-footer .btn.primary { min-width: 210px; background: #0b2858; }
.lite-setup .setup-wizard-summary { padding: 24px 20px; }
.lite-setup .setup-wizard-summary h2 { margin: 0; font-size: 15px; }
.lite-setup .setup-summary-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 20px 0; }
.lite-setup .setup-summary-row + .setup-summary-row { border-top: 1px dashed #dfe2e7; }
.lite-setup .setup-summary-logo { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: #f2f4f8; }
.lite-setup .setup-summary-logo.whatsapp { background: var(--green-soft); }
.lite-setup .setup-summary-logo svg { width: 24px; height: 24px; }
.lite-setup .setup-summary-copy b, .lite-setup .setup-summary-copy small { display: block; }
.lite-setup .setup-summary-copy b { font-size: 11px; }
.lite-setup .setup-summary-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.lite-setup .setup-summary-check { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid #cfd5de; border-radius: 50%; color: #a1a9b6; font-size: 10px; }
.lite-setup .setup-summary-check.connected { border-color: #51b47e; color: var(--green); }

@media (max-width: 1280px) {
  .lite-setup .setup-wizard { grid-template-columns: minmax(0, 800px); justify-content: center; gap: 22px; }
  .lite-setup .setup-wizard-sidebar { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .lite-setup .setup-wizard-sidebar,
  .lite-setup .setup-wizard-summary { min-height: 0; }
  .lite-setup .setup-plan { display: none; }
  .lite-setup .setup-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0; }
  .lite-setup .setup-step { min-height: 52px; }
  .lite-setup .setup-step + .setup-step::before { display: none; }
  .lite-setup .setup-wizard-summary { grid-column: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 0 22px; }
  .lite-setup .setup-wizard-summary h2 { grid-column: 1 / -1; margin-bottom: 4px; }
  .lite-setup .setup-summary-row { border-top: 0 !important; }
}

@media (max-width: 760px) {
  .lite-setup main { width: 100%; padding: 20px 14px 42px; }
  .lite-setup .setup-header { min-height: 60px; padding: 8px 14px; }
  .lite-setup .setup-wizard { min-height: 0; grid-template-columns: 1fr; gap: 16px; }
  .lite-setup .setup-wizard-sidebar { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .lite-setup .setup-plan { display: none; }
  .lite-setup .setup-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0; }
  .lite-setup .setup-step { min-height: 50px; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; padding: 6px; font-size: 9px; }
  .lite-setup .setup-step + .setup-step::before { display: none; }
  .lite-setup .setup-step-index { width: 26px; height: 26px; }
  .lite-setup .setup-wizard-main { padding: 4px 0 0; }
  .lite-setup .setup-wizard-main h1 { font-size: 31px; }
  .lite-setup .setup-lead { font-size: 11px; }
  .lite-setup .setup-task { margin-top: 20px; }
  .lite-setup .setup-provider-grid { min-height: 0; grid-template-columns: 1fr; }
  .lite-setup .setup-provider-card { min-height: 330px; padding: 26px 22px 22px; }
  .lite-setup .setup-complete-task { min-height: 380px; padding: 26px 16px; }
  .lite-setup .setup-wizard-footer { min-height: 64px; gap: 10px; }
  .lite-setup .setup-wizard-footer .btn { min-width: 0; flex: 1; }
  .lite-setup .setup-wizard-footer .btn.primary { min-width: 0; }
  .lite-setup .setup-wizard-summary { grid-column: auto; display: block; padding: 20px; }
  .lite-setup .setup-summary-row + .setup-summary-row { border-top: 1px dashed #dfe2e7 !important; }
  .lite-setup .btn { min-height: 44px; }
}
/* END ONBOARDING V2 */

@media (prefers-reduced-motion: reduce) {
  .lite-setup *, .lite-setup *::before, .lite-setup *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
