/* ==========================================================================
   Hariom Solar — Main Stylesheet
   Covers: index.html, careers.html, offgrid.html, admin.html, admin-login.html
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Design tokens ---------- */
:root {
  --color-primary: #16a34a;
  --color-primary-dark: #0f7c37;
  --color-primary-light: #22c55e;
  --color-accent: #eab308;
  --color-accent-dark: #ca8a04;
  --color-dark: #0f172a;
  --color-text: #1f2937;
  --color-text-light: #6b7280;
  --color-bg: #ffffff;
  --color-bg-alt: #f8faf9;
  --color-border: #e6e9ec;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.16);

  --container-width: 1200px;
  --nav-height: 76px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
  color: var(--color-dark);
  line-height: 1.25;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section-padding { padding: 90px 0; }

.text-yellow { color: var(--color-accent); }
.text-white { color: #fff; }
.text-gray-light { color: #cbd5e1; }

.section-header { text-align: center; max-width: 640px; margin: 0 auto 56px; }

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 14px;
}

.section-description {
  color: var(--color-text-light);
  font-size: 1.05rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: var(--shadow-md); }

.btn-yellow { background: var(--color-accent); color: #1a1a1a; }
.btn-yellow:hover { background: var(--color-accent-dark); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.btn-black { background: var(--color-dark); color: #fff; }
.btn-black:hover { background: #000; box-shadow: var(--shadow-md); transform: translateY(-2px); }

.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.6); }
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: #fff; }

.btn-outline-dark { background: transparent; color: var(--color-dark); border: 2px solid var(--color-dark); }
.btn-outline-dark:hover { background: var(--color-dark); color: #fff; }

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.navbar.scrolled { box-shadow: var(--shadow-sm); border-bottom-color: var(--color-border); }

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--color-dark); }
.custom-logo, .nav-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; cursor: pointer; }

.nav-menu { display: flex; align-items: center; gap: 30px; }

.nav-link {
  position: relative;
  font-weight: 500;
  color: var(--color-text);
  padding: 6px 0;
  transition: color .2s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--color-primary);
  transition: width .25s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--color-primary); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.mobile-menu-btn {
  display: none;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  border: none;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
  color: var(--color-dark);
  cursor: pointer;
  z-index: 1100;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,15,10,.75) 0%, rgba(6,15,10,.55) 45%, rgba(6,15,10,.88) 100%);
}

.hero-content { position: relative; z-index: 1; max-width: 780px; padding: 60px 24px; }

.hero-title {
  color: #fff;
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  font-weight: 800;
  margin-bottom: 20px;
}

.hero-description {
  color: #e5e7eb;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  max-width: 620px;
  margin-bottom: 32px;
}

.hero-buttons { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 48px; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 40px; }
.stat-item { color: #fff; }
.stat-value { font-family: 'Poppins', sans-serif; font-size: 2rem; font-weight: 700; color: var(--color-accent); }
.stat-label { font-size: 0.9rem; color: #cbd5e1; margin-top: 2px; }

/* ==========================================================================
   Benefits
   ========================================================================== */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
}

.benefit-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 26px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.benefit-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: transparent; }

.benefit-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(22, 163, 74, 0.1);
  color: var(--color-primary);
  font-size: 1.4rem;
  margin-bottom: 18px;
}

.benefit-title { font-size: 1.15rem; margin-bottom: 8px; }
.benefit-description { color: var(--color-text-light); font-size: 0.95rem; }

/* ==========================================================================
   Services (index.html — cards are direct children of .container,
   so the container itself becomes the grid; section-header spans full width)
   ========================================================================== */
.services .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  align-items: stretch;
}
.services .container > .section-header { grid-column: 1 / -1; margin-bottom: 8px; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.service-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  cursor: default;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.services .service-card[onclick] { cursor: pointer; }

.service-image { position: relative; height: 210px; overflow: hidden; }
.service-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.service-card:hover .service-image img { transform: scale(1.06); }

.service-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,0) 40%, rgba(15,23,42,.55) 100%);
}

.service-icon-overlay {
  position: absolute; top: 16px; right: 16px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: #1a1a1a;
  font-size: 1.05rem;
}

