:root {
  /* Palette tuned to the Evasta logo: deep navy → electric blue → cyan */
  --ink: #0a1a2f;          /* deep navy ink */
  --ink-soft: #475a73;     /* muted slate-blue */
  --sand: #eef4fb;         /* cool light surface */
  --mint: #bfe7f2;         /* soft cyan */
  --clay: #f3b29b;         /* warm accent (map markers) */
  --sun: #f2cf63;
  --navy: #0c2a4d;         /* logo navy */
  --blue: #1d6fc4;         /* logo electric blue */
  --cyan: #34c5e2;         /* logo cyan spark */
  --ocean: #1d6fc4;        /* primary accent = brand blue */
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 40px rgba(8, 22, 41, 0.20);
  --shadow-soft: 0 10px 24px rgba(8, 22, 41, 0.13);
}

/* Map panel theme toggle */
body.dark-mode {
  --ink: #f3f7ff;
  --ink-soft: rgba(243, 247, 255, 0.72);
  --sand: #0a1626;
  --white: #0a1626;
  --glass: rgba(13, 28, 48, 0.72);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", sans-serif;
  background-color: #ffffff;
  /* subtle global texture */
  background:
    radial-gradient(circle at 10% 10%, rgba(29, 111, 196, 0.08), transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(52, 197, 226, 0.09), transparent 38%),
    radial-gradient(circle at 60% 90%, rgba(12, 42, 77, 0.06), transparent 35%),
    #ffffff;
  color: var(--ink);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
}

html {
  scroll-behavior: smooth;
  /* keep anchored sections clear of the fixed header */
  scroll-padding-top: 84px;
}

main, #homeScreen {
  position: relative;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

h1, h2, h3 {
  font-family: "Fraunces", serif;
  margin: 0 0 12px 0;
}

p {
  margin: 0 0 16px 0;
  color: var(--ink-soft);
}

/* NAVIGATION */
nav {
  /* glassy, professional navbar */
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  padding: 14px 44px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 26px;

  font-size: 15px;
  position: fixed;
  z-index: 200;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;

  border-bottom: 1px solid rgba(16, 19, 26, 0.08);

  /* subtle lift */
  box-shadow: 0 8px 26px rgba(13, 23, 32, 0.06);
}

nav::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 0 0 18px 18px;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
  position: relative;
  padding: 10px 6px;
  opacity: 0.92;
}

/* Home link — house icon + label, sits with the primary nav actions */
nav a.nav-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

nav a.nav-home svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

nav a::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ocean), rgba(29, 111, 196,0.15));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

nav a:hover {
  color: var(--ocean);
  opacity: 1;
  transform: translateY(-1px);
}

nav a:hover::after {
  transform: scaleX(1);
}

/* Login is the primary nav action — render it as a brand pill */
nav a#navLogin {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  opacity: 1;
  box-shadow: 0 6px 16px rgba(29, 111, 196, 0.32);
}

nav a#navLogin::after {
  display: none;
}

nav a#navLogin:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(29, 111, 196, 0.42);
}

.text-logo {
  position: fixed;
  top: 16px;
  left: 44px;
  z-index: 201;

  /* logo container should never paint its own background */
  background: transparent;
  color: var(--ink);

  /* keep it crisp over glass nav */
  text-shadow: 0 1px 0 rgba(255,255,255,0.75);
}

/* Brand image (full Evasta wordmark) */
.brand-logo {
  display: block;
  height: 56px;              /* bigger + clearer */
  width: auto;
  object-fit: contain;

  /* keep logo crisp */
  background: transparent;
  border: none;

  /* slight contrast lift for white/near-white marks on glassy nav */
  filter: saturate(1.05) contrast(1.08);

  /* drop the logo's white background over the glass nav */
  mix-blend-mode: multiply;
}

/* SCREEN HANDLING
   Avoid display:none toggling to prevent transition glitches.
*/
.screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.5s ease, visibility 0.5s ease;
  position: relative;
  inset: auto;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Collapse inactive screens so hidden full-height auth screens don't add
   blank scroll space below the active screen. */
