:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --text: #1c1a2e;
  --muted: #635f78;
  --border: #e6e3f2;
  --primary: #4338ca;
  --primary-dark: #362da3;
  --accent: #f59e0b;
  --accent-dark: #d97f06;
  --teal: #0d9488;
  --warn-bg: #fff7ed;
  --warn-text: #9a3412;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(30, 20, 80, 0.07);
  --hero-grad: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #6d28d9 100%);
  --font-head: "Sora", "Manrope", sans-serif;
  --font-body: "Manrope", "Segoe UI", Roboto, sans-serif;
}

html.dark {
  --bg: #0e0c1a;
  --surface: #17142a;
  --text: #ede9f7;
  --muted: #a29cc0;
  --border: #2b2745;
  --primary: #8b7bf0;
  --primary-dark: #7263e0;
  --accent: #fbbf24;
  --accent-dark: #f59e0b;
  --teal: #2dd4bf;
  --warn-bg: #2a1f14;
  --warn-text: #f3b981;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  --hero-grad: linear-gradient(135deg, #0b0a1a 0%, #241f4d 55%, #3d2a6d 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: var(--font-head); letter-spacing: -0.01em; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1080px;
  margin: 0 auto;
}
.logo { font-weight: 800; font-size: 1.3rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--primary); }
nav#navMenu { display: flex; gap: 22px; align-items: center; }
nav#navMenu a { color: var(--text); font-weight: 500; font-size: 0.95rem; }
nav#navMenu a:hover { color: var(--primary); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 14px; }
#themeToggle {
  background: var(--bg); border: 1px solid var(--border); border-radius: 50%;
  width: 38px; height: 38px; cursor: pointer; font-size: 1rem;
}
#navToggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); }

@media (max-width: 780px) {
  nav#navMenu {
    display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 20px;
  }
  nav#navMenu.open { display: flex; }
  #navToggle { display: block; }
}

/* Hero */
.hero {
  padding: 64px 20px 48px;
  text-align: center;
  background: var(--hero-grad);
  color: #f5f3ff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 15% 20%, rgba(245,158,11,0.18), transparent 40%),
                     radial-gradient(circle at 85% 80%, rgba(255,255,255,0.10), transparent 45%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  padding: 6px 16px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; margin-bottom: 18px;
  backdrop-filter: blur(4px);
}
.hero h1 { font-size: 2.5rem; margin-bottom: 14px; font-weight: 800; }
.hero p { color: rgba(245,243,255,0.85); font-size: 1.08rem; max-width: 640px; margin: 0 auto 30px; }
.hero-stats { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-top: 10px; }
.hero-stat { display: flex; flex-direction: column; align-items: center; }
.hero-stat strong { font-family: var(--font-head); font-size: 1.8rem; color: var(--accent); }
.hero-stat span { font-size: 0.82rem; color: rgba(245,243,255,0.75); }

/* Map section */
.map-section { padding: 50px 20px 30px; text-align: center; }
.map-legend { display: flex; justify-content: center; gap: 22px; margin-bottom: 22px; font-size: 0.85rem; color: var(--muted); flex-wrap: wrap; }
.map-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.map-legend .dot.detailed { background: var(--primary); }
.map-legend .dot.flat { background: var(--border); border: 1px solid var(--muted); }
.map-scroll { overflow-x: auto; padding: 10px 0 20px; }
.india-map-grid {
  display: inline-grid;
  grid-template-columns: repeat(13, 46px);
  grid-auto-rows: 46px;
  gap: 5px;
  margin: 0 auto;
}
.map-tile {
  display: flex; align-items: center; justify-content: center;
  background: var(--border); color: var(--text); border-radius: 8px;
  font-size: 0.6rem; font-weight: 700; text-align: center; padding: 2px;
  border: 1px solid transparent; transition: transform 0.12s, box-shadow 0.12s;
  overflow: hidden; line-height: 1.05;
}
.map-tile span { pointer-events: none; }
.map-tile.detailed { background: var(--primary); color: #fff; }
.map-tile.flat { background: var(--surface); color: var(--muted); border-color: var(--border); }
.map-tile:hover { transform: scale(1.14); box-shadow: 0 4px 14px rgba(30,20,80,0.25); z-index: 2; position: relative; }
.map-tile.detailed:hover { background: var(--accent); color: #1c1a2e; }

.az-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 900px; margin: 30px auto 0; }
.az-pill {
  padding: 7px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.az-pill.detailed { border-color: var(--primary); color: var(--primary); }
.az-pill:hover { background: var(--primary); color: #fff; text-decoration: none; border-color: var(--primary); }

@media (max-width: 700px) {
  .india-map-grid { grid-template-columns: repeat(13, 38px); grid-auto-rows: 38px; }
}

/* State cards grid */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  padding: 10px 20px 50px;
  max-width: 1080px;
  margin: 0 auto;
}
.state-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.state-card:hover { transform: translateY(-3px); }
.state-card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.state-card p { color: var(--muted); font-size: 0.9rem; margin: 0 0 14px; }
.state-card .btn { width: 100%; }

/* Buttons */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 8px; border: none;
  background: var(--primary); color: #fff; font-weight: 600; cursor: pointer; font-size: 0.95rem;
  text-align: center;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary); margin-top: 10px; }
.btn-secondary:hover { background: var(--bg); }

/* Sections */
section { padding: 40px 20px; }
section.alt { background: var(--surface); }
h2.section-title { font-size: 1.6rem; margin-bottom: 8px; text-align: center; }
p.section-sub { color: var(--muted); text-align: center; max-width: 600px; margin: 0 auto 30px; }

/* Calculator card */
.calc-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); max-width: 620px; margin: 0 auto 30px;
}
.calc-card h2 { margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 1rem;
}
.field small { color: var(--muted); display: block; margin-top: 4px; }

