/* Plenty of Bookings Template - generic, per-client styling.
   --accent/--bg/--text are injected per request by functions/_middleware.js
   via HTMLRewriter (see that file); the literals below are fallbacks only,
   used if a page is ever viewed without that middleware running. Everything
   else (--bg-raised, --text-muted, --border, --accent-dark, --accent-tint)
   is derived from those three with color-mix() so the whole page stays on
   brand for ANY accent/bg/text combination a client picks, not just this
   default blue/off-white/near-black one. */

:root {
  --accent: #2748e0;
  --bg: #faf8f3;
  --text: #19170f;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg-raised: #ffffff;
  --text-muted: color-mix(in srgb, var(--text) 62%, var(--bg) 38%);
  --border: color-mix(in srgb, var(--text) 12%, var(--bg) 88%);
  --accent-dark: color-mix(in srgb, var(--accent) 82%, black 18%);
  --accent-tint: color-mix(in srgb, var(--accent) 12%, white 88%);
  --danger: #b42318;

  --radius: 14px;
  --container: 1160px;
  --shadow: 0 18px 40px -22px rgba(25, 23, 15, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
.container-narrow { max-width: 760px; }

.section-head { max-width: 640px; margin: 0 0 40px; }
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(26px, 3.2vw, 38px); margin-bottom: 12px; }
.section-head p { color: var(--text-muted); font-size: 17px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  font-family: var(--font-text);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text); }
.btn-small { padding: 9px 18px; font-size: 14px; }
.link-arrow { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 15px; }
.link-arrow:hover { text-decoration: underline; }

/* Demo banner */
.demo-banner {
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  letter-spacing: 0.01em;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 20px; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex: none;
}
.wordmark img { height: 28px; width: auto; display: none; }
.wordmark img[src]:not([src=""]) { display: block; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--text); font-size: 15px; font-weight: 500; }
.nav-links a:not(.btn):hover { color: var(--accent); }
.nav-links .mobile-cta, .nav-links .mobile-only { display: none; }
.nav-cta { display: flex; align-items: center; gap: 18px; }
.nav-phone { font-weight: 600; font-size: 14.5px; text-decoration: none; color: var(--text); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; }

/* Hero */
.hero { padding: 64px 0 56px; }
.hero .container { max-width: 760px; }
.hero h1 { font-size: clamp(32px, 5vw, 50px); margin-bottom: 18px; }
.hero .lede { font-size: 18px; color: var(--text-muted); max-width: 56ch; margin-bottom: 30px; }
.hero-ctas { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.service-area-note { margin-top: 18px; color: var(--text-muted); font-size: 14.5px; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step .num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}
.step h3 { font-family: var(--font-text); font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 15.5px; }

/* Service cards */
.service-grid { display: grid; gap: 24px; }
.service-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  gap: 14px;
}
.service-card .service-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.service-card h3 { font-size: 21px; }
.service-card .price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--accent-dark);
  white-space: nowrap;
}
.service-card .price .unit { font-family: var(--font-text); font-size: 13px; font-weight: 500; color: var(--text-muted); }
.service-card .desc { color: var(--text-muted); }
.service-card .meta { color: var(--text-muted); font-size: 14px; }
.service-card .addons { color: var(--text-muted); font-size: 14px; }
.service-card .actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }

/* Forms (shared by quote/book/contact/portal) */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field .hint { display: block; font-weight: 400; color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-text);
  font-size: 15px;
  background: var(--bg-raised);
  color: var(--text);
}
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field textarea { resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 15px; }
.checkbox-row input { width: auto; }

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

.form-error { margin-top: 14px; color: var(--danger); font-size: 14.5px; }
.form-note { margin-top: 14px; color: var(--text-muted); font-size: 14px; }

.confirmation-box {
  border: 1px solid var(--border);
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}
.confirmation-box h3 { margin-bottom: 10px; }
.confirmation-box p { color: var(--text-muted); margin-bottom: 16px; }
.confirmation-box .btn { margin-top: 6px; }