.screen:not(.active) {
  height: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* LANDING */
.landing {
  position: relative;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
}

/* Ensure text remains readable on the dark Evasta landing gradient */
.landing p,
.landing .hero-eyebrow,
.landing .hero-title,
.landing h1,
.landing h2,
.landing h3,
.landing .section-eyebrow {
  color: rgba(255, 255, 255, 0.92);
}

.landing .hero-eyebrow,
.landing .section-eyebrow {
  color: var(--cyan);
}

.landing .hero-lede {
  color: rgba(255, 255, 255, 0.94);
}

/* Hero stat cards have a light surface — keep their labels dark and legible */
.landing .stat-label {
  color: var(--ink-soft) !important;
}

/* Cards/containers already have their own light backgrounds; keep their text dark */
.landing .value-card,
.landing .chart-panel,
.landing .insight-card,
.landing .split-panel {
  color: var(--ink);
}

/* Force dark headings over light/white card surfaces within the landing area */
.landing .value-card h3,
.landing .value-card .stat-value,
.landing .chart-panel h3,
.landing .chart-panel h2,
.landing .chart-panel h1,
.landing .insight-card h3,
.landing .split-panel strong {
  color: var(--ink) !important;
}

.landing .value-card p,
.landing .chart-panel p,
.landing .insight-card p,
.landing .split-panel span {
  color: var(--ink-soft) !important;
}

.landing .value-card .stat-label,
.landing .chart-panel .chart-header p {
  color: var(--ink-soft) !important;
}

.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, #07182e 0%, #0c2a4d 42%, #14579f 78%, #1d6fc4 100%);
  z-index: 0;
  opacity: 0.97;
}

.landing::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 82% 12%, rgba(52, 197, 226, 0.22), transparent 42%),
    repeating-linear-gradient(
      130deg,
      rgba(255, 255, 255, 0.06) 0 12px,
      transparent 12px 24px
    );
  opacity: 0.7;
  z-index: 0;
}

.hero,
.section-shell {
  position: relative;
  z-index: 1;
}

.hero {
  /* Remove forced viewport height to prevent large blank space under the CTA */
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  padding: 116px 80px 64px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 600px;
  animation: fadeSlide 0.9s ease both;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  color: var(--ocean);
  font-size: 12px;
}

.hero-title {
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
}

.hero-lede {
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  max-width: 560px;
}

/* Stat cards relocated into the hero left column (beside the pie chart) */
.hero-stat-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 0;
}

.hero-stat-row .stat-card {
  padding: 18px 14px;
}

.hero-stat-row .stat-value {
  font-size: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  border-color: rgba(16, 19, 26, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin-top: 10px;
}

.hero-metrics h3 {
  font-size: 22px;
}

.hero-visual {
  display: block;
  width: 100%;
  animation: floatIn 1s ease both;
}

/* Hero network-share card — fills the right column and balances the hero */
.hero-network-card {
  margin: 0 0 0 auto;
  width: 100%;
  max-width: 820px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 19, 26, 0.08);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-network-card__title {
  font-family: "Fraunces", serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.2px;
}

.hero-network-card__body {
  display: grid;
  grid-template-columns: minmax(150px, 0.82fr) minmax(0, 1.5fr);
  gap: 18px;
  align-items: center;
}

.hero-chart-area {
  position: relative;
  width: 100%;
  min-height: 420px;
  aspect-ratio: 1 / 1;
}


.hero-chart-area canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Loader overlays the chart area instead of pushing layout */
.hero-chart-area .chart-loader {
  position: absolute;
  inset: 0;
  border-radius: 16px;
}

.device-stack {
  position: relative;
  width: min(420px, 90%);
}

.device-tablet {
  width: 100%;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.device-phone {
  position: absolute;
  width: 36%;
  bottom: -18%;
  right: -6%;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.hero-card {
  background: var(--white);
  padding: 20px 22px;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  width: min(360px, 90%);
}

.hero-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hero-card li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(16, 19, 26, 0.08);
  font-size: 15px;
}

.hero-card li:last-child {
  border-bottom: none;
}

.card-label {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1.6px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.status {
  color: var(--ocean);
  font-weight: 600;
}

.section-shell {
  padding: 30px 80px 0;
}

.section-heading {
  max-width: 720px;
}

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ocean);
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.value-login-note {
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transform: translateY(-4px);
  transition: opacity 0.2s ease, max-height 0.2s ease, transform 0.2s ease, margin-top 0.2s ease;
}

.value-login-note.show {
  margin-top: 10px;
  max-height: 40px;
  opacity: 1;
  transform: translateY(0);
}

.value-card {
  background: rgba(255, 255, 255, 0.94);
  padding: 22px;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  min-height: 170px;
  transform: translateY(0);
  animation: fadeSlide 1s ease forwards;
  border: 1px solid rgba(16, 19, 26, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.value-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(29, 111, 196,0.18);
}

.value-card-link {
  border: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
  color: inherit;
  font: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.value-card-link:hover,
.value-card-link:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(16, 19, 26, 0.12);
  outline: none;
}

.value-grid.locked .value-card-link[data-target="ev-map"] {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
  box-shadow: var(--shadow-soft);
}

.value-card:nth-child(2) {
  animation-delay: 0.08s;
}

.value-card:nth-child(3) {
  animation-delay: 0.16s;
}

.value-card:nth-child(4) {
  animation-delay: 0.24s;
}

.feature-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  align-items: center;
}

.split-text p {
  max-width: 500px;
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-row span {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.95);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.split-panel {
  background: var(--white);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.split-panel ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}

.split-panel li {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(16, 19, 26, 0.08);
}

.split-panel li:last-child {
  border-bottom: none;
}

.insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding-bottom: 0;
}

.insight-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  padding: 24px;
  border: 1px solid rgba(8, 22, 41, 0.08);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.insight-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(29, 111, 196, 0.22);
}

/* Landing CTA (reduce bottom whitespace on home screen) */
.cta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: center;
  padding-bottom: 0;
  margin-bottom: 0;
}