.service-content { padding: 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.service-title { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.service-title i { color: var(--color-primary); }

.service-description { color: var(--color-text-light); font-size: 0.95rem; flex: 1; }

.service-link { color: var(--color-primary); font-weight: 600; margin-top: 6px; transition: gap .2s var(--ease); }
.service-link:hover { text-decoration: underline; }

/* Career job cards (careers.html) don't have images — center content nicely */
#careers .service-card, .career-form-popup ~ * .service-card {
  padding: 4px;
}
#careers .service-content { align-items: flex-start; }
#careers .service-card .btn { margin-top: auto; align-self: flex-start; }

/* ==========================================================================
   How it works
   ========================================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}
.step-item { text-align: center; padding: 10px; }
.step-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--color-bg-alt);
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  font-size: 1.4rem;
}
.step-number { color: var(--color-accent-dark); font-weight: 700; font-size: 0.85rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.step-title { font-size: 1.1rem; margin-bottom: 8px; }
.step-description { color: var(--color-text-light); font-size: 0.92rem; }

/* ==========================================================================
   Stats section
   ========================================================================== */
.stats-section { position: relative; color: #fff; }
.stats-bg { position: absolute; inset: 0; background: linear-gradient(135deg, #0f172a 0%, #14532d 100%); }
.stats-section .container { position: relative; z-index: 1; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.stat-card { text-align: center; padding: 20px; }
.stat-card-icon { font-size: 1.8rem; color: var(--color-accent); margin-bottom: 12px; }
.stat-card-value { font-family: 'Poppins', sans-serif; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
.stat-card-label { font-weight: 600; margin-top: 4px; }
.stat-card-suffix { color: #cbd5e1; font-size: 0.85rem; margin-top: 2px; }

/* ==========================================================================
   Testimonials
   ========================================================================== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}
.testimonial-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 30px;
  border: 1px solid var(--color-border);
}
.testimonial-stars { color: var(--color-accent); margin-bottom: 14px; display: flex; gap: 4px; }
.testimonial-text { color: var(--color-text); font-style: italic; margin-bottom: 18px; }
.testimonial-author { font-weight: 700; }
.testimonial-role { color: var(--color-text-light); font-size: 0.85rem; }

/* ==========================================================================
   CTA section
   ========================================================================== */
.cta-section {
  background: var(--color-bg-alt);
  text-align: center;
}
.cta-content { max-width: 680px; margin: 0 auto; }
.cta-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 14px; }
.cta-description { color: var(--color-text-light); margin-bottom: 30px; }
.cta-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 34px; }

.cta-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; }
.contact-item { display: flex; align-items: center; gap: 8px; color: var(--color-text); font-weight: 500; }
.contact-item i { color: var(--color-primary); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--color-dark); color: #cbd5e1; padding: 70px 0 26px; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.1rem; margin-bottom: 14px; }
.footer-description { font-size: 0.9rem; line-height: 1.7; margin-bottom: 18px; }

.social-links { display: flex; gap: 12px; }
.social-links a {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.social-links a:hover { background: var(--color-primary); transform: translateY(-3px); }

.footer-heading { color: #fff; font-size: 1rem; margin-bottom: 16px; }
.footer-links ul li { margin-bottom: 10px; }
.footer-links a { font-size: 0.9rem; transition: color .2s var(--ease); }
.footer-links a:hover { color: var(--color-accent); }

.footer-bottom { padding-top: 22px; text-align: center; font-size: 0.85rem; color: #94a3b8; }

/* ==========================================================================
   Popups shared: Quote popup, Calculator popup, Career form popup
   ========================================================================== */
.quote-popup, .calculator-popup, .career-form-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  animation: fadeIn .25s var(--ease);
}
.quote-popup.active, .calculator-popup.active, .career-form-popup.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.quote-popup-content, .calculator-box, .career-form-container {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 36px;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: popIn .3s var(--ease);
}

.quote-popup-content h2, .calculator-box h2, .career-form-container h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  padding-right: 30px;
}

.quote-popup-content input,
.quote-popup-content select,
.calculator-box input,
.career-form-container input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.quote-popup-content input:focus,
.quote-popup-content select:focus,
.calculator-box input:focus,
.career-form-container input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}

.calculator-box label, .career-form-container label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--color-text); }

.quote-popup-content button[type="submit"],
.calculator-box button,
.career-form-container button[type="submit"] { width: 100%; margin-top: 6px; }

.close-btn {
  position: absolute;
  top: 16px; right: 20px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-light);
  transition: color .2s var(--ease), transform .2s var(--ease);
  background: none; border: none;
}
.close-btn:hover { color: var(--color-dark); transform: rotate(90deg); }

.form-message { margin-top: 12px; font-size: 0.9rem; text-align: center; font-weight: 600; min-height: 1.2em; }
.form-message.success { color: var(--color-primary); }
.form-message.error { color: #dc2626; }

#result { margin-top: 16px; font-size: 0.95rem; }
#result .calc-highlight { color: var(--color-primary); font-weight: 700; font-size: 1.1rem; }

/* Careers-page application popup extra spacing */
.career-form-popup label { margin-top: 4px; }
#careerMessage.success { color: var(--color-primary); }
#careerMessage.error { color: #dc2626; }

/* ==========================================================================
   Off-grid gallery (offgrid.html)
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
  margin-top: 20px;
}
.gallery-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.gallery-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.gallery-item img { width: 100%; height: 220px; object-fit: cover; }
.gallery-desc { padding: 16px 18px; font-size: 0.92rem; color: var(--color-text-light); }

/* ==========================================================================
   Admin Login page base (page-specific styles live inline in admin-login.html)
   ========================================================================== */
.login-section { min-height: 100vh; }

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-content { padding: 40px 24px; }
}

@media (max-width: 968px) {
  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    bottom: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    padding: 24px;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform .35s var(--ease), opacity .3s var(--ease), visibility .35s;
    overflow-y: auto;
  }
  .nav-menu.active { transform: translateX(0); opacity: 1; visibility: visible; }

  .nav-menu .nav-link {
    padding: 14px 4px;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.05rem;
  }
  .nav-menu::after { display: none; }

  .nav-menu .btn { width: 100%; margin-top: 12px; }

  .mobile-menu-btn { display: flex; }

  .section-padding { padding: 64px 0; }
  .section-header { margin-bottom: 40px; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }

  .hero { min-height: 92vh; }
  .hero-title { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .hero-buttons .btn { width: 100%; }
  .hero-stats { gap: 24px; justify-content: space-between; }

  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .cta-buttons { flex-direction: column; align-items: stretch; }
  .cta-buttons .btn { width: 100%; }
  .cta-contact { flex-direction: column; align-items: center; gap: 12px; }

  .quote-popup-content, .calculator-box, .career-form-container { padding: 26px 20px; max-height: 92vh; }

  .dashboard-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .dashboard-cards { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; display: grid; gap: 16px; }
}

/* ==========================================================================
   Admin table — horizontal scroll wrapper on small screens
   ========================================================================== */
@media (max-width: 768px) {
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .search-box input { width: 100%; }
}