/* ============================================================================
   HST Rebate Pros — site styles
   ----------------------------------------------------------------------------
   Hand-written, no framework, no build step. Edit this file directly.

   HOW THIS FILE IS ORGANISED
     1. Design tokens (:root variables) ...... colours, spacing, fonts — EDIT HERE FIRST
     2. Base / reset
     3. Layout helpers (.container, .section)
     4. Buttons
     5. Header / navigation
     6. Footer
     7. Hero
     8. Generic sections (cards, trust bar, video, process, CTA)
     9. Rebate finder (interactive picker on services.html)
    10. Testimonials (Google-style review cards)
    11. Contact page
    12. Floating chat bubble + popup modal
    13. Responsive tweaks

   BRAND COLOURS: Canada flag red (#D52B1E) + white, charcoal text.
   To re-skin the whole site, change the variables in section 1.
   ========================================================================== */


/* === 1. DESIGN TOKENS ===================================================== */
:root {
  /* Brand */
  --red:        #D52B1E;   /* Canada flag red — primary accent */
  --red-dark:   #b3241a;   /* darker red for button hover */
  --red-soft:   #fdeceb;   /* very light red wash for backgrounds/badges */

  /* Neutrals */
  --ink:        #1a1f24;   /* main text (charcoal, not pure black) */
  --muted:      #5b6470;   /* secondary text */
  --line:       #e6e8ec;   /* hairline borders */
  --white:      #ffffff;
  --bg:         #ffffff;    /* page background */
  --bg-soft:    #f6f7f9;    /* light-grey section background */

  /* Shape & depth */
  --radius:     16px;
  --radius-lg:  24px;
  --radius-pill: 999px;
  --shadow:     0 8px 30px rgba(26,31,36,.08);
  --shadow-lg:  0 24px 60px rgba(26,31,36,.16);

  /* Layout */
  --maxw:       1140px;
  --gap:        24px;

  /* Type */
  --font-body:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head:  "Poppins", var(--font-body);
}


/* === 2. BASE / RESET ====================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0; font-weight: 700; }
p  { margin: 0 0 1rem; }
a  { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; }


/* === 3. LAYOUT HELPERS ==================================================== */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); }

/* Section heading block (kicker + title + lead) */
.section-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.kicker {
  display: inline-block; text-transform: uppercase; letter-spacing: .14em;
  font-size: .78rem; font-weight: 700; color: var(--red); margin-bottom: .6rem;
}
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); }
.section-head p  { color: var(--muted); font-size: 1.08rem; margin-top: .6rem; }


/* === 4. BUTTONS =========================================================== */
/* Rounded-pill buttons, subtle lift on hover (no harsh shadows). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  padding: .85rem 1.7rem; border-radius: var(--radius-pill);
  border: 2px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; transform: scale(1.04); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--red); border-color: var(--red); }
.btn-outline:hover { background: var(--red); color: #fff; }
.btn-light { background: #fff; color: var(--red); }
.btn-lg { padding: 1.05rem 2.2rem; font-size: 1.1rem; }


/* === 5. HEADER / NAVIGATION =============================================== */
/* NOTE: the header markup is DUPLICATED in every .html page. If you change
   the nav links or logo, update all 5 pages (index/about/services/
   testimonials/contact). */
.site-header {
  position: sticky; top: 0; z-index: 50; background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 78px;
}
.brand img { height: 46px; width: auto; }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  color: var(--ink); font-family: var(--font-head); font-weight: 600;
  font-size: .96rem; padding: .55rem .9rem; border-radius: 10px;
  transition: background .15s ease, color .15s ease;
}
.nav a:hover { background: var(--bg-soft); color: var(--red); text-decoration: none; }
.nav a.is-active { color: var(--red); }
.header-cta { display: flex; align-items: center; gap: .6rem; }

/* Hamburger (mobile) — hidden on desktop */
.nav-toggle {
  display: none; width: 44px; height: 44px; border: none; background: var(--bg-soft);
  border-radius: 10px; cursor: pointer; color: var(--ink);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }


