/* Booking page — customer-facing, full-screen, no CRM chrome (DESIGN_SPEC:
   "public pages use the booking-page look, NEVER the CRM chrome"). Every
   color comes from design-tokens.css; nothing hardcoded here. */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.bp-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.bp-logo { display: block; }
.bp-brand { font-weight: 700; font-size: 17px; color: var(--navy); }

.bp-main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.bp-title { font-size: 28px; margin: 0 0 6px; color: var(--ink); }
.bp-sub { color: var(--ink2); margin: 0 0 20px; line-height: 1.5; }

.bp-banner {
  border-radius: var(--r-ctl);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}
.bp-banner-error { background: var(--bad-soft); color: var(--bad-ink); }

.bp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.bp-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  margin: 0 0 14px;
  color: var(--ink);
}
.bp-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}
:root[data-theme="dark"] .bp-step-num { color: var(--bg); }

.bp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.bp-chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink2);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
}
.bp-chip:hover { border-color: var(--accent); color: var(--accent); }

textarea, input[type="text"], input[type="tel"], input[type="email"] {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--r-ctl);
  padding: 12px;
  font-size: 15px;
  font-family: var(--font);
  min-height: 44px;
}
textarea { resize: vertical; }
textarea:focus, input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.bp-field { margin-bottom: 14px; }
.bp-field label { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 6px; }
.bp-optional { color: var(--ink3); font-weight: 400; }

/* Address autocomplete (public/address-autocomplete.js). Only the Google
   widget's OUTER box is stylable — its internal input/dropdown live in a
   closed Shadow DOM, Google's own styling, not ours to touch. The Photon
   fallback's dropdown is a plain element we fully control. */
.bp-address-google {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  min-height: 44px;
}
.bp-address-photon-dropdown {
  position: relative;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface-2);
  overflow: hidden;
}
.bp-address-photon-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.bp-address-photon-item:last-child { border-bottom: none; }
.bp-address-photon-item:hover { background: var(--surface-3, var(--surface-2)); }

.bp-field-error {
  color: var(--bad-ink);
  background: var(--bad-soft);
  border-radius: var(--r-ctl);
  padding: 10px 12px;
  font-size: 13px;
  margin: 8px 0 0;
}

/* honeypot — invisible and unreachable to real users/assistive tech */
.bp-hp {
  position: absolute;
  left: -5000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.bp-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.bp-cal-month { font-weight: 600; }
.bp-btn-ghost {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--r-ctl);
  min-width: 44px;
  min-height: 44px;
  font-size: 16px;
  cursor: pointer;
}
.bp-btn-ghost:hover { border-color: var(--accent); }
.bp-btn-ghost:disabled { opacity: .4; cursor: default; }

.bp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.bp-cal-dow {
  text-align: center;
  font-size: 11px;
  color: var(--ink3);
  text-transform: uppercase;
  padding-bottom: 4px;
}
.bp-cal-day {
  aspect-ratio: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-ctl);
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--ink);
}
.bp-cal-day:hover:not(:disabled) { border-color: var(--accent); }
.bp-cal-day:disabled {
  background: var(--gray-soft);
  color: var(--ink3);
  cursor: default;
}
.bp-cal-day.bp-empty { visibility: hidden; cursor: default; }
.bp-cal-day.bp-green { background: var(--good-soft); color: var(--good-ink); }
.bp-cal-day.bp-yellow { background: var(--warn-soft); color: var(--warn-ink); }
.bp-cal-day.bp-red { background: var(--bad-soft); color: var(--bad-ink); }
.bp-cal-day.bp-selected {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
  font-weight: 700;
}
:root[data-theme="dark"] .bp-cal-day.bp-selected { outline-color: var(--blue); }

.bp-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink2);
}
.bp-cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bp-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.bp-dot-green { background: var(--good); }
.bp-dot-yellow { background: var(--warn); }
.bp-dot-red { background: var(--bad); }
.bp-dot-gray { background: var(--ink3); }

.bp-hint { color: var(--ink2); font-size: 13px; margin: 0 0 12px; }

.bp-windows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.bp-window-btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: var(--r-ctl);
  padding: 12px 10px;
  min-height: 44px;
  font-size: 14px;
  cursor: pointer;
}
.bp-window-btn:hover:not(:disabled) { border-color: var(--accent); }
.bp-window-btn:disabled {
  background: var(--gray-soft);
  color: var(--ink3);
  text-decoration: line-through;
  cursor: default;
}
.bp-window-btn.bp-selected {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 700;
}
:root[data-theme="dark"] .bp-window-btn.bp-selected { color: var(--bg); }

