/* =========================================================================
   Independent Utility Information Platform — design system
   Original visual identity: off-white surface, deep navy type,
   teal/green primary accent, soft blue secondary accent.
   ========================================================================= */

:root {
  --navy-950: #0b1220;
  --navy-900: #101a2e;
  --navy-800: #16233c;
  --navy-700: #223252;
  --navy-500: #4a5b7c;
  --navy-300: #8794ab;

  --teal-600: #0f7a63;
  --teal-500: #14926f;
  --teal-400: #1fae82;
  --teal-100: #e2f6ee;

  --blue-500: #3d7bf5;
  --blue-100: #e7effe;

  --amber-500: #d98c0f;
  --amber-100: #fbf0dc;

  --red-600: #c33b3b;
  --red-100: #fbe9e9;

  --surface: #f7f8fb;
  --surface-alt: #ffffff;
  --border: #e4e8f0;
  --border-strong: #d4dae6;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-sm: 0 1px 2px rgba(16, 26, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 26, 46, 0.08);
  --shadow-lg: 0 20px 48px rgba(16, 26, 46, 0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--surface);
  color: var(--navy-900);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--teal-600); text-decoration: none; }
a:hover { color: var(--teal-500); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--navy-950);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--navy-700); }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--alt { background: var(--surface-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-600);
  background: var(--teal-100);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.section-head { max-width: 640px; margin: 0 0 36px; }
.section-head p { color: var(--navy-500); font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  text-decoration: none;
  line-height: 1.1;
}
.btn:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: #fff; text-decoration: none; }
.btn-secondary {
  background: var(--surface-alt);
  color: var(--navy-900);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--navy-950); color: #fff; text-decoration: none; border-color: var(--navy-950); }
.btn-ghost { background: transparent; color: var(--navy-900); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); text-decoration: none; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn[disabled], .btn.is-loading { opacity: 0.7; cursor: progress; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 248, 251, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--navy-950);
}
.brand:hover { text-decoration: none; color: var(--navy-950); }
.brand__mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal-400), var(--blue-500));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
}
.brand__name span { color: var(--teal-600); }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav ul { display: flex; margin: 0; padding: 0; gap: 4px; align-items: center; list-style: none; }
.main-nav li { position: relative; list-style: none; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy-700);
}
.nav-link:hover, .nav-link[aria-expanded="true"] { background: var(--surface-alt); color: var(--navy-950); text-decoration: none; }

.dropdown { position: relative; }
.dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  display: none;
  z-index: 60;
}
.dropdown-panel.is-open { display: block; }
.dropdown-panel__group + .dropdown-panel__group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.dropdown-panel__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy-300);
  padding: 6px 10px;
}
.dropdown-panel a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--navy-800);
  font-size: 0.94rem;
  font-weight: 500;
}
.dropdown-panel a:hover { background: var(--teal-100); color: var(--teal-600); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none;
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  border-radius: 10px;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  cursor: pointer;
}

@media (max-width: 960px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-actions .btn-primary { display: none; }
  .site-header.is-open .main-nav {
    display: block;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 12px;
  }
  .site-header.is-open .main-nav ul { flex-direction: column; align-items: stretch; }
  .site-header.is-open .dropdown-panel { position: static; box-shadow: none; border: none; padding-left: 12px; margin-top: 0; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(20, 146, 111, 0.14), transparent 60%),
    radial-gradient(900px 420px at 0% 0%, rgba(61, 123, 245, 0.10), transparent 55%);
}
.hero__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero__solo { max-width: 720px; text-align: center; margin: 0 auto; }
.hero__solo .hero__ctas { justify-content: center; }
.hero h1 { margin-bottom: 18px; }
.hero p.lead { font-size: 1.15rem; color: var(--navy-500); margin-bottom: 28px; max-width: 52ch; }
.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.hero__disclosure {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--navy-500);
  background: var(--surface-alt); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 999px;
}
.hero__panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.hero__stat { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.hero__stat:last-child { border-bottom: none; }
.hero__stat strong { color: var(--navy-950); font-size: 1.4rem; display: block; }
.hero__stat span { color: var(--navy-500); font-size: 0.85rem; }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
}

/* ---------- Search ---------- */
.provider-search {
  position: relative;
  max-width: 620px;
}
.provider-search input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}
.provider-search input:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 1px; }
.provider-search .icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--navy-300);
}
.provider-search__count {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  color: var(--navy-500); padding: 6px 12px;
}

/* ---------- Provider grid ---------- */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 32px;
}
@media (max-width: 1020px) { .provider-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .provider-grid { grid-template-columns: 1fr; } }

