@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #ffffff;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --card: #fff7f8;
  --accent: #c1121f;
  --accent-2: #0e9f6e;
  --text: #111111;
  --muted: rgba(17, 17, 17, 0.66);
  --border: rgba(193, 18, 31, 0.22);
  --shadow: 0 20px 40px rgba(100, 18, 26, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(193, 18, 31, 0.16), transparent 42%),
    radial-gradient(circle at 85% 20%, rgba(193, 18, 31, 0.1), transparent 36%),
    linear-gradient(180deg, #fff7f8 0%, #ffffff 48%, #fff1f3 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140" viewBox="0 0 140 140" fill="none"><path d="M0 70h140" stroke="rgba(193,18,31,0.06)"/><path d="M70 0v140" stroke="rgba(193,18,31,0.06)"/></svg>');
  opacity: 0.45;
  pointer-events: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1fr);
  gap: 36px;
  padding: 64px 8vw 48px;
  position: relative;
  z-index: 1;
}

.hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.1;
  margin-bottom: 18px;
}

.top-actions {
  position: fixed;
  top: 14px;
  right: max(14px, 2vw);
  z-index: 80;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.lang-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(193, 18, 31, 0.28);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  padding: 6px 10px;
  box-shadow: 0 8px 18px rgba(193, 18, 31, 0.16);
}

.lang-control span {
  font-size: 0.72rem;
  font-weight: 800;
  color: #8b0f1a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lang-select {
  border: 1px solid rgba(193, 18, 31, 0.3);
  background: #ffffff;
  color: #7a0e19;
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 700;
  min-width: 66px;
  outline: none;
}

.top-actions .ghost {
  background: #c1121f;
  color: #fff;
  border-color: #95101a;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(193, 18, 31, 0.22);
}

.top-actions .ghost:hover {
  transform: translateY(-1px);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 24px;
}

.zip-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.zip-form input {
  flex: 1 1 200px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  color: var(--text);
  font-size: 1rem;
}

.zip-form button {
  background: var(--accent);
  border: none;
  color: #ffffff;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 14px 28px rgba(193, 18, 31, 0.35);
}

.zip-form button:hover {
  transform: translateY(-2px);
}

.lookup-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mode-btn {
  border: 1px solid var(--border);
  background: #ffffff;
  color: #7f0f1a;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.mode-btn.is-active {
  background: #c1121f;
  border-color: #9f0f1a;
  color: #ffffff;
}

.map-lookup {
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 18px;
  padding: 12px;
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.map-canvas {
  width: 100%;
  height: 280px;
  border-radius: 14px;
  border: 1px solid rgba(193, 18, 31, 0.16);
  background: linear-gradient(160deg, #fff8f9, #ffffff);
}

.map-fallback {
  margin: 0;
  height: 100%;
  display: grid;
  place-items: center;
  color: #7f0f1a;
  font-size: 0.9rem;
  text-align: center;
  padding: 16px;
}

.map-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.map-controls label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.map-controls select {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.map-search-btn {
  align-self: stretch;
  border-radius: 12px;
}

.demo-zips {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}

.demo-zips button {
  background: #ffffff;
  color: #7a0e19;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.panel-card {
  background: var(--panel);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  width: min(100%, 620px);
  margin-left: auto;
}

.panel-card h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.social-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(193, 18, 31, 0.15);
}

.social-strip span {
  font-size: 0.85rem;
  color: #7a0e19;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-links a {
  text-decoration: none;
}

.social-ico {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c1121f;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid #9f0f1a;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.social-ico i {
  font-size: 0.95rem;
  line-height: 1;
  color: #ffffff !important;
  opacity: 1;
}

.social-links a:hover .social-ico {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(193, 18, 31, 0.28);
}

.panel-card p {
  color: var(--muted);
  margin-bottom: 18px;
}

.panel-metrics {
  list-style: none;
  display: grid;
  gap: 12px;
}

.panel-metrics strong {
  font-size: 1.4rem;
}

.panel-metrics span {
  color: var(--muted);
  font-size: 0.9rem;
}

.content {
  padding: 0 8vw 60px;
  display: grid;
  gap: 40px;
}

.search-results {
  background: var(--panel-strong);
  border-radius: 28px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.search-results.map-wait {
  padding: 18px;
}

.search-results.map-wait .empty-state {
  padding: 14px 8px;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.results-header h2 {
  font-size: 1.8rem;
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filters label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.filters select {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
}

.rep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: start;
}

.rep-card {
  background: var(--card);
  border-radius: 22px;
  padding: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(4, 9, 20, 0.5);
  display: grid;
  gap: 16px;
  align-self: start;
  position: relative;
  overflow: hidden;
}

.rep-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: rgba(148, 163, 184, 0.45);
}

.rep-card.party-dem {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.08);
}

.rep-card.party-dem::before {
  background: #1d4ed8;
}

.rep-card.party-rep {
  border-color: rgba(193, 18, 31, 0.28);
  box-shadow: 0 16px 34px rgba(193, 18, 31, 0.09);
}

.rep-card.party-rep::before {
  background: #c1121f;
}

.rep-card.party-dem .rep-link {
  color: #1d4ed8;
}

.rep-card.party-rep .rep-link {
  color: #9f0f1a;
}

.rep-header {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
}

.rep-header img {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
}

.rep-header h3 {
  font-size: 1.2rem;
}

.rep-detail-link {
  display: inline-flex;
  border-radius: 20px;
}

.rep-name-link {
  color: inherit;
  text-decoration: none;
}

.rep-name-link:hover {
  text-decoration: underline;
  text-decoration-color: #c1121f;
}

.rep-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.party-tag {
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 7px;
}

.party-tag.party-dem {
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.14);
}

.party-tag.party-rep {
  color: #9f0f1a;
  background: rgba(193, 18, 31, 0.14);
}

.rep-link {
  margin-top: 8px;
  display: inline-flex;
  text-decoration: none;
  color: #9f0f1a;
  font-size: 0.82rem;
  font-weight: 700;
}

.rep-link:hover {
  text-decoration: underline;
}

.vote-list {
  display: grid;
  gap: 12px;
}

.vote-item {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(193, 18, 31, 0.14);
}

.vote-item strong {
  font-size: 0.95rem;
}

.vote-link {
  color: inherit;
  text-decoration: none;
}

.vote-link:hover {
  text-decoration: underline;
  text-decoration-color: #c1121f;
}

.vote-item span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
}

