/* ============================================================
   ACTION ROOFING — Homshi-style "Schedule a Consultation" widget
   Ported from Homshi's BookingWidget look (glassmorphic stepped
   action card, #2563eb). Scoped to the roofing page only; does
   NOT touch the shared design system.
   ============================================================ */

/* ── Hero split: text left, Homshi card right (roofing only) ── */
.hero--booking { min-height: clamp(560px, 78vh, 760px); }

.hero--booking .hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 440px);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
.hero--booking .hero__content { max-width: 36rem; }

/* trust chips under the hero CTA */
.hero-trust {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}
.hero-trust__item {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .82rem; font-weight: 600; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.hero-trust__item svg { width: 17px; height: 17px; flex: none; opacity: .95; }

.hero__aside { justify-self: end; width: 100%; max-width: 440px; }

@media (max-width: 920px) {
  .hero--booking .hero__inner { grid-template-columns: 1fr; }
  .hero__aside { justify-self: stretch; margin-top: 1.5rem; }
}

/* ============================================================
   The card
   ============================================================ */
.bw-card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226,232,240,0.7);
  border-radius: 18px;
  box-shadow:
    0 4px 6px -1px rgba(0,0,0,0.06),
    0 30px 60px -12px rgba(15,23,42,0.30);
  overflow: hidden;
  width: 100%;
  color: #0f172a;
  font-family: inherit;
}
.bw-card-flow { max-width: 440px; }

.bw-card__head {
  padding: 0.85rem 1.15rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}
.bw-card__head h2 {
  font-size: 0.98rem; font-weight: 800; letter-spacing: -0.01em; margin: 0;
  color: #fff; line-height: 1.2;
}
.bw-card__head p { font-size: 0.72rem; margin: 2px 0 0; color: rgba(255,255,255,0.82); font-weight: 500; }