.bp-submit {
  width: 100%;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  min-height: 48px;
  cursor: pointer;
  margin-top: 6px;
}
.bp-submit:hover { filter: brightness(.93); }
.bp-submit:disabled { opacity: .6; cursor: default; }

.bp-fineprint { color: var(--ink3); font-size: 12px; margin: 10px 0 0; line-height: 1.5; }

.bp-confirm { text-align: center; padding: 32px 20px; }
.bp-confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--good-soft);
  color: var(--good-ink);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.bp-confirm h2 { margin: 0 0 8px; }
.bp-confirm p { margin: 4px 0; color: var(--ink2); }

.bp-footer {
  text-align: center;
  padding: 20px;
  color: var(--ink2);
  font-size: 13px;
}
.bp-footer a { color: var(--accent); }

/* Version display (public/version-display.js) — small, muted, non-clickable
   build metadata. Empty until version.json loads (or stays empty on any
   failure) so it never reserves visible space with a broken element. */
.bp-version {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink3);
}

@media (min-width: 640px) {
  .bp-main { padding-top: 40px; }
  .bp-title { font-size: 32px; }
}

/* manage.html (P2) — small layout helpers shared with the reuse of
   .bp-card/.bp-submit/.bp-btn-ghost/.bp-windows/.bp-cal-* from above */
.bp-mg-heading { margin: 0 0 10px; }
.bp-mg-window-label { margin-top: 14px; }
.bp-mg-primary-spaced { margin-top: 14px; }
.bp-mg-secondary-spaced { margin-top: 8px; }
.bp-full-btn { width: 100%; min-height: 44px; }

.bp-danger.bp-submit { background: var(--bad); }
.bp-danger.bp-submit:hover { filter: brightness(.93); }
.bp-danger.bp-btn-ghost { color: var(--bad-ink); border-color: var(--bad); }

/* .bp-btn-ghost applied to an <a> (the manage-booking link) needs its own
   display/decoration — the base rule assumes a <button>. */
.bp-mg-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-top: 18px;
}

/* portal.html / portal-login.html (P3) — small layout helpers shared with
   the reuse of .bp-card/.bp-submit/.bp-btn-ghost/.bp-field/.bp-hint above. */
.bp-portal-signout {
  margin-left: auto;
  width: auto;
  min-width: 0;
  padding: 0 14px;
  font-size: 13px;
}
.bp-portal-balance { font-size: 22px; font-weight: 700; margin: 0; }
.bp-portal-balance-due { color: var(--bad-ink); }
.bp-portal-balance-clear { color: var(--good-ink); }

.bp-portal-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.bp-portal-row:last-child { border-bottom: none; }
.bp-portal-row p { margin: 2px 0; }
.bp-portal-row-title { font-weight: 600; color: var(--ink); }

/* Package 2 (interactions): estimates, appointment requests, uploads. */
.bp-portal-subheading { margin-top: 20px; font-size: 15px; }
.bp-estimate-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.bp-estimate-card:last-child { border-bottom: none; }
.bp-estimate-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}
.bp-estimate-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  text-align: left;
  width: 100%;
}
.bp-estimate-option:hover { border-color: var(--brand, var(--ink)); }
.bp-estimate-actions { display: flex; gap: 10px; margin-top: 8px; }
.bp-estimate-actions .bp-btn-ghost { width: auto; min-width: 0; padding: 8px 16px; }
.bp-upload-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.bp-upload-row:last-child { border-bottom: none; }
.bp-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 16px 4px 0;
  font-size: 14px;
  color: var(--ink);
}
.bp-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; }

/* .bp-submit applied to an <a> (the multi-account "call the office" link,
   portal-login.html) needs its own display/decoration/centering — the base
   rule assumes a <button>, same reasoning as .bp-mg-link above. */
.bp-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* go.html (campaign landing pages) — small layout helpers shared with the
   reuse of .bp-card/.bp-submit/.bp-field/.bp-hp above. */
.bp-lp-hero {
  height: 180px;
  border-radius: var(--r-card);
  margin-bottom: 14px;
  /* Placeholder gradient until the owner supplies a real small brand photo
     library (SETTINGS_PERMISSIONS_KPI_SPEC.md §3b) — see docs/landing-pages.md
     known limitations. photoAlt is applied as aria-label so the placeholder
     is still meaningful to assistive tech. */
  background: linear-gradient(135deg, var(--navy), var(--blue));
}
.bp-lp-badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 10px;
}
.bp-lp-price { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0 0 18px; }
.bp-lp-book-link {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-bottom: 24px;
}
