/* TreeLaws Lead Wizard — Friendly Flow. All selectors are prefixed and the
   modal lives in an overlay, so theme CSS bleed is minimal; box-sizing and
   typography are re-asserted inside the root. */

.tlw-root, .tlw-root * { box-sizing: border-box; margin: 0; padding: 0; }
.tlw-root {
  position: fixed; inset: 0; z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(0px, 3vw, 24px);
  font-family: "Public Sans", system-ui, -apple-system, sans-serif;
  color: #1d2b36;
  -webkit-font-smoothing: antialiased;
}
.tlw-root[hidden] { display: none !important; }
.tlw-root { overscroll-behavior: none; }
.tlw-overlay { position: absolute; inset: 0; background: rgba(31, 61, 48, .45); }

/* Defensive resets: theme stylesheets routinely restyle bare `button`,
   `svg`, and `input` elements. Everything the wizard needs is re-asserted
   here at higher specificity so no theme can blank the icons or buttons. */
.tlw-root button { -webkit-appearance: none; appearance: none; text-transform: none; letter-spacing: normal; line-height: 1.35; }
.tlw-root svg { display: block !important; visibility: visible !important; opacity: 1 !important; max-width: none !important; max-height: none !important; }
.tlw-root svg path { fill: none !important; stroke: inherit !important; stroke-width: inherit !important; display: inline !important; visibility: visible !important; }
.tlw-root .tlw-iconbtn svg { width: 15px !important; height: 15px !important; fill: none !important; stroke: currentColor !important; opacity: 1 !important; visibility: visible !important; }
.tlw-root .tlw-back svg { width: 17px !important; height: 17px !important; }
.tlw-root .tlw-pick-chev { width: 16px !important; height: 16px !important; fill: none !important; }
.tlw-root .tlw-urgent svg, .tlw-root .tlw-done-badge svg { fill: none !important; stroke: currentColor !important; }

