@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;400;500;600;700&family=Manrope:wght@300;400;500;600;700&display=swap');

:root {
  /* Light Theme (Default) */
  --bg-background: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-muted: #f1f5f9;
  --text-foreground: #0f172a;
  --text-muted: #475569;
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.2);
  --primary-foreground: #ffffff;
  --secondary: #059669;
  --secondary-foreground: #ffffff;
  --border: #cbd5e1;
  --border-light: #94a3b8;
  --table-header-bg: #e2e8f0;
  --input-bg: #ffffff;
  --header-bg: rgba(248, 250, 252, 0.9);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Manrope', sans-serif;
}

[data-theme="dark"] {
  /* Dark Theme */
  --bg-background: #091319;
  --bg-card: #0d1e27;
  --bg-card-hover: #122834;
  --bg-muted: #11232e;
  --text-foreground: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #00d2ff;
  --primary-dark: #0099cc;
  --primary-glow: rgba(0, 210, 255, 0.25);
  --primary-foreground: #02202b;
  --secondary: #00e6a8;
  --secondary-foreground: #022b1f;
  --border: rgba(255, 255, 255, 0.12);
  --border-light: rgba(255, 255, 255, 0.2);
  --table-header-bg: rgba(0, 0, 0, 0.4);
  --input-bg: rgba(255, 255, 255, 0.05);
  --header-bg: rgba(9, 19, 25, 0.85);
  --shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-background);
  color: var(--text-foreground);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
.font-display {
  font-family: var(--font-display);
}

.label-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--primary);
}

/* Layout Utilities */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Nav */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: all 0.3s ease;
  padding: 1rem 0;
}

header.site-header.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

@media (max-width: 768px) {
  header.site-header {
    padding: 0.75rem 0;
  }
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-foreground);
}

.nav-logo {
  height: 42px;
  width: 42px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text-foreground);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 25px var(--primary-glow);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  box-shadow: 0 0 20px rgba(5, 150, 105, 0.2);
}

.btn-secondary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-foreground);
  border: 1px solid var(--border-light);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

/* Small Compact Circular Icon Theme Toggle */
.btn-theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-foreground);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-theme-toggle:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Cards & Bento Grid */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  transition: all 0.3s ease;
  color: var(--text-foreground);
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  color: var(--text-foreground);
}

.modal-backdrop.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-foreground);
}

/* Form inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 700;
}

.form-control {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  color: var(--text-foreground);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

select.form-control option {
  background: var(--bg-card);
  color: var(--text-foreground);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  color: var(--text-foreground);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-error {
  border-color: #ef4444;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* WhatsApp Floating CTA */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 40;
  background-color: #25D366;
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
  transition: transform 0.25s ease;
}

.whatsapp-float:hover {
  transform: scale(1.05);
}

/* Responsive navigation */
@media (max-width: 992px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block !important; }
  /* Hide Get a Quote in header — accessible via hero & mobile menu */
  .nav-quote-btn { display: none !important; }
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-foreground);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

/* Mobile Nav Overlay */
body.menu-open {
  overflow: hidden;
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
}

@media (max-width: 992px) {
  .mobile-nav-overlay {
    display: flex;
    pointer-events: none;
  }
  .mobile-nav-overlay.active {
    pointer-events: auto;
  }
}

.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 80vw);
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.3);
}

.mobile-nav-overlay.active .mobile-nav-panel {
  transform: translateX(0);
}

.mobile-nav-close {
  align-self: flex-end;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  margin-bottom: 0.6rem;
  transition: all 0.2s;
}