.provider-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.provider-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.provider-card:focus-within { outline: 3px solid var(--blue-500); outline-offset: 2px; }
.provider-card__logo {
  width: 68px; height: 68px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.provider-card__logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.provider-card__acronym { font-weight: 800; font-size: 1.05rem; color: var(--navy-950); }
.provider-card__name { color: var(--navy-500); font-size: 0.88rem; margin: 4px 0 6px; min-height: 2.6em; }
.provider-card__tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  color: var(--teal-600); background: var(--teal-100);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 16px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.provider-card .btn { width: 100%; }
.provider-card[hidden] { display: none; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 32px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.step__num {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--navy-950); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin-bottom: 14px;
}

/* ---------- Cards / feature grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .card-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-card__icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--teal-100); color: var(--teal-600);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  max-width: 560px;
  margin: 0 auto;
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 8px; color: var(--navy-950); font-size: 0.95rem; }
.form-control {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 1.05rem;
  background: var(--surface);
  letter-spacing: 0.02em;
}
.form-control:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 1px; border-color: var(--blue-500); }
.form-hint { font-size: 0.85rem; color: var(--navy-500); margin-top: 8px; }
.form-error { font-size: 0.85rem; color: var(--red-600); margin-top: 8px; font-weight: 600; }
select.form-control { appearance: none; }

.field-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; }
@media (max-width: 760px) { .field-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Alerts ---------- */
.alert {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  border: 1px solid;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.alert-info { background: var(--blue-100); border-color: #c7d9fb; color: var(--navy-800); }
.alert-success { background: var(--teal-100); border-color: #b9e6d5; color: var(--navy-800); }
.alert-warning { background: var(--amber-100); border-color: #f0dba9; color: var(--navy-800); }
.alert-error { background: var(--red-100); border-color: #f0c4c4; color: var(--navy-800); }

/* ---------- Result page ---------- */
.result-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
}
.result-card__head {
  background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
  color: #fff;
  padding: 32px;
  text-align: center;
}
.result-card__head img { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 14px; background: #fff; padding: 8px; }
.result-card__body { padding: 32px; }
.bill-fields { width: 100%; border-collapse: collapse; }
.bill-fields tr { border-bottom: 1px solid var(--border); }
.bill-fields tr:last-child { border-bottom: none; }
.bill-fields th, .bill-fields td { text-align: left; padding: 14px 4px; vertical-align: top; }
.bill-fields th { color: var(--navy-500); font-weight: 600; font-size: 0.92rem; width: 50%; }
.bill-fields td { color: var(--navy-950); font-weight: 700; font-size: 1.02rem; text-align: right; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 24px 32px 32px; }
.result-actions .btn { flex: 1 1 auto; }
.external-bill-form { width: min(100%, 28rem); margin-inline: auto; }

.masked-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 8px;
}

/* ---------- Calculators ---------- */
.calc-shell {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
}
.calc-results {
  margin-top: 24px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 22px;
}
.calc-results dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; margin: 0; }
.calc-results dt { color: var(--navy-500); }
.calc-results dd { margin: 0; font-weight: 700; color: var(--navy-950); text-align: right; }
.appliance-row { display: grid; grid-template-columns: 1.4fr 0.7fr 0.9fr 0.7fr auto; gap: 10px; align-items: center; margin-bottom: 10px; }
@media (max-width: 760px) { .appliance-row { grid-template-columns: 1fr 1fr; } }
.icon-btn {
  border: 1px solid var(--border-strong); background: var(--surface-alt);
  border-radius: 8px; width: 38px; height: 38px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--red-600);
}

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--border); padding: 18px 0; }
.faq-item summary { cursor: pointer; font-weight: 700; color: var(--navy-950); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--teal-600); font-size: 1.3rem; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { margin-top: 12px; }

/* ---------- Guides ---------- */
.guide-body h2 { margin-top: 1.6em; }
.guide-body ul, .guide-body ol { color: var(--navy-700); padding-left: 1.3em; }
.guide-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 28px; }
@media (max-width: 760px) { .guide-list { grid-template-columns: 1fr; } }
.guide-tile { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 22px; box-shadow: var(--shadow-sm); }

/* ---------- Sources ---------- */
.source-item {
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 22px; margin-bottom: 14px; display: flex; justify-content: space-between; gap: 20px; align-items: center; flex-wrap: wrap;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 0.85rem; color: var(--navy-500); margin-bottom: 20px; }
.breadcrumbs a { color: var(--navy-500); }
.breadcrumbs span[aria-current] { color: var(--navy-900); font-weight: 600; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--navy-950);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  color: #fff;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #c3cbe0; max-width: 55ch; margin: 0 auto 24px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: #c3cbe0; padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: #a9b3cc; font-size: 0.92rem; }
.site-footer a:hover { color: #fff; }
.footer-brand { font-weight: 800; font-size: 1.1rem; color: #fff; margin-bottom: 10px; display: block; }
.footer-disclosure { font-size: 0.85rem; color: #8794ab; max-width: 42ch; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 40px; padding-top: 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.82rem; color: #8794ab;
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 10px; top: -50px;
  background: var(--navy-950); color: #fff; padding: 10px 16px; border-radius: 8px;
  z-index: 200; transition: top .15s ease;
}
.skip-link:focus { top: 10px; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .result-actions, .no-print, .skip-link { display: none !important; }
  body { background: #fff; }
  .result-card { box-shadow: none; border: 1px solid #ccc; }
  .result-card__head { background: #fff !important; color: #000 !important; }
}