#mailing-list.cta,
#mailing-list.section-shell.cta {
  padding-bottom: 0;
  margin-bottom: 0;
}

.cta-content h2 {
  font-size: clamp(28px, 4vw, 46px);
}

.cta-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.cta-form input {
  flex: 1 1 240px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(16, 19, 26, 0.2);
  font-size: 16px;
}

.cta-form button {
  padding: 14px 22px;
  border-radius: 12px;
  border: none;
  background: var(--ocean);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* AUTH SCREENS */
.auth-screen {
  background: linear-gradient(140deg, #07182e 0%, #0c2a4d 45%, #14579f 80%, #1d6fc4 100%);
  background-size: cover;
  background-position: center;
  height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 15%, rgba(52, 197, 226, 0.22), transparent 45%),
    rgba(7, 24, 46, 0.35);
}

.auth-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.92);
  padding: 40px 35px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-align: left;
  margin: 50px auto 0 auto;
}

.auth-box h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 25px;
  color: var(--ink);
}

.auth-box label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.auth-box input, .auth-box select {
  width: 100%;
  padding: 14px;
  margin: 10px 0 18px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
}

.auth-box button {
  width: 100%;
  padding: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 17px;
}

.signup-btn {
  width: 60%;
  margin: 0 auto;
  display: block;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
}

.auth-links {
  margin-top: 15px;
  font-size: 14px;
}

.auth-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  display: block;
  margin-top: 10px;
}

/* MAP SCREEN */
#mapScreen {
  display: flex;
  min-height: calc(100vh - 60px);
  width: 100%;
  background: #ffffff;
}

#sidebar {
  width: 300px;
  height: 100vh;
  min-height: 100vh;
  background-color: #ffffff;
  border-right: 1px solid #ddd;
  padding-top: 80px;
  padding-left: 20px;
  padding-right: 20px;
  overflow-y: auto;
}

/* FAST CHARGERS MAP TEST PAGE - STATION LIST PANEL */
#stationsPanel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 320px;
  background: #ffffff;
  border-right: 1px solid #ddd;
  z-index: 1200;
  overflow-y: auto;
  padding: 80px 16px 16px 16px;
  box-sizing: border-box;
}

#stationsPanel h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

#stationsList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.station-list-item {
  border: 1px solid rgba(16, 19, 26, 0.10);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.station-list-item:hover,
.station-list-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(29, 111, 196,0.35);
  box-shadow: var(--shadow-soft);
  outline: none;
}

.station-name {
  font-weight: 800;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 6px;
  line-height: 1.25;
}

.station-meta {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.35;
}

.station-empty {
  color: var(--ink-soft);
  font-size: 13px;
  font-style: italic;
  padding: 12px 0;
}

#sidebar h2 {
  margin-top: 40px;
  font-size: 20px;
}

#parkDropdown {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  font-size: 16px;
}