.mobile-nav-close:hover {
  border-color: var(--primary);
  color: var(--text-foreground);
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.mobile-nav-link {
  display: block;
  padding: 0.85rem 1rem;
  color: var(--text-foreground);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  border-radius: 0.75rem;
  transition: background 0.2s, color 0.2s;
}

.mobile-nav-link:hover {
  background: var(--bg-muted);
  color: var(--primary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.badge-commercial {
  background: rgba(2, 132, 199, 0.15);
  color: var(--primary);
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.badge-residential {
  background: rgba(5, 150, 105, 0.15);
  color: var(--secondary);
  border: 1px solid rgba(5, 150, 105, 0.3);
}

/* =============================================
   Hero Banner Carousel
   ============================================= */

.hero-carousel {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  width: 100%;
  line-height: 0; /* collapse inline spacing */
  background: var(--bg-muted); /* neutral bg if image has padding */
}

.hero-carousel-track {
  position: relative;
  width: 100%;
}

/* Slides stack; first active one drives the height via normal flow */
.hero-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.75s ease-in-out;
  pointer-events: none;
}

/* The active slide sits in normal flow to give the track its height */
.hero-carousel-slide.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.hero-carousel-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain; /* show full banner, no cropping */
}

/* Prev / Next Arrow Buttons */
.hero-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.75rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.hero-carousel-btn:hover {
  background: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
  transform: translateY(-50%) scale(1.1);
}

.hero-carousel-prev { left: 0.85rem; }
.hero-carousel-next { right: 0.85rem; }

/* Dot Indicators */
.hero-carousel-dots {
  position: absolute;
  bottom: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.25s, border-color 0.25s;
}

.hero-dot.active {
  background: #fff;
  border-color: #fff;
  transform: scale(1.3);
}

@media (max-width: 640px) {
  .hero-carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
  }
}

/* =============================================
   Hero Section Layout
   ============================================= */

.hero-section {
  padding-top: 10rem;
  padding-bottom: 6rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  align-items: center;
}

.hero-heading {
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-subtext {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 450px;
}

/* =============================================
   Full Mobile Responsive Overrides
   ============================================= */

/* ── Tablet (≤ 992px) ── */
@media (max-width: 992px) {

  /* Hero */
  .hero-section {
    padding-top: 7rem;
    padding-bottom: 4rem;
  }

  .hero-heading { font-size: 2.8rem; }

  /* Sections */
  section { padding: 4rem 0 !important; }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {

  /* Hero: single-column, banner FIRST */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero-banner {
    order: -1;                 /* carousel above text */
    margin: 5px -1rem 2rem;    /* 5px gap at top, bleed sides, gap below */
    border-radius: 0;
  }

  /* Override carousel radius to match parent on mobile */
  .hero-banner .hero-carousel {
    border-radius: 0;
    box-shadow: none;
  }

  .hero-text {
    order: 1;
    padding-top: 0.25rem;
  }

  .hero-section {
    padding-top: 4.5rem;  /* fixed header height ~3.5rem + 1rem air */
    padding-bottom: 3rem;
  }

  .hero-heading {
    font-size: 2rem;
    margin-bottom: 0.85rem;
  }

  .hero-subtext { font-size: 0.95rem; }

  .hero-stats { max-width: 100%; }

  /* Section headings */
  h2.font-display { font-size: 2rem !important; }
  h3.font-display { font-size: 1.4rem !important; }

  /* Grids collapse to single column */
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Cards */
  .card { padding: 1.5rem; }

  /* Section padding */
  section { padding: 3.5rem 0 !important; }

  /* Energy Audit card */
  .card[style*="padding: 3.5rem"] {
    padding: 1.75rem !important;
  }

  /* Buttons full width on mobile */
  .btn { width: 100%; justify-content: center; }

  /* Hero CTA buttons */
  .hero-text .btn {
    width: auto;
  }

  /* Footer grid */
  footer .container > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  /* Footer bottom row */
  footer div[style*="justify-content: space-between"] {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  /* WhatsApp button — compact on mobile */
  .whatsapp-float {
    bottom: 1rem;
    right: 1rem;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }

  /* Modals take full width */
  .modal-content {
    padding: 1.5rem;
    max-height: 95vh;
  }

  /* Stats on audit section */
  div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Header brand text */
  .nav-brand span { display: none; }
  .nav-brand .nav-logo + div span:first-child { display: block; }
}

/* ── Small mobile (≤ 480px) ── */
@media (max-width: 480px) {

  .hero-heading { font-size: 1.9rem; }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .hero-stats .font-display { font-size: 1.5rem !important; }

  /* Container side padding tighter */
  .container { padding: 0 1rem; }

  /* Carousel arrows smaller */
  .hero-carousel-btn {
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
  }

  /* Toast full width */
  .toast-container {
    left: 1rem;
    right: 1rem;
    top: auto;
    bottom: 5rem;
  }

  .toast { font-size: 0.85rem; padding: 0.75rem 1rem; }

  /* Form grid single column */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(240px, 1fr))"] {
    grid-template-columns: 1fr !important;
  }

  /* Quick stats cards row → wrap */
  div[style*="display: flex; gap: 1rem"] .card {
    flex: 1 1 80px;
    min-width: 80px;
  }
}
