/* 
  SolarCalculators.in - Premium Design System (Refreshed 2026)
  Theme: Modern SaaS, Financial Trust, Clean
*/

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  /* Brand Colors */
  --primary-color: #00D084;
  /* Vibrant Green */
  --primary-dark: #00965E;
  --primary-light: rgba(0, 208, 132, 0.1);
  --secondary-color: #0070F3;
  /* Modern Blue */
  --accent-color: #FFB300;

  /* Neutral Colors */
  --bg-body: #F8FAFC;
  /* Slate-50 - Lighter, cleaner background */
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  /* Slate-900 - Sharp dark text */
  --text-muted: #64748B;
  /* Slate-500 - Soft secondary text */
  --border-color: #E2E8F0;
  /* Slate-200 - Subtle borders */

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius: 16px;

  /* Layout */
  --container-width: 1200px;
  --header-height: 72px;

  /* Typography Scale (Desktop) */
  --text-display: 3.5rem;
  --text-h1: 2.75rem;
  /* 44px */
  --text-h2: 2.25rem;
  /* 36px */
  --text-h3: 1.75rem;
  /* 28px */
  --text-h4: 1.5rem;
  /* 24px */
  --text-h5: 1.25rem;
  /* 20px */
  --text-h6: 1rem;
  /* 16px */
  --text-base: 1.125rem;
  /* 18px - Improved Readability */
  --text-small: 0.875rem;
  /* 14px */

  /* Font Weights */
  --weight-bold: 800;
  --weight-semibold: 700;
  --weight-medium: 600;
  --weight-regular: 400;

  /* Typography Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Mobile Typography Overrides */
@media (max-width: 768px) {
  :root {
    --text-display: 2.5rem;
    --text-h1: 2rem;
    /* 32px */
    --text-h2: 1.75rem;
    /* 28px */
    --text-h3: 1.5rem;
    /* 24px */
    --text-h4: 1.25rem;
    /* 20px */
    --text-h5: 1.125rem;
    /* 18px */
    --text-base: 1rem;
    /* 16px */
  }
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: var(--text-base);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6,
.logo,
.metric-value,
.btn {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin-bottom: 0.75em;
  color: var(--text-main);
}

h1 {
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
}

h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
}

h3 {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
}

h4 {
  font-size: var(--text-h4);
  font-weight: var(--weight-medium);
}

h5 {
  font-size: var(--text-h5);
  font-weight: var(--weight-medium);
}

h6 {
  font-size: var(--text-h6);
  font-weight: var(--weight-medium);
}

p {
  margin-bottom: 1.25em;
  color: var(--text-muted);
}

small,
.small {
  font-size: var(--text-small);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

ul {
  list-style: none;
}

/* Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

.text-success {
  color: var(--primary-dark);
}

.text-danger {
  color: #E02020;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: var(--text-base-mobile);
  /* 16px usually */
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 208, 132, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 208, 132, 0.35);
  background: #00b074;
}

.btn-secondary,
.btn-outline-primary {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--primary-light);
}


/* Header */
.main-header {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  height: var(--header-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

/* Nav Links (Desktop) */
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-links a.vendor-link {
  background: var(--primary-color);
  color: white !important;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.nav-links a.vendor-link:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Mobile Menu Button (Hidden on Desktop) */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-main);
  padding: 5px;
}

.header-cta-mobile {
  display: none;
}

/* Mobile Responsiveness for Header */
@media (max-width: 1024px) {
  .header-cta-mobile {
    display: flex;
    align-items: center;
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    margin-right: 12px;
    box-shadow: 0 4px 10px rgba(0, 208, 132, 0.2);
  }

  .nav-links {
    display: none !important;
    position: absolute;
    top: 72px;
    /* Fixed height for consistency */
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: 30px 24px;
    gap: 20px;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1001;
  }

  .nav-links.active {
    display: flex !important;
  }

  .mobile-menu-btn {
    display: block !important;
  }

  .logo {
    font-size: 1.25rem !important;
  }

  .nav-container {
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .lang-switch {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
  }
}

/* Body overflow fix */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.lang-switch .lang-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  background: white;
  background: white;
  border-radius: 8px;
  font-size: var(--text-small);
  cursor: pointer;
  margin-left: 8px;
  font-weight: 700;
  font-family: var(--font-heading);
}

.lang-switch .lang-btn.active {
  background: var(--text-main);
  color: white;
  border-color: var(--text-main);
}

/* Grid System */
.grid {
  display: grid;
  gap: 32px;
  /* Increased gap for cleaner look */
}

/* Calculator Grid - Homepage */
.calc-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}