#parkInfo {
  font-size: 14px;
  line-height: 1.4;
}

#map {
  flex: 1;
  position: relative;
}

#mapControls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 12px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 30px;
  padding: 10px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.control-btn {
  background: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  text-align: center;
  line-height: 40px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* POPUP */
.popup {
  width: 350px;
  max-width: 90vw;
  padding: 12px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  overflow: hidden;
}

.popup-img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  margin-top: 8px;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1100px) {
  .hero,
  .feature-split,
  .cta {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 104px 50px 48px;
    gap: 36px;
  }

  /* Center and cap the network card once the hero stacks */
  .hero-visual {
    display: flex;
    justify-content: center;
  }

  .hero-network-card {
    margin: 0 auto;
    max-width: 560px;
  }

  .section-shell {
    padding: 50px 50px 16px;
  }
}

/* Stack the hero network card (chart above legend) on small screens */
@media (max-width: 560px) {
  .hero-network-card {
    padding: 18px 16px 20px;
    border-radius: 20px;
    gap: 14px;
  }

  .hero-network-card__title {
    font-size: 17px;
  }

  .hero-network-card__body {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hero-chart-area {
    order: 1;
    max-width: 280px;
    width: 100%;
    margin: 0 auto;
    min-height: 240px;
  }

  .hero-legend {
    order: 2;
    gap: 11px;
  }

  .hero-legend .legend-item {
    font-size: 14px;
  }
}

@media (max-width: 900px) {
  nav {
    padding: 14px 24px;
  }

  .text-logo {
    left: 24px;
  }

  .brand-logo {
    height: 48px;
    width: auto;
  }

  /* Stack controls and make selects full width on small devices */
  .us-controls, .ca-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .us-field select, .ca-field select, select {
    min-width: 100% !important;
    width: 100% !important;
  }
  .btn, .ca-apply-btn, .ca-reset-btn {
    width: 100% !important;
  }
  .chart-wrap { min-height: 220px !important; }
  nav a.nav-home { display: none; }

  .hero {
    padding: 110px 30px 40px;
  }

  .section-shell {
    padding: 40px 30px 14px;
  }

  #mapScreen {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    padding-top: 20px;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }

  #map {
    height: 60vh;
  }
}

@media (max-width: 700px) {
  nav {
    justify-content: center;
    gap: 14px;
    padding: 12px 18px;
    flex-wrap: wrap;
  }

  nav a {
    padding: 8px 6px;
  }

  .text-logo {
    left: 18px;
  }

  .brand-logo {
    height: 44px;
    width: auto;
  }

  .hero-title {
    font-size: clamp(40px, 9vw, 62px);
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .auth-box {
    padding: 30px 25px;
    margin: 20px;
  }
}

@media (max-width: 600px) {
  /* Navbar: tighter, wrap-safe */
  nav {
    padding: 10px 14px;
    gap: 10px;
    align-items: center;
    min-height: 54px;
  }

  nav a {
    font-size: 14px;
    padding: 8px 5px;
    white-space: nowrap;
  }

  .text-logo {
    left: 10px;
    top: 12px;
  }

  .brand-logo {
    height: 40px;
    width: auto;
  }

  /* Ensure content doesn't feel cramped */
  .hero {
    padding: 96px 16px 28px;
  }

  .section-shell {
    padding: 30px 16px 18px;
  }

  /* Analytics: reduce padding */
  .stat-row {
    gap: 12px;
    margin: 18px 0 26px;
  }

  .stat-card {
    padding: 18px 12px;
  }

  .chart-panel {
    padding: 18px 14px;
  }

  .chart-header h3 {
    font-size: 18px;
  }

  /* Keep forms usable */
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-form {
    flex-direction: column;
    align-items: stretch;
  }

  .signup-btn {
    width: 70%;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 8px 10px;
    gap: 8px;
    min-height: 50px;
  }

  nav a {
    font-size: 13px;
    padding: 7px 4px;
  }

  .text-logo {
    left: 8px;
    top: 10px;
  }

  .brand-logo {
    height: 36px;
    width: auto;
  }

  .hero-stat-row {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .hero-title {
    font-size: clamp(34px, 11vw, 50px);
  }

  .stat-card {
    padding: 16px 10px;
  }

  .chart-panel {
    padding: 16px 12px;
  }

  .auth-box {
    padding: 20px 15px;
    margin: 10px;
  }

  .auth-box h1 {
    font-size: 24px;
  }
}

/* -------------------------------------------------------
   GLOBAL LOADING OVERLAY (covers whole screen)
------------------------------------------------------- */
.global-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;

  /* subtle branded wash behind the inner card */
  background-image:
    radial-gradient(circle at 20% 20%, rgba(29, 111, 196, 0.10), transparent 38%),
    radial-gradient(circle at 85% 25%, rgba(52, 197, 226, 0.11), transparent 40%),
    radial-gradient(circle at 55% 90%, rgba(12, 42, 77, 0.08), transparent 38%);
}

.global-loading-inner {
  width: min(520px, 92vw);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(16, 19, 26, 0.10);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px 22px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.global-loading-text {
  font-weight: 750;
  color: var(--ink-soft);
  letter-spacing: 0.2px;
}

.global-loading-overlay .chart-loader {
  /* override any min-height so the overlay looks compact */
  min-height: 0;
  height: auto;
  padding: 0;
}

/* Make all chart loaders look cleaner & more "product" like */
.chart-loader {
  text-align: center;
}

/* Replace the old ⚡ icon with a simple check-like glyph (still centered) */
.chart-loader::after {
  content: "";
  display: none;
}

/* Branded spinner ring (gradient) */
.chart-loader::before {
  border: 4px solid rgba(29, 111, 196, 0.14);
  border-top-color: var(--ocean);
  border-right-color: var(--cyan);
  border-left-color: rgba(29, 111, 196, 0.18);
  width: 44px;
  height: 44px;
}

/* Slightly softer animation to feel premium */
@keyframes evastaSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); opacity: 0.92; }
  to   { transform: translate(-50%, -50%) rotate(360deg); opacity: 1; }
}