/* === 6. FOOTER ============================================================ */
/* Footer markup is also DUPLICATED per page — keep all 5 in sync.
   The footer is intentionally LIGHT so the red+charcoal logo reads cleanly
   (a dark footer would hide the charcoal "Rebate Pros" wordmark). */
.site-footer { background: var(--bg-soft); color: var(--muted); border-top: 1px solid var(--line); }
.site-footer .container {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 56px 22px 40px;
}
.site-footer h4 { color: var(--ink); font-size: 1.05rem; margin-bottom: 1rem; }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--red); }
.site-footer .foot-logo { height: 50px; margin-bottom: 1rem; }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.foot-contact p { margin: .3rem 0; }
.site-footer .foot-bottom {
  border-top: 1px solid var(--line); padding: 20px 22px;
  font-size: .85rem; color: var(--muted); text-align: center;
}


/* === 7. HERO ============================================================== */
.hero {
  position: relative; overflow: hidden;
  padding: 84px 0 76px;
  /* Full-section background photo (modern home, assets/img/hero-house.jpg).
     Swap that file to change the image. Positioned center-right so the house +
     red maple stay visible around the video; --bg-soft is the fallback colour. */
  background: var(--bg-soft) url("../img/hero-house.jpg") center right / cover no-repeat;
  /* Opacity of the white "veil" behind the headline. Turn DOWN to reveal more
     of the photo, UP if the dark text ever gets hard to read. */
  --hero-veil: .9;
}
/* White veil: strong on the LEFT (behind the headline) and fading to clear before
   the video on the right, so the charcoal text + red $ amount stay readable on the
   photo without changing the text colour. Sits above the photo, below the content. */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, var(--hero-veil)) 0%,
    rgba(255, 255, 255, var(--hero-veil)) 42%,
    rgba(255, 255, 255, .6)              54%,
    rgba(255, 255, 255, 0)               66%
  );
}
/* Cap the zoom on very wide screens. At/below ~1080p the photo fills via `cover`;
   beyond 1920px it STOPS scaling — it stays at its 1080p size, pinned to the right
   edge — so it never keeps magnifying on ultrawide (e.g. 21:9) monitors. The left
   overflow is hidden under the white veil, so no seam shows behind the text. */
@media (min-width: 1921px) {
  .hero { background-size: 1920px auto; background-position: right center; }
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; background: var(--red-soft);
  color: var(--red-dark); font-weight: 700; font-size: .85rem;
  padding: .45rem .9rem; border-radius: var(--radius-pill); margin-bottom: 1.2rem;
}
.hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -.01em; }
.hero h1 .amount { color: var(--red); }
.hero p.lead { font-size: 1.18rem; color: var(--muted); margin: 1.1rem 0 1.8rem; max-width: 540px; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }

/* Hero side visual — placeholder card (swap for real image later) */
.hero-visual {
  border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden; aspect-ratio: 4 / 3;
  display: grid; place-items: center; color: var(--muted);
}


/* === 8. GENERIC SECTIONS ================================================== */

/* Trust bar — small reassurance row of stats */
.trust-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); text-align: center; }
.trust-bar .stat .num { font-family: var(--font-head); font-weight: 800; font-size: 2.2rem; color: var(--red); }
.trust-bar .stat .label { color: var(--muted); font-weight: 500; }

/* Card grid (process steps, feature cards) */
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d7dbe0; }
.card .icon {
  width: 54px; height: 54px; border-radius: 14px; background: var(--red-soft); color: var(--red);
  display: grid; place-items: center; margin-bottom: 1rem;
}
.card .icon svg { width: 28px; height: 28px; }
.card h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.card p { color: var(--muted); margin: 0; }

/* Numbered process step */
.step .num-badge {
  width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff;
  font-family: var(--font-head); font-weight: 700; display: grid; place-items: center; margin-bottom: 1rem;
}