.bw-body { padding: 0.8rem 1.15rem 0.9rem; }
.bw-divider { height: 1px; background: #e2e8f0; }

/* ── Step header ── */
.bw-step-header { display: flex; align-items: center; gap: 8px; margin-bottom: 0.5rem; }
.bw-step-title { font-size: 0.8rem; font-weight: 700; color: #0f172a; }
.bw-step-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: #2563eb; color: #fff;
  font-size: 0.62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.2s;
}
.bw-step-num.done { background: #059669; }
.bw-step-num.locked { background: #cbd5e1; }
.bw-locked-hint { font-size: 0.6rem; color: #94a3b8; margin-left: auto; font-style: italic; }

.bw-locked { opacity: 0.45; pointer-events: none; user-select: none; }
.bw-locked .bw-step-title { color: #94a3b8; }

/* ── Address ── */
.bw-field { position: relative; margin-bottom: 0.5rem; }
.bw-field svg.bw-pin {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: #94a3b8; pointer-events: none;
}
.bw-address-input {
  width: 100%;
  padding: 0.6rem 0.75rem 0.6rem 2rem;
  border: 1.5px solid #e2e8f0; border-radius: 12px;
  font-size: 0.85rem; font-weight: 500; color: #0f172a;
  background: #fff; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bw-address-input:focus {
  outline: none; border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.bw-address-input::placeholder { color: #94a3b8; font-weight: 400; }

.bw-confirmed-card {
  display: flex; align-items: center; gap: 8px;
  padding: 0.5rem 0.65rem;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px;
}
.bw-confirmed-card svg { width: 15px; height: 15px; color: #059669; flex: none; }
.bw-confirmed-card b { font-size: 0.78rem; font-weight: 700; color: #0f172a; }

/* ── Service pills ── */
.bw-categories { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.bw-pill {
  padding: 0.46rem 0.35rem; border-radius: 9px;
  border: 1px solid #e2e8f0; background: #fff;
  font-size: 0.72rem; font-weight: 500; color: #334155;
  cursor: pointer; transition: all 0.15s; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-family: inherit; line-height: 1.15;
}
.bw-pill:hover { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.bw-pill.selected {
  border-color: #2563eb; background: #2563eb; color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

/* ── Mode buttons ── */
.bw-modes { display: flex; flex-direction: column; gap: 8px; }
.bw-mode-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 0.6rem 0.75rem; border-radius: 10px;
  border: 1px solid #e2e8f0; background: #fff;
  cursor: pointer; transition: all 0.15s; text-align: left;
  color: #0f172a; font-family: inherit;
}
.bw-mode-btn:hover { border-color: #93c5fd; background: #f8fafc; }
.bw-mode-btn svg { width: 18px; height: 18px; color: #2563eb; flex: none; }
.bw-mode-btn > span:last-child { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.bw-mode-btn .bw-mode-t { display: block; font-weight: 700; font-size: 0.82rem; }
.bw-mode-btn .bw-mode-s { display: block; font-size: 0.66rem; color: #94a3b8; font-weight: 400; line-height: 1.3; }
.bw-mode-active { border-color: #2563eb !important; background: #eff6ff !important; box-shadow: 0 0 0 2px rgba(37,99,235,0.14); }
.bw-mode-active-red { border-color: #dc2626 !important; background: #fef2f2 !important; box-shadow: 0 0 0 2px rgba(220,38,38,0.14); }
.bw-mode-btn.is-red svg { color: #dc2626; }
.bw-mode-btn.is-red .bw-mode-t { color: #dc2626; }

.bw-mode-expand {
  padding: 0.6rem 0.7rem; margin-top: -2px;
  background: rgba(248,250,252,0.85);
  border: 1px solid #e2e8f0; border-radius: 10px;
  animation: bwReveal 0.25s ease-out;
}

/* ── Schedule controls ── */
.bw-date-input {
  width: 100%; padding: 0.55rem 0.7rem;
  border: 1px solid #e2e8f0; border-radius: 9px;
  font-size: 0.8rem; color: #0f172a; background: #fff;
  font-family: inherit; transition: border-color 0.15s;
}
.bw-date-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.bw-time-pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 0.5rem 0; }
.bw-time-pill {
  padding: 0.42rem 0.7rem; border-radius: 8px;
  border: 1.5px solid #e2e8f0; background: #fff;
  font-size: 0.72rem; font-weight: 500; color: #475569;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.bw-time-pill:hover { border-color: #93c5fd; }
.bw-time-pill.selected { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.bw-contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0.5rem 0; }

/* ── CTA ── */
.bw-cta {
  width: 100%; padding: 0.65rem; border-radius: 11px; border: none;
  font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit;
}
.bw-cta svg { width: 15px; height: 15px; }
.bw-cta-primary { background: #2563eb; color: #fff; box-shadow: 0 3px 10px rgba(37,99,235,0.28); }
.bw-cta-primary:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,0.38); }
.bw-cta-primary:disabled { background: #93c5fd; box-shadow: none; cursor: not-allowed; transform: none; }
.bw-cta-emergency { background: #dc2626; color: #fff; box-shadow: 0 3px 10px rgba(220,38,38,0.28); }
.bw-cta-emergency:hover { background: #b91c1c; transform: translateY(-1px); }

/* ── SMS consent, next to the phone field (what the carriers' reviewers read) ── */
.bw-legal { font-size: 0.68rem; line-height: 1.5; color: #64748b; margin: 0.4rem 0 0.6rem; text-align: left; }
.bw-legal a { color: #2563eb; text-decoration: underline; }
/* the texting box: its own checkbox, never ticked for them, texts only (A2P 10DLC) */
.bw-sms { display: flex; gap: .5rem; align-items: flex-start; font-size: 0.7rem; line-height: 1.45; color: #334155; margin: .5rem 0 .15rem; text-align: left; cursor: pointer; }
.bw-sms input { margin-top: .15rem; flex: none; width: 1rem; height: 1rem; }

/* ── Footer privacy ── */
.bw-foot { text-align: center; padding: 0.5rem 1.15rem 0.85rem; }
.bw-foot span { font-size: 0.62rem; color: #94a3b8; }

/* ── Success state ── */
.bw-success { padding: 2rem 1.5rem; text-align: center; animation: bwReveal 0.3s ease-out; }
.bw-success__icon {
  width: 56px; height: 56px; margin: 0 auto 0.85rem;
  display: flex; align-items: center; justify-content: center;
  background: #f0fdf4; border: 2px solid #bbf7d0; border-radius: 50%;
}
.bw-success__icon svg { width: 28px; height: 28px; color: #059669; }
.bw-success h3 { font-size: 1.05rem; font-weight: 800; color: #0f172a; margin: 0 0 0.35rem; }
.bw-success p { font-size: 0.8rem; color: #64748b; margin: 0; line-height: 1.5; }

@keyframes bwReveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bwSpin { to { transform: rotate(360deg); } }

/* Respect reduced motion (site-wide guard also applies) */
@media (prefers-reduced-motion: reduce) {
  .bw-mode-expand, .bw-success { animation: none; }
  .bw-cta-primary:hover, .bw-cta-emergency:hover { transform: none; }
}

/* hidden util */
.bw-hidden { display: none !important; }

/* sr-only aria-live region */
.bw-status {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Address autocomplete dropdown ── */
.bw-suggest {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15,23,42,0.16); max-height: 230px; overflow-y: auto;
}
.bw-suggest__item {
  display: flex; align-items: center; gap: 8px;
  padding: 0.5rem 0.7rem; cursor: pointer; border-bottom: 1px solid #f1f5f9;
}
.bw-suggest__item:last-child { border-bottom: none; }
.bw-suggest__item:hover, .bw-suggest__item.is-active { background: #f0f9ff; }
.bw-suggest__item svg { width: 14px; height: 14px; color: #2563eb; flex: none; }
.bw-suggest__addr { font-size: 0.78rem; font-weight: 600; color: #0f172a; }
.bw-suggest__meta { font-size: 0.66rem; color: #94a3b8; }

/* ── Confirmed property meta ── */
.bw-confirmed-card > div { display: flex; flex-direction: column; min-width: 0; }
.bw-confirmed__meta { font-size: 0.66rem; color: #64748b; margin-top: 1px; }
.bw-change { margin-left: auto; align-self: center; background: none; border: none; color: #2563eb; font-size: 0.68rem; font-weight: 700; cursor: pointer; padding: 0 0 0 6px; font-family: inherit; flex: none; }
.bw-change:hover { text-decoration: underline; }
.bw-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── Validation ── */
.bw-invalid { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,0.10) !important; }

/* ── Loading spinner ── */
.bw-spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff; border-radius: 50%; animation: bwSpin 0.8s linear infinite; vertical-align: -2px;
}

/* ── Error state ── */
.bw-error { padding: 2rem 1.5rem; text-align: center; animation: bwReveal 0.3s ease-out; }
.bw-error__icon {
  width: 56px; height: 56px; margin: 0 auto 0.85rem; display: flex; align-items: center; justify-content: center;
  background: #fef2f2; border: 2px solid #fecaca; border-radius: 50%; color: #dc2626; font-size: 1.6rem; font-weight: 800;
}
.bw-error h3 { font-size: 1.05rem; font-weight: 800; color: #0f172a; margin: 0 0 0.35rem; }
.bw-error p { font-size: 0.82rem; color: #64748b; margin: 0 0 1rem; line-height: 1.5; }
.bw-error a { color: #2563eb; font-weight: 700; }
.bw-error .bw-cta { max-width: 210px; margin: 0 auto; }

@media (prefers-reduced-motion: reduce) { .bw-spinner { animation-duration: 1.4s; } .bw-error { animation: none; } }