/* -------------------------------------------------------
   ANALYTICS SECTIONS
------------------------------------------------------- */
.analytics-section {
  padding-top: 60px;
  padding-bottom: 14px;
}

.analytics-ca {
  background: rgba(52, 197, 226, 0.10);
}

/* Stat summary row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0 36px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 24px 20px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  border: 1px solid rgba(16, 19, 26, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(29, 111, 196,0.18);
}

.stat-value {
  font-family: "Fraunces", serif;
  font-size: 38px;
  font-weight: 700;
  color: var(--ocean);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Chart panels */
.chart-panel {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
  border: 1px solid rgba(16, 19, 26, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.chart-panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(29, 111, 196,0.16);
}

.chart-header {
  margin-bottom: 20px;
}

.chart-header h3 {
  font-size: 20px;
  margin-bottom: 6px;
}

.chart-header p {
  font-size: 14px;
  margin-bottom: 0;
}

.chart-controls {
  margin-bottom: 16px;
}

.chart-controls select {
  padding: 10px 14px;
  border: 1px solid rgba(16, 19, 26, 0.2);
  border-radius: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
  min-width: 240px;
}

.chart-wrap {
  position: relative;
}

.chart-wrap canvas {
  display: none;
}

.chart-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 100px;
  color: var(--ink-soft);
  font-size: 14px;
  font-style: italic;

  /* icon + spinner centered */
  position: relative;
  padding: 0 16px;
}

/* Branded spinner ring */
.chart-loader::before {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(29, 111, 196, 0.18);
  border-top-color: var(--ocean);
  animation: evastaSpin 1s linear infinite;

  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Icon in the middle (bolt-like spark) */
.chart-loader::after {
  content: "⚡";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -58%);
  font-size: 18px;
  color: var(--ocean);
  font-style: normal;
  font-weight: 700;
  z-index: 1;
}

@keyframes evastaSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Two-column layout for network chart */
.chart-two-col {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: center;
}

/* Make the donut card feel tighter/clearer */
.chart-wrap--donut {
  height: 300px !important;
}