@keyframes tlwPop { from { opacity: 0; transform: scale(.97) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tlwIn  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tlw-modal, .tlw-screen { animation: none !important; }
}

.tlw-modal {
  position: relative; width: 100%; max-width: 430px;
  max-height: calc(100vh - clamp(0px, 6vw, 48px));
  max-height: calc(100dvh - clamp(0px, 6vw, 48px));
  display: flex; flex-direction: column;
  background: #fdfefd; border-radius: clamp(14px, 2.4vw, 20px);
  box-shadow: 0 24px 60px -20px rgba(24, 48, 37, .5);
  overflow: hidden;
  animation: tlwPop .36s cubic-bezier(.2, .8, .3, 1) both;
}
@media (max-width: 480px) {
  .tlw-root { padding: 0; align-items: flex-end; }
  .tlw-modal { max-width: none; max-height: 96dvh; border-radius: 18px 18px 0 0; }
}

.tlw-top { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 0; }
.tlw-iconbtn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; border: none; background: #eef4ef; color: #7c9187; cursor: pointer;
}
.tlw-iconbtn:hover { background: #e0ebe3; color: #1d2b36; }
.tlw-back { color: #2f7d55; }
.tlw-back[hidden] { display: none; }
.tlw-top-spacer { width: 38px; height: 38px; }
.tlw-top-spacer[hidden] { display: none; }
.tlw-steplabel { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: #7c9187; }

.tlw-progress { flex: 0 0 auto; margin: 12px 22px 0; height: 4px; border-radius: 999px; background: #e2ece5; overflow: hidden; }
.tlw-progress-fill { width: 0; height: 100%; border-radius: 999px; background: #2f7d55; transition: width .36s cubic-bezier(.2, .8, .3, 1); }

.tlw-body { flex: 1 1 auto; overflow-y: auto; padding: 22px 22px 26px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.tlw-screen { animation: tlwIn .32s cubic-bezier(.2, .8, .3, 1) both; }

.tlw-h1 {
  margin: 0 0 8px; text-align: center;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(24px, 6.2vw, 28px); line-height: 1.18; font-weight: 600;
  letter-spacing: -.015em; color: #1f3d30; text-wrap: pretty;
}
.tlw-h2 {
  margin: 0 0 6px; text-align: center;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(22px, 5.6vw, 26px); line-height: 1.2; font-weight: 600;
  letter-spacing: -.014em; color: #1f3d30; text-wrap: pretty;
}
.tlw-sub { margin: 0 0 20px; text-align: center; font-size: 13px; line-height: 1.5; color: #7c9187; }

.tlw-sub-hook { margin-bottom: 8px; font-size: 14.5px; font-weight: 600; color: #1f3d30; }
.tlw-proof { margin: 0 0 18px; text-align: center; font-size: 12px; line-height: 1.5; color: #7c9187; }

.tlw-picks { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.tlw-pick-badge {
  position: absolute; top: -9px; left: 14px; z-index: 1;
  padding: 3px 9px; border-radius: 999px;
  background: #2f7d55; color: #ffffff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.tlw-pick {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px; text-align: left; padding: 14px 16px;
  border-radius: 14px; border: 1.5px solid #dfeae2; background: #ffffff;
  font-family: inherit; cursor: pointer;
}
.tlw-pick:hover, .tlw-pick:focus-visible { border-color: #2f7d55; background: #f6faf7; }
.tlw-pick-emoji { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: #eef4ef; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.tlw-pick-label { flex: 1 1 auto; font-size: 15px; font-weight: 600; line-height: 1.35; color: #1d2b36; text-wrap: pretty; }
.tlw-pick-chev { flex: 0 0 auto; }

.tlw-questions { display: flex; flex-direction: column; gap: 24px; }
.tlw-qlabel { margin: 0 0 10px; font-size: 15px; font-weight: 600; line-height: 1.4; color: #1d2b36; text-wrap: pretty; }
.tlw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tlw-chip {
  position: relative; min-height: 46px; padding: 12px 17px;
  border-radius: 999px; border: 1.5px solid #dfeae2; background: #ffffff;
  font-family: inherit; cursor: pointer;
}
.tlw-chip:hover, .tlw-chip:focus-visible { border-color: #2f7d55; }
.tlw-chip-ring {
  position: absolute; inset: 0; border-radius: 999px;
  border: 1.5px solid #2f7d55; background: #e2f0e7;
  opacity: 0; transition: opacity .16s ease; pointer-events: none;
}
.tlw-chip[aria-pressed="true"] .tlw-chip-ring { opacity: 1; }
.tlw-chip-label { position: relative; z-index: 1; font-size: 14px; font-weight: 500; color: #1d2b36; white-space: nowrap; }

.tlw-urgent {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin: 0 0 18px; padding: 16px; border-radius: 13px;
  background: #1f3d30; color: #ffffff !important;
  font-size: 15.5px; font-weight: 700; text-decoration: none !important;
}
.tlw-urgent[hidden] { display: none; }

.tlw-fields { display: flex; flex-direction: column; gap: 11px; }
.tlw-row2 { display: flex; gap: 11px; }
.tlw-input, .tlw-textarea {
  width: 100%; min-width: 0; padding: 15px 14px; font-size: 16px;
  font-family: inherit; color: #1d2b36; background: #ffffff;
  border: 1.5px solid #dfeae2; border-radius: 12px; outline: none;
}
.tlw-input::placeholder, .tlw-textarea::placeholder { color: #9db0a5; }
.tlw-input:focus, .tlw-textarea:focus { border-color: #2f7d55; box-shadow: 0 0 0 3px rgba(47, 125, 85, .14); }
.tlw-input-zip { flex: 0 0 108px; }
.tlw-input-name { flex: 1 1 auto; }
.tlw-textarea { padding: 14px; font-size: 15px; line-height: 1.5; resize: vertical; min-height: 62px; }

.tlw-consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; cursor: pointer; }
.tlw-consent input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: #2f7d55; cursor: pointer; }
.tlw-consent span { font-size: 12.5px; line-height: 1.55; color: #1d2b36; text-wrap: pretty; }

.tlw-err { margin: 12px 0 0; font-size: 13px; color: #b4462f; }
.tlw-err[hidden] { display: none; }

.tlw-primary {
  margin-top: 16px; width: 100%; min-height: 56px; padding: 16px 20px;
  border-radius: 13px; border: none; background: #2f7d55; color: #ffffff;
  font-family: inherit; font-size: 16.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 22px -12px rgba(47, 125, 85, .8);
}
.tlw-primary:hover { background: #276847; }
.tlw-primary:disabled { opacity: .6; cursor: default; }

.tlw-footer-cta { flex: 0 0 auto; padding: 0 22px calc(18px + env(safe-area-inset-bottom)); }
.tlw-footer-cta[hidden] { display: none; }
.tlw-footer-cta .tlw-primary { margin-top: 0; min-height: 54px; font-size: 16px; }

.tlw-fineprint { margin: 14px 0 0; text-align: center; font-size: 11.5px; line-height: 1.55; color: #7c9187; text-wrap: pretty; }
.tlw-fineprint a { color: #2f7d55; text-decoration: underline; text-underline-offset: 2px; }
.tlw-fineprint a:hover { color: #16324c; }

.tlw-done { text-align: center; }
.tlw-done-badge { width: 64px; height: 64px; margin: 14px auto 20px; border-radius: 999px; background: #e2f0e7; display: flex; align-items: center; justify-content: center; color: #2f7d55; }
.tlw-done-sub { margin: 0 auto 24px; max-width: 320px; font-size: 14.5px; line-height: 1.55; color: #5b6f7e; text-wrap: pretty; }
.tlw-done .tlw-h2 { max-width: 320px; margin-left: auto; margin-right: auto; margin-bottom: 10px; font-size: clamp(23px, 5.8vw, 27px); }
.tlw-nextcard { padding: 16px; border-radius: 14px; background: #eef4ef; text-align: left; display: flex; align-items: center; gap: 13px; }
.tlw-nextcard-emoji { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; background: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.tlw-nextcard-title { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: #1d2b36; }
.tlw-nextcard-body { margin: 0; font-size: 12.5px; line-height: 1.5; color: #5b6f7e; text-wrap: pretty; }
.tlw-ghost {
  margin-top: 20px; width: 100%; min-height: 52px; padding: 14px 20px;
  border-radius: 13px; border: 1.5px solid #dfeae2; background: transparent;
  color: #1f3d30; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.tlw-ghost:hover { background: #f6faf7; }

.tlw-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Optional CTA button styling for the shortcode. */
.tlw-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px; border-radius: 12px; border: none;
  background: #2f7d55; color: #ffffff; font-size: 16px; font-weight: 700;
  cursor: pointer; box-shadow: 0 10px 22px -12px rgba(47, 125, 85, .8);
}
.tlw-cta:hover { background: #276847; color: #ffffff; }

/* Scroll lock while the modal is open. overscroll-behavior:none is critical:
   without it, a trackpad swipe on the locked page fires the browser's
   back/forward navigation gesture and "closes" the site mid-wizard. */
html.tlw-lock, body.tlw-lock {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