/* Video section (Vimeo embed kept responsive 16:9) */
.video-wrap {
  position: relative; max-width: 880px; margin: 0 auto; aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  background: #000;
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Big call-to-action band */
.cta-band { background: var(--red); color: #fff; text-align: center; }
.cta-band h2 { font-size: clamp(26px, 3.4vw, 40px); color: #fff; }
.cta-band p { color: #ffe3e0; font-size: 1.12rem; max-width: 620px; margin: .8rem auto 1.8rem; }


/* === 9. REBATE FINDER (services.html interactive picker) ================== */
/* Behaviour lives in assets/js/main.js (rebateFinder section). */
.finder { max-width: 860px; margin: 0 auto; }
.finder-question { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; text-align: center; margin-bottom: 1.6rem; }

.finder-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.finder-option {
  text-align: center; background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 26px 16px; cursor: pointer; font-family: var(--font-head); font-weight: 600; color: var(--ink);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.finder-option:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: var(--shadow); }
.finder-option .emoji { display: block; margin-bottom: .6rem; color: var(--red); }
.finder-option .emoji svg { width: 42px; height: 42px; display: inline-block; }
.finder-option small { display: block; font-weight: 400; color: var(--muted); margin-top: .35rem; font-family: var(--font-body); }

/* Result card revealed after a choice */
.finder-result {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red);
  border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow);
}
.finder-result .amount {
  font-family: var(--font-head); font-weight: 800; font-size: clamp(34px, 6vw, 52px); color: var(--red); line-height: 1;
}
.finder-result .amount small { font-size: 1rem; color: var(--muted); font-weight: 500; display: block; margin-top: .3rem; }
.finder-result h3 { font-size: 1.5rem; margin: .2rem 0 1rem; }
.finder-result ul { list-style: none; display: flex; flex-direction: column; gap: .6rem; margin: 0 0 1.6rem; }
.finder-result li { display: flex; gap: .6rem; color: var(--ink); }
.finder-result li::before { content: "✓"; color: var(--red); font-weight: 800; }
.finder-result .note { font-size: .9rem; color: var(--muted); background: var(--bg-soft); padding: .8rem 1rem; border-radius: 12px; }
.finder-back {
  background: none; border: none; color: var(--muted); cursor: pointer; font-weight: 600;
  font-family: var(--font-head); margin-bottom: 1.2rem; padding: 0;
}
.finder-back:hover { color: var(--red); }

/* Follow-up (primary vs rental) chips */
.finder-followup { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.finder-chip {
  background: var(--bg-soft); border: 2px solid var(--line); border-radius: var(--radius-pill);
  padding: .6rem 1.4rem; cursor: pointer; font-family: var(--font-head); font-weight: 600; color: var(--ink);
  transition: .2s;
}
.finder-chip:hover { border-color: var(--red); color: var(--red); }

[hidden] { display: none !important; }


/* === 10. TESTIMONIALS (Google-style review cards) ======================== */
.reviews-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.review-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.review-head { display: flex; align-items: center; gap: 12px; margin-bottom: .9rem; }
/* Coloured initial avatar (no real Google photos available) */
.review-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.1rem;
}
.review-name { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }
.review-source { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.review-source svg { width: 14px; height: 14px; }
.review-stars { color: #fbbc04; letter-spacing: 2px; margin-bottom: .6rem; }   /* Google gold */
.review-text { color: var(--ink); margin: 0; }


/* === 11. CONTACT PAGE ===================================================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.contact-info .info-row { display: flex; align-items: center; gap: 14px; margin-bottom: 1.4rem; }
.contact-info .info-row .icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--red-soft); color: var(--red);
  display: grid; place-items: center; flex: none;
}
.contact-info .info-row .icon svg { width: 22px; height: 22px; }
.contact-info .info-row strong { display: block; font-family: var(--font-head); }
.contact-info .info-row span { color: var(--muted); }

.contact-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-family: var(--font-head); font-weight: 600; font-size: .92rem; margin-bottom: .4rem; }
.field input, .field textarea {
  width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px;
  font-family: var(--font-body); font-size: 1rem; background: var(--bg-soft); color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); background: #fff; }
.field textarea { min-height: 120px; resize: vertical; }


/* === 12. FLOATING CHAT BUBBLE + POPUP MODAL ============================== */
/* The bubble + modal markup is included near the end of every page.
   Behaviour (open/close, lazy-load iframe) is in assets/js/main.js. */

/* Floating launcher button (uses assets/img/chat-icon.png) */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  width: 66px; height: 66px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: #fff; box-shadow: var(--shadow-lg);
  transition: transform .2s ease, opacity .25s ease, visibility .25s ease;
}
.chat-fab img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; display: block; }
.chat-fab:hover { transform: translateY(-3px) scale(1.06); }
/* Soft pulse ring to draw the eye */
.chat-fab::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 3px solid var(--red); opacity: 0; animation: fabPulse 2.8s ease-out infinite; pointer-events: none;
}
@keyframes fabPulse { 0% { transform: scale(1); opacity: .5; } 70% { transform: scale(1.35); opacity: 0; } 100% { opacity: 0; } }
.chat-fab .fab-tip {
  position: absolute; right: 80px; top: 50%; transform: translateY(-50%);
  background: var(--ink); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: .82rem;
  padding: .5rem .8rem; border-radius: 10px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.chat-fab:hover .fab-tip { opacity: 1; }
.chat-fab.is-hidden { opacity: 0; visibility: hidden; transform: scale(.6); pointer-events: none; }

/* Dimmed backdrop + centered modal that holds the widget iframe */
.chat-modal {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(20, 24, 28, .55); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
}
.chat-modal.is-open { opacity: 1; visibility: visible; }
.chat-modal-panel {
  position: relative; width: min(1200px, 100%); height: min(760px, 92vh);
  display: flex; flex-direction: column;
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); transform: translateY(16px) scale(.98); transition: transform .3s ease;
}
.chat-modal.is-open .chat-modal-panel { transform: translateY(0) scale(1); }
.chat-modal-panel iframe { width: 100%; flex: 1 1 auto; border: 0; display: block; }

/* Thin host bar at the top of the panel — holds our close button so it never
   collides with the widget's own "New Chat" button in its top-right corner. */
.chat-bar {
  flex: none; height: 46px; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 10px; background: #fff; border-bottom: 1px solid var(--line);
}
.chat-close {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--bg-soft); color: var(--ink); cursor: pointer; font-size: 20px; line-height: 1;
  display: grid; place-items: center; transition: transform .2s ease, background .2s ease;
}
.chat-close:hover { transform: rotate(90deg); background: var(--line); }