/* Quote calculator */
.quote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.quote-breakdown {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: sticky;
  top: 96px;
}
.quote-breakdown h3 { font-size: 17px; margin-bottom: 16px; }
.quote-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 15px; color: var(--text-muted); }
.quote-row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; color: var(--text); font-weight: 700; font-size: 17px; }
.quote-row.deposit { color: var(--accent-dark); font-weight: 600; }
.quote-breakdown .btn { width: 100%; margin-top: 18px; }
.quote-empty { color: var(--text-muted); font-size: 14.5px; }

/* Booking scheduler */
.book-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.book-slots h3, .book-form-wrap h3 {
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.slot-days { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.slot-day-btn, .slot-time-btn {
  border: 1px solid var(--border);
  background: var(--bg-raised);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-text);
}
.slot-day-btn.is-active, .slot-time-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot-times { display: flex; flex-wrap: wrap; gap: 10px; }
.slot-tz-note { margin-top: 18px; color: var(--text-muted); font-size: 13.5px; }
.selected-time-banner {
  background: var(--accent-tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Portal */
.portal-login { max-width: 440px; }
.booking-list { display: grid; gap: 20px; }
.booking-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.booking-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.booking-card h3 { font-size: 19px; margin-bottom: 4px; }
.booking-card .when { color: var(--text-muted); font-size: 15px; }
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--accent-tint);
  color: var(--accent-dark);
}
.booking-card .price-lines { margin: 14px 0; color: var(--text-muted); font-size: 14.5px; }
.booking-card .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.inline-request-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* FAQ-style details (reused on legal pages if needed) */
.faq-item { border-top: 1px solid var(--border); padding: 20px 0; }
.faq-list .faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-item summary { cursor: pointer; list-style: none; font-weight: 600; font-size: 16px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { color: var(--text-muted); margin-top: 12px; }

/* Footer */
footer { padding: 56px 0 28px; }
footer .footer-main {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
footer .footer-brand { max-width: 360px; }
footer .footer-brand .wordmark { font-size: 19px; }
footer .footer-brand p { margin-top: 12px; color: var(--text-muted); font-size: 14.5px; }
footer .footer-links { display: flex; flex-wrap: wrap; gap: 10px 28px; }
footer .footer-links a { text-decoration: none; color: var(--text); font-size: 14.5px; }
footer .footer-links a:hover { color: var(--accent); }
footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  color: var(--text-muted);
  font-size: 13.5px;
}
footer .footer-bottom a { text-decoration: none; color: var(--text-muted); }
footer .footer-bottom a:hover { color: var(--text); }

/* Legal pages */
.legal { padding: 56px 0 100px; }
.legal .container { max-width: 760px; }
.legal h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 8px; }
.legal .updated { color: var(--text-muted); font-size: 14px; margin-bottom: 36px; display: block; }
.legal h2 { font-family: var(--font-text); font-size: 19px; margin: 32px 0 10px; }
.legal p { color: var(--text-muted); margin-bottom: 14px; white-space: pre-line; }
.legal .draft-note {
  background: var(--accent-tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 32px;
}

/* 404 */
.notfound { padding: 120px 0; text-align: center; }
.notfound h1 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 14px; }
.notfound p { color: var(--text-muted); margin-bottom: 24px; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Responsive */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-cta .btn-primary { display: none; }
  body.nav-open .nav-links {
    display: flex;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 18px;
  }
  body.nav-open .nav-links .mobile-cta { display: inline-flex; }
  body.nav-open .nav-links .mobile-only { display: inline; }

  section { padding: 56px 0; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .quote-grid { grid-template-columns: 1fr; gap: 32px; }
  .quote-breakdown { position: static; }
  .book-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 600px) {
  footer .footer-main { flex-direction: column; gap: 24px; }
  .service-card .service-top { flex-direction: column; align-items: flex-start; }
  /* The phone number plus "Book now" plus the menu toggle don't fit next to
     a long business name at phone widths - drop the phone link here, it's
     still in the footer and on /contact. */
  .nav-phone { display: none; }
  /* A long business name can still overflow next to the menu toggle alone -
     truncate it with an ellipsis instead of letting the page scroll
     horizontally. This has to work for any client's name, not just a short
     one. */
  .wordmark { font-size: 17px; }
  .wordmark span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
}
