html {
  font-size: 1em;
  line-height: 1.4;
}

/* Match text-selection highlight to the color scheme */
::-moz-selection {
  background: var(--color-primary-light);
  text-shadow: none;
}

::selection {
  background: var(--color-primary-light);
  text-shadow: none;
}

img {
  vertical-align: middle;
}

:root {
  --color-bg: #fafafa;
  --color-text: #1f2430;
  --color-primary: #ef0000;
  --color-primary-light: #fde8e8;
  --color-card-bg: #ffffff;
  --color-border: #e3e6ea;
  --color-text-muted: #4a5261;
  --color-text-subtle: #8a90a0;
  --color-text-soft: #5a6170;
  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.04);
  --color-brand: #ef0000;
  --radius: 12px;
  color-scheme: light dark;
}

/* Native fallback: applies as long as no theme has been set via JS/localStorage */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]),
  html[data-theme="dark"] {
    --color-bg: #14171c;
    --color-text: #e7e9ee;
    --color-primary: #ff4d4d;
    --color-primary-light: rgba(255, 77, 77, 0.16);
    --color-card-bg: #1e222b;
    --color-border: #2b3039;
    --color-text-muted: #b7bcc7;
    --color-text-subtle: #8a90a0;
    --color-text-soft: #a3a9b6;
    --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

html[data-theme="dark"] {
  --color-bg: #14171c;
  --color-text: #e7e9ee;
  --color-primary: #ff4d4d;
  --color-primary-light: rgba(255, 77, 77, 0.16);
  --color-card-bg: #1e222b;
  --color-border: #2b3039;
  --color-text-muted: #b7bcc7;
  --color-text-subtle: #8a90a0;
  --color-text-soft: #a3a9b6;
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

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

.site-header {
  background: var(--color-brand);
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo img {
  border-radius: 50%;
  background: #fff;
}

.lang-switch {
  display: flex;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 0.2rem;
}

.lang-btn {
  background: transparent;
  border: 0;
  color: #fff;
  opacity: 0.75;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.lang-btn:hover {
  opacity: 1;
}

.lang-btn.active {
  background: #fff;
  color: var(--color-brand);
  opacity: 1;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  transition: background 0.15s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.28);
}

.theme-toggle .icon-moon {
  display: inline;
}

.theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: inline;
}

.hero {
  text-align: center;
  padding: 3rem 1.25rem 2rem;
}

.hero h1 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.hero .subtitle {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
}

.updated-at {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--color-text-subtle);
}

.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem auto 3rem;
}

.stat-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
}

.stat-label {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--color-text-soft);
}

.providers {
  padding-bottom: 3rem;
}

.providers h2 {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.provider-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  border-top: 4px solid var(--provider-color, var(--color-primary));
  box-shadow: var(--shadow-card);
}

.provider-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.provider-types {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.provider-type-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.provider-counts {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.provider-counts div {
  text-align: center;
}

.provider-counts strong {
  display: block;
  font-size: 1.2rem;
}

.site-footer {
  text-align: center;
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--color-text-subtle);
  font-size: 0.8rem;
}

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

/* ==========================================================================
   Print styles
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /* Don't annotate fragment or javascript: links with a URL */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