.vote-context {
  margin-top: 8px;
  font-size: 0.86rem;
  line-height: 1.35;
  color: #4b0d13;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 159, 110, 0.12);
  color: var(--accent-2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-top: 6px;
}

.badge.negative {
  background: rgba(193, 18, 31, 0.12);
  color: var(--accent);
}

.compare-table {
  display: grid;
  gap: 12px;
}

.compare-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 12px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(193, 18, 31, 0.14);
}

.compare-row strong {
  font-size: 0.9rem;
}

.callout {
  background: linear-gradient(120deg, rgba(193, 18, 31, 0.1), rgba(255, 255, 255, 0.95));
  border-radius: 24px;
  padding: 26px;
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.callout h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.callout p {
  color: var(--muted);
}

.ghost {
  background: #ffffff;
  border: 1px solid var(--border);
  color: #7a0e19;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
}

.footer {
  padding: 36px 8vw 48px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.empty-state {
  text-align: center;
  display: grid;
  gap: 12px;
  padding: 40px 10px;
  border-radius: 18px;
}

.empty-state.warning {
  background: rgba(255, 193, 7, 0.14);
  border: 1px solid rgba(190, 126, 0, 0.34);
}

.empty-state.error {
  background: rgba(193, 18, 31, 0.09);
  border: 1px solid rgba(193, 18, 31, 0.36);
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 12, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 10, 14, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 90;
}

.loading-modal-card {
  width: min(460px, 100%);
  background: #ffffff;
  border: 1px solid rgba(193, 18, 31, 0.22);
  border-radius: 18px;
  box-shadow: 0 26px 50px rgba(16, 5, 8, 0.22);
  padding: 24px;
  text-align: center;
}

.loading-modal-card h3 {
  margin: 0 0 6px;
}

.loading-modal-card p {
  margin: 0;
  color: #5f2730;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid rgba(193, 18, 31, 0.2);
  border-top-color: #c1121f;
  animation: spin 0.8s linear infinite;
}

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

.modal-card {
  width: min(680px, 100%);
  background: #ffffff;
  border: 1px solid rgba(193, 18, 31, 0.2);
  border-radius: 18px;
  box-shadow: 0 26px 50px rgba(16, 5, 8, 0.2);
  padding: 22px;
  position: relative;
  display: grid;
  gap: 12px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  color: #8b0f1a;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.help-list {
  margin-left: 18px;
  color: #431217;
  font-size: 0.92rem;
  display: grid;
  gap: 4px;
}

.contact-form {
  display: grid;
  gap: 10px;
}

.contact-form label {
  display: grid;
  gap: 5px;
  font-size: 0.85rem;
  color: #5a1a1f;
}

.contact-form input,
.contact-form textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.contact-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.contact-actions button {
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 720px) {
  .hero {
    padding-top: 92px;
    grid-template-columns: 1fr;
  }

  .top-actions {
    top: 10px;
    right: 10px;
    left: auto;
  }

  .search-results {
    padding: 24px;
  }

  .rep-header {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .rep-header img {
    width: 84px;
    height: 84px;
  }

  .compare-row {
    grid-template-columns: 1fr;
  }

  .social-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-card {
    padding: 18px;
  }

  .map-controls {
    grid-template-columns: 1fr;
  }

  .map-canvas {
    height: 220px;
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 94px;
  }

  .top-actions {
    top: 10px;
    right: 10px;
  }

  .hero-panel {
    justify-content: stretch;
  }

  .panel-card {
    width: 100%;
  }

  .map-controls {
    grid-template-columns: 1fr;
  }
}