/* Network legend */
.network-legend {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(16, 19, 26, 0.06);
  border-radius: 16px;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Each row: dot + name + count (+percent) aligned */
.legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

/* Smaller dot so rows don't look too spaced */
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Name should have stronger hierarchy */
.legend-name {
  color: var(--ink);
  font-weight: 650;

  /* Show the full network name (all characters), wrapping instead of truncating */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;

  /* dashed separator between term (name) and trailing percent/count */
  display: inline-block;
  width: 100%;

  /* Use a thinner, more "hyphen-like" dash and center under the text */
  border-bottom: 1px dashed rgba(29, 111, 196,0.22);
  padding-bottom: 2px;
  margin-bottom: 1px;
}

/* Count and percent kept close together to avoid confusion */
.legend-count {
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
  text-align: right;
}

.legend-count small {
  color: var(--ink-soft);
  font-size: 12px;
}

/* Reduce visual clutter: make legend rows breathe but not "far apart" */
.chart-two-col .network-legend .legend-item + .legend-item {
  margin-top: 2px;
}

/* Hero legend — flat (the card supplies the surface) and larger/airier */
.hero-legend {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  gap: 17px;
  max-height: 100%;
}

.hero-legend .legend-item {
  grid-template-columns: 16px 1fr auto;
  gap: 13px;
  font-size: 16.5px;

  /* Allow the middle column text to shrink/ellipsis */
  min-width: 0;
}

.hero-legend .legend-dot {
  width: 15px;
  height: 15px;
  box-shadow: 0 0 0 3px rgba(16, 19, 26, 0.05);
}

.hero-legend .legend-name {
  font-weight: 650;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;

  /* Keep legend labels professional: single line + ellipsis */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  /* Allow truncation within grid layout */
  min-width: 0;
}

.hero-legend .legend-count {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}

.hero-legend .legend-count small {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
}

/* Full-name tooltip — names are truncated with an ellipsis above, so
   hovering a legend row reveals the complete network name, clearly legible. */
.hero-legend .legend-item {
  position: relative;
}

.hero-legend .legend-item[data-fullname]::after {
  content: attr(data-fullname);
  position: absolute;
  left: 30px;
  bottom: calc(100% + 8px);
  z-index: 20;

  max-width: 320px;
  padding: 7px 11px;
  border-radius: 8px;

  background: var(--ink, #10131a);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  box-shadow: 0 6px 20px rgba(16, 19, 26, 0.22);

  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.hero-legend .legend-item[data-fullname]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* Card icon — branded gradient tile holding a line icon */
.card-icon {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 14px;
  color: var(--blue);
  background: linear-gradient(135deg, rgba(29, 111, 196, 0.12), rgba(52, 197, 226, 0.18));
  border: 1px solid rgba(29, 111, 196, 0.18);
}

.card-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

/* Analytics card hover always allowed (overrides locked state for non-map cards) */
.value-grid.locked .value-card-link[data-target="analytics"],
.value-grid.locked .value-card-link[data-target="california-analytics"] {
  cursor: pointer;
  opacity: 1;
}

.value-grid.locked .value-card-link[data-target="analytics"]:hover,
.value-grid.locked .value-card-link[data-target="california-analytics"]:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(16, 19, 26, 0.12);
}

/* Analytics responsive */
@media (max-width: 900px) {
  .chart-two-col {
    grid-template-columns: 1fr;
  }

  .chart-wrap--donut {
    max-width: 280px;
    margin: 0 auto;
  }

  /* Legend becomes tighter on narrower screens */
  .network-legend {
    padding: 12px 12px;
  }

  .legend-item {
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .stat-value {
    font-size: 30px;
  }

  .chart-panel {
    padding: 20px 16px;
  }

  .chart-controls select {
    min-width: unset;
    width: 100%;
  }

  /* Mobile: legend rows wrap nicely and keep percent aligned */
  .legend-item {
    grid-template-columns: 14px 1fr auto;
    gap: 8px;
  }

  .legend-count {
    font-size: 12.5px;
  }
}

/* -------------------------------------------------------
   FOOTER
------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 0;
  padding: 48px clamp(16px, 6vw, 80px) 28px;
  background: rgba(16, 19, 26, 0.97);
  color: rgba(255, 255, 255, 0.86);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 420px;
}

.footer-brand .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 64px;              /* bigger + clearer */
  height: 64px;
  border-radius: 16px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
}

.footer-brand .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.footer-name {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 26px;         /* bigger */
  color: #fff;
  margin-bottom: 4px;
}

.footer-tagline {
  margin: 0;
  font-size: 16px;         /* bigger + more legible */
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.5;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: color 0.18s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--mint);
  outline: none;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  max-width: 1200px;
  margin: 28px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 600px) {
  .site-footer {
    margin-top: 0;
    padding: 36px 18px 22px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: left;
  }
}