/* Single column mobile */
.grid-2,
.grid-3 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns on tablet */
  }

  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Custom Split for Calculators (Left Form smaller, Right Result larger) */
  .grid-calc {
    grid-template-columns: 350px 1fr;
    align-items: start;
    gap: 32px;
  }

  /* Wider layout for Load Calculator specifically */
  body.solar-load-calculator-page .grid-calc {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    /* 3 columns on desktop */
  }

  .calc-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Homepage Hero */
.hero-section {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-section h1 {
  font-size: var(--text-display);
  color: var(--text-main);
  margin-bottom: 24px;
  letter-spacing: -1.5px;
  line-height: 1.1;
}

.hero-section p {
  font-size: var(--text-h5);
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
}

/* Base Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 32px;
  transition: transform 0.2s, box-shadow 0.2s;
}

/* Calculator Selection Cards (Homepage) - PREMIUM UPDATE */
.calc-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  /* More padding */
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.calc-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-xl);
  transform: translateY(-6px);
  /* Better lift */
}

/* Colored accent line on hover */
.calc-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.calc-card:hover::after {
  transform: scaleX(1);
}

.calc-icon {
  font-size: 2rem;
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: #F1F5F9;
  /* Subtle background */
  border-radius: 16px;
  color: var(--text-main);
  transition: all 0.3s ease;
}

.calc-card:hover .calc-icon {
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: scale(1.1) rotate(3deg);
}

.calc-title {
  font-size: var(--text-h5);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.calc-desc {
  font-size: 1rem;
  /* Slightly smaller than base 1.125rem */
  color: var(--text-muted);
  line-height: 1.5;
}

/* Calculator Forms */
.calculator-form-card {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: var(--text-small);
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  font-family: var(--font-body);
  background-color: #fff;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.form-control:hover {
  border-color: #CBD5E1;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-light);
}

/* Metrics */
.metric-card {
  background: #fff;
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.metric-card.highlight {
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
  border-color: #BAE6FD;
}

.metric-card.success {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border-color: #BBF7D0;
}

.metric-label {
  font-size: var(--text-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.metric-value {
  font-size: var(--text-h1);
  font-weight: 800;
  color: var(--text-main);
}

.metric-sub {
  font-size: var(--text-small);
  color: var(--text-muted);
  margin-top: 4px;
}

/* FAQ */
.faq-section {
  margin-top: 60px;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 24px 0;
}

.faq-question {
  font-weight: 600;
  cursor: pointer;
  font-size: var(--text-base);
  color: var(--text-main);
}

.faq-answer {
  display: none;
  margin-top: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Footer */
footer {
  background: #0F172A;
  /* Darker Slate for premium look */
  color: white;
  padding: 48px 0 24px;
  /* Reduced from 80px 0 40px */
  margin-top: 60px;
  /* Reduced from 120px */
}

.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  align-items: start;
  margin-bottom: 32px;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    /* 4 Columns: Brand larger */
  }
}

.footer-links h4 {
  color: white;
  margin-bottom: 16px;
  font-size: var(--text-h6);
  font-weight: 700;
}

.footer-links a {
  color: #94A3B8;
  margin-bottom: 8px;
  margin-bottom: 8px;
  /* Reduced spacing */
  display: block;
  font-size: var(--text-small);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary-color);
  /* Hover to green */
  text-decoration: none;
}

/* Spinner */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border-left-color: var(--primary-color);
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* --- Homepage Redesign (Features & FAQ) --- */

/* Feature Section */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 32px;
}

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(4, 1fr);
    /* 4 columns for key benefits */
  }
}