.result-card {
  margin-top: 22px; border-top: 2px dashed var(--border); padding-top: 18px;
}
.result-total {
  display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  border-radius: var(--radius); padding: 20px;
}
.result-total span { font-size: 0.9rem; opacity: 0.9; }
.result-total strong { font-size: 2.2rem; }
.result-total small { opacity: 0.85; }

table.breakdown-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.breakdown-table th, table.breakdown-table td {
  padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left;
}
table.breakdown-table .grand-total td { font-weight: 700; border-top: 2px solid var(--text); }
table.breakdown-table .free-row td { color: var(--accent); font-style: italic; }
.fac-note {
  background: var(--warn-bg); color: var(--warn-text); padding: 10px 14px; border-radius: 8px;
  font-size: 0.85rem; margin-top: 12px;
}
.error { color: #dc2626; font-weight: 600; }

/* Appliance rows */
.appliance-row {
  display: grid; grid-template-columns: 1fr 70px 90px; gap: 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.appliance-name { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; cursor: pointer; }
.appliance-name input { width: auto; }

/* Tariff table on state pages */
.tariff-table-wrap { overflow-x: auto; margin: 20px 0; }
table.tariff-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
table.tariff-table th { background: var(--primary); color: #fff; padding: 10px 14px; text-align: left; }
table.tariff-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
table.tariff-table tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; margin-bottom: 12px; }
.faq-item h4 { margin: 0 0 8px; }
.faq-item p { margin: 0; color: var(--muted); }

/* Content / blog / legal */
.content { max-width: 760px; margin: 0 auto; padding: 40px 20px; }
.content h1 { font-size: 2rem; }
.content h2 { font-size: 1.4rem; margin-top: 32px; }
.content p, .content li { color: var(--text); }
.content .meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.blog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.blog-card h3 { margin-top: 0; font-size: 1.1rem; }
.blog-card p { color: var(--muted); font-size: 0.9rem; }

/* Footer */
footer.site-footer {
  background: var(--surface); border-top: 1px solid var(--border); padding: 40px 20px 20px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; max-width: 1080px; margin: 0 auto; }
.footer-grid h4 { margin: 0 0 12px; font-size: 0.95rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 0.9rem; }
.footer-grid a { color: var(--muted); }
.footer-bottom {
  max-width: 1080px; margin: 30px auto 0; padding-top: 20px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.82rem; text-align: center;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

.disclaimer-banner {
  background: var(--warn-bg); color: var(--warn-text); text-align: center; padding: 8px 16px; font-size: 0.85rem;
}
