/* Shared styles for Barmore Energy static pages (e.g. contact.html) */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: #333; background: #f9f9f9; min-height: 100vh; }

/* Header (shared – matches index.php layout) */
.header { position: sticky; top: 0; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.1); z-index: 1000; }
.header-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.header-content { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; gap: 2rem; }
.header .logo { font-size: 1.5rem; font-weight: 700; color: #06c; text-decoration: none; white-space: nowrap; }
.header .logo:hover { text-decoration: underline; }
.header .nav { display: flex; gap: 2rem; flex: 1; justify-content: center; }
.header .nav-link { color: #333; text-decoration: none; font-weight: 500; transition: color .3s; }
.header .nav-link:hover { color: #06c; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.cta-button { background: #06c; color: #fff; border: none; padding: .75rem 1.5rem; border-radius: 4px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .3s; }
.cta-button:hover { background: #0052a3; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; color: #333; }
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .header .nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; padding: 1rem; box-shadow: 0 4px 8px rgba(0,0,0,.1); display: none; gap: 1rem; }
  .header .nav.nav-open { display: flex; }
  .cta-button { padding: .5rem 1rem; font-size: .9rem; }
}

/* Contact page */
.contact-page { max-width: 600px; margin: 0 auto; padding: 3rem 20px; }
.contact-page h1 { font-size: 2rem; margin-bottom: 0.5rem; color: #0a2540; }
.contact-page p { color: #666; margin-bottom: 2rem; }
.contact-page .registration-note { font-size: 0.9rem; color: #555; margin-bottom: 1.5rem; }

/* Homepage about section - registration */
.about-registration { color: rgba(255,255,255,0.95); font-size: 0.95rem; margin: 0 0 1rem 0; line-height: 1.5; }

/* Inner pages (Our Story, Benefits) */
.page-content { max-width: 640px; margin: 0 auto; padding: 3rem 20px; }
.page-content h1 { font-size: 2rem; margin-bottom: 0.5rem; color: #0a2540; }
.page-content .lead { font-size: 1.25rem; color: #06c; font-weight: 600; margin-bottom: 1rem; }
.page-content p { color: #333; margin-bottom: 1.25rem; line-height: 1.7; }
.page-content .page-list { margin: 1.25rem 0 1.5rem 1.5rem; padding: 0; }
.page-content .page-list li { margin-bottom: 0.75rem; color: #333; line-height: 1.6; }

/* Legal pages (Privacy, Terms) */
.legal-page h2 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.75rem; color: #0a2540; }
.legal-page h2:first-of-type { margin-top: 1.5rem; }
.legal-page .lead { font-size: 0.95rem; color: #666; margin-bottom: 1.5rem; }
.legal-page a { color: #06c; text-decoration: none; }
.legal-page a:hover { text-decoration: underline; }
.legal-page ul.page-list { margin-bottom: 1.25rem; }
.contact-form { background: #fff; padding: 2rem; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,.08); }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: #333; }
.form-group input, .form-group textarea { width: 100%; padding: 0.75rem 1rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: #06c; }
.form-group textarea { min-height: 140px; resize: vertical; }
.form-group select, .form-select { width: 100%; padding: 0.75rem 1rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; font-family: inherit; background: #fff; }
.submit-btn { background: #06c; color: #fff; border: none; padding: 0.875rem 1.5rem; border-radius: 4px; font-size: 1rem; font-weight: 600; cursor: pointer; width: 100%; transition: background .3s; }
.submit-btn:hover { background: #0052a3; }
.submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.form-message { margin-top: 1rem; padding: 0.75rem; border-radius: 4px; display: none; }
.form-message.success { background: #d4edda; color: #155724; display: block; }
.form-message.error { background: #f8d7da; color: #721c24; display: block; }

/* Footer (shared – so contact.php and other pages have same footer look) */
.footer { background: #1a1a1a; color: #fff; padding: 3rem 20px 1.5rem; }
.footer-container { max-width: 1400px; margin: 0 auto; }
.footer-newsletter { border-bottom: 1px solid #333; padding-bottom: 3rem; margin-bottom: 3rem; }
.newsletter-content { max-width: 600px; margin: 0 auto; text-align: center; }
.newsletter-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; }
.newsletter-description { color: #ccc; margin-bottom: 1.5rem; line-height: 1.6; }
.newsletter-form { display: flex; gap: .5rem; max-width: 400px; margin: 0 auto; }
.newsletter-input { flex: 1; padding: .875rem 1rem; border: 1px solid #444; border-radius: 4px; background: #2a2a2a; color: #fff; font-size: 1rem; }
.newsletter-input::placeholder { color: #888; }
.newsletter-input:focus { outline: none; border-color: #06c; }
.newsletter-button { background: #06c; color: #fff; border: none; padding: .875rem 1.5rem; border-radius: 4px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.newsletter-button:hover { background: #0052a3; }
.footer-main { display: flex; flex-direction: column; gap: 2rem; }
.footer-content { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; align-items: start; }
.footer-brand { display: flex; flex-direction: column; gap: 1rem; }
.footer-brand-name { font-size: 1.75rem; font-weight: 700; margin: 0 0 .5rem 0; }
.brand-name-red { color: #06c; }
.brand-name-white { color: #06c; }
.footer-tagline { color: #fff; line-height: 1.6; }
.footer-registration { font-size: 0.875rem; color: #9ca3af; margin: 0; line-height: 1.5; }
.social-links { display: flex; gap: 1rem; }
.social-link { color: #ccc; transition: color .3s; }
.social-link:hover { color: #fff; }
.social-link svg { width: 24px; height: 24px; display: block; }
.footer-column { display: flex; flex-direction: column; gap: 1rem; }
.footer-heading { font-size: 1.1rem; font-weight: 600; margin-bottom: .5rem; color: #fff; }
.footer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
.footer-list a { color: #fff; text-decoration: none; transition: color .3s; }
.footer-list a:hover { color: #ccc; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid #333; flex-wrap: wrap; gap: 1rem; }
.footer-copyright { color: #888; }
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { color: #ccc; text-decoration: none; transition: color .3s; }
.footer-legal a:hover { color: #fff; }
@media (max-width: 768px) {
  .footer-newsletter { padding-bottom: 2rem; margin-bottom: 2rem; }
  .newsletter-form { flex-direction: column; max-width: 100%; }
  .newsletter-button { width: 100%; }
  .footer-content { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-legal { justify-content: center; }
}

/* Service card image overlay (Residential / Commercial label on top of photo) */
.service-image-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Hero secondary CTA: use solid fill instead of outline */
.hero .btn-secondary {
  background: #06c;
  color: #fff;
  border: 2px solid #06c;
}
.hero .btn-secondary:hover {
  background: #0052a3;
  border-color: #0052a3;
  color: #fff;
}

/* Theme toggle: last item in nav (desktop + mobile hamburger) */
.theme-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.nav .theme-toggle {
  position: static;
  top: auto;
  right: auto;
  margin-left: 0.5rem;
}
.theme-toggle:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
@media (max-width: 768px) {
  .nav .theme-toggle {
    margin-left: 0;
    margin-top: 0.5rem;
    align-self: flex-start;
  }
}
/* In light mode: dark circle with white moon (click to go dark) */
.theme-toggle.is-light-mode {
  background: #1a1a1a;
}
.theme-toggle.is-light-mode svg {
  color: #fff;
}
/* In dark mode: light circle with dark sun (click to go light) */
.theme-toggle.is-dark-mode {
  background: #f5f5f5;
}
.theme-toggle.is-dark-mode svg {
  color: #1a1a1a;
}
.theme-toggle svg {
  width: 22px;
  height: 22px;
}
.theme-toggle .theme-icon-sun,
.theme-toggle .theme-icon-moon {
  display: none;
}
.theme-toggle.is-dark-mode .theme-icon-sun {
  display: block;
}
.theme-toggle.is-light-mode .theme-icon-moon {
  display: block;
}

/* Dark mode base */
html.dark-mode, html.dark-mode body {
  background: #020617;
  color: #e5e7eb;
}

/* Dark mode for header (React site + contact page) */
html.dark-mode .header {
  background: #020617;
  box-shadow: 0 2px 8px rgba(15,23,42,0.8);
}
html.dark-mode .header a {
  color: #60a5fa;
}
@media (max-width: 768px) {
  html.dark-mode .header .nav {
    background: #0f172a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  }
  html.dark-mode .header .nav .nav-link {
    color: #e5e7eb;
  }
  html.dark-mode .header .nav .nav-link:hover {
    color: #60a5fa;
  }
}

/* Dark mode for main one-page sections (React bundle classes) */
html.dark-mode .hero-background:after {
  background: rgba(0,0,0,0.65);
}
html.dark-mode .services {
  background: #020617;
}
html.dark-mode .service-card {
  background: #0b1120;
  box-shadow: 0 4px 10px rgba(15,23,42,0.9);
}
html.dark-mode .service-description {
  color: #9ca3af;
}
html.dark-mode .about {
  background: linear-gradient(135deg,#020617,#111827);
}

/* Buttons and links in dark mode */
html.dark-mode .cta-button,
html.dark-mode .learn-more-button,
html.dark-mode .newsletter-button,
html.dark-mode .btn-primary,
html.dark-mode .btn-secondary {
  border-color: transparent;
}
html.dark-mode .cta-button,
html.dark-mode .learn-more-button,
html.dark-mode .newsletter-button,
html.dark-mode .btn-primary {
  background: #1d4ed8;
  color: #e5e7eb;
}
/* Header-specific override: keep CTA contrast against the dark header. */
html.dark-mode .header .cta-button {
  color: #ffffff;
}
html.dark-mode .cta-button:hover,
html.dark-mode .learn-more-button:hover,
html.dark-mode .newsletter-button:hover,
html.dark-mode .btn-primary:hover {
  background: #1e40af;
}
html.dark-mode .btn-secondary {
  background: transparent;
  color: #e5e7eb;
  border-color: #e5e7eb;
}
html.dark-mode .hero .btn-secondary {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}
html.dark-mode .hero .btn-secondary:hover {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
}
html.dark-mode .btn-secondary:hover {
  background: #e5e7eb;
  color: #1e293b;
}

/* Dark mode footer overrides */
html.dark-mode .footer {
  background: #020617;
  color: #e5e7eb;
}
html.dark-mode .footer-tagline {
  color: #e5e7eb;
}
html.dark-mode .footer-brand-name .brand-name-red,
html.dark-mode .footer-brand-name .brand-name-white {
  color: #60a5fa; /* Match the header logo/link color in dark mode */
}
html.dark-mode .footer-list a,
html.dark-mode .footer-legal a {
  color: #9ca3af;
}
html.dark-mode .footer-list a:hover,
html.dark-mode .footer-legal a:hover {
  color: #e5e7eb;
}

/* Dark mode contact form overrides */
html.dark-mode .contact-page p {
  color: #9ca3af;
}
html.dark-mode .contact-form {
  background: #020617;
  box-shadow: 0 4px 10px rgba(15,23,42,0.9);
}
html.dark-mode .form-group label {
  color: #e5e7eb;
}
html.dark-mode .form-group input,
html.dark-mode .form-group textarea,
html.dark-mode .form-group select {
  background: #020617;
  border-color: #4b5563;
  color: #e5e7eb;
}
html.dark-mode .form-group input::placeholder,
html.dark-mode .form-group textarea::placeholder {
  color: #6b7280;
}

/* Dark mode inner pages */
html.dark-mode .page-content h1 { color: #e5e7eb; }
html.dark-mode .page-content .lead { color: #60a5fa; }
html.dark-mode .page-content p,
html.dark-mode .page-content .page-list li { color: #d1d5db; }
html.dark-mode .contact-page .registration-note { color: #9ca3af; }
html.dark-mode .legal-page h2 { color: #e5e7eb; }
html.dark-mode .legal-page .lead { color: #9ca3af; }
html.dark-mode .legal-page a { color: #60a5fa; }

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

/* Strong keyboard focus indicators (WCAG 2.2 focus visibility) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #06c;
  outline-offset: 3px;
}