/* === 13. RESPONSIVE ======================================================= */
@media (max-width: 900px) {
  .nav, .header-cta .btn { display: none; }
  .nav-toggle { display: inline-grid; }
  /* Mobile dropdown nav (toggled by .is-open via JS) */
  .nav.is-open {
    display: flex; position: absolute; top: 78px; left: 0; right: 0; flex-direction: column;
    background: #fff; border-bottom: 1px solid var(--line); padding: 14px 22px; gap: .2rem; box-shadow: var(--shadow);
  }
  .hero .container, .contact-grid { grid-template-columns: 1fr; }
  /* Stacked hero (text above video): veil runs top→bottom instead of left→right
     so the headline stays readable and the photo peeks through lower down. */
  .hero::before {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, .95) 0%,
      rgba(255, 255, 255, .88) 50%,
      rgba(255, 255, 255, .55) 100%
    );
  }
  .grid-3, .grid-2, .trust-bar, .reviews-grid { grid-template-columns: 1fr; }
  .finder-options { grid-template-columns: 1fr 1fr; }
  .site-footer .container { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 480px) {
  .section { padding: 52px 0; }
  .finder-options { grid-template-columns: 1fr; }
  .chat-modal { padding: 0; }
  .chat-modal-panel { height: 100vh; width: 100%; border-radius: 0; }
}