.feature-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}

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

.feature-icon-wrapper {
  width: 48px;
  height: 48px;
  background: #F0FDF4;
  /* Light green bg */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.5rem;
}

.feature-title {
  font-weight: 700;
  font-size: var(--text-base);
  margin-bottom: 8px;
  color: var(--text-main);
}

.feature-desc {
  font-size: var(--text-small);
  color: var(--text-muted);
  line-height: 1.5;
}


/* Lead Capture Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.faq-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}


.faq-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.faq-card[open] {
  background: #FAFAFA;
}

.faq-summary {
  padding: 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  /* Remove default triangle */
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-muted);
}

.faq-card[open] .faq-summary::after {
  content: '−';
}

.faq-content {
  padding: 0 20px 20px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  border-top: 1px solid transparent;
}

.faq-card[open] .faq-content {
  border-top-color: #eee;
  padding-top: 16px;
}

/* --- Premium Cost Breakdown Table --- */
.breakdown-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 8px;
}

.breakdown-table td {
  padding: 16px 12px;
  border-bottom: 1px dashed var(--border-color);
  font-size: 1.05rem;
  color: var(--text-main);
  vertical-align: middle;
}

.breakdown-table tr:last-child td {
  border-bottom: none;
}

.breakdown-table .text-right {
  text-align: right;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
}

.breakdown-table .subsidy-row td {
  color: var(--primary-dark);
  font-weight: 500;
  background-color: rgba(0, 208, 132, 0.03);
}

/* Final Row Highlighting */
.breakdown-table .final-row td {
  /* Increased padding for separation */
  padding-top: 24px;
  padding-bottom: 24px;

  /* Visual styling */
  background-color: #F0FDF4;
  /* Light Green Bg */
  border-top: 2px solid var(--primary-color);
  border-bottom: none;
  color: #166534;
  /* Dark Green Text */
}

.breakdown-table .final-row td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  padding-left: 24px;
}

.breakdown-table .final-row td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  padding-right: 24px;
  font-size: 1.8rem;
  /* Larger final number */
  font-weight: 800;
  color: #166534;
}

.final-label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  font-size: 1.1rem;
}

.final-sub {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.8;
  margin-top: 4px;
}

/* Solar Load Calculator Specific Styles */
.appliance-row {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.appliance-info {
  display: flex;
  flex-direction: column;
}

.appliance-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1rem;
}

.appliance-watts {
  font-size: var(--text-small);
  color: var(--text-muted);
}

.appliance-inputs {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-with-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-with-label label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.input-with-label input {
  width: 70px !important;
  text-align: center;
  padding: 8px !important;
}

@media (max-width: 600px) {
  .appliance-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .appliance-inputs {
    justify-content: space-between;
    width: 100%;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
  }

  .input-with-label input {
    width: 80px !important;
  }
}

/* Global Activity Ticker */
.global-ticker {
  background: #0F172A !important;
  color: #94A3B8 !important;
  padding: 10px 0 !important;
  font-size: 0.85rem !important;
  border-bottom: 1px solid #1E293B !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  position: relative !important;
  z-index: 999 !important;
  display: block !important;
}

.ticker-track {
  display: inline-block !important;
  white-space: nowrap !important;
  animation: ticker-scroll 30s linear infinite !important;
  pointer-events: auto !important;
  padding-right: 50px;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-block;
  padding-right: 50px;
  color: #E2E8F0;
}

.ticker-item a {
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: none;
  margin-left: 5px;
}

.ticker-item a:hover {
  text-decoration: underline;
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

@media (max-width: 768px) {
  .global-ticker {
    padding: 8px 0;
    font-size: 0.75rem;
  }
}