/* ============================================================
   Oxigen.ro — design system
   Scala AQI (validată CVD all-pairs pe suprafață închisă):
   0 #2dd4bf · 1 #16a34a · 2 #fbbf24 · 3 #f97316 · 4 #dc2626 · 5 #a855f7
   ============================================================ */
:root {
  --ink: #0b2237;
  --ink-2: #3d5568;
  --muted: #64798a;
  --bg: #f2f7fa;
  --surface: #ffffff;
  --line: #dfe9f0;
  --accent: #0b72b5;
  --accent-ink: #085a90;
  --night: #0b1929;
  --night-2: #102338;
  --night-line: rgba(148, 197, 233, .14);
  --night-ink: #e8f2fa;
  --night-muted: #8fa9bd;

  /* scala AQI — varianta luminoasă (hartă, suprafețe închise) */
  --l0: #2dd4bf; --l1: #16a34a; --l2: #fbbf24; --l3: #f97316; --l4: #dc2626; --l5: #a855f7; --lx: #64748b;
  /* varianta text (chip pe suprafață albă) */
  --l0t: #0f766e; --l1t: #166534; --l2t: #92400e; --l3t: #9a3412; --l4t: #b91c1c; --l5t: #7e22ce; --lxt: #475569;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 34, 55, .05), 0 8px 24px -12px rgba(11, 34, 55, .18);
  --shadow-lift: 0 2px 4px rgba(11, 34, 55, .06), 0 18px 40px -16px rgba(11, 34, 55, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.015em; }
img, svg { max-width: 100%; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 22px; width: 100%; }

/* ---------------- header ---------------- */
.site-head {
  position: absolute; inset: 0 0 auto 0; z-index: 1000;
  background: linear-gradient(180deg, rgba(7, 17, 30, .82), rgba(7, 17, 30, 0));
}
.site-head.solid { position: static; background: var(--night); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--night-ink); font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.logo .mark { width: 34px; height: 34px; flex: none; }
.logo .tld { color: #67d1f0; }
.site-nav { display: flex; gap: 6px; }
.site-nav a {
  color: var(--night-ink); text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: 8px 14px; border-radius: 10px; transition: background .15s;
}
.site-nav a:hover { background: rgba(255, 255, 255, .12); }

/* ---------------- hero + hartă ---------------- */
.hero { position: relative; background: var(--night); color: var(--night-ink); overflow: hidden; }
.hero-map { position: relative; height: min(78vh, 720px); min-height: 480px; }
#map { position: absolute; inset: 0; background: var(--night); }
.hero-panel {
  position: absolute; z-index: 900; top: 86px; left: 22px;
  width: min(400px, calc(100vw - 44px));
  background: rgba(10, 24, 40, .78);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--night-line);
  border-radius: 20px; padding: 24px 26px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .55);
}
.hero-panel .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #7fd7c8; margin-bottom: 10px;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #2dd4bf; animation: pulse 2.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, .55); }
  70% { box-shadow: 0 0 0 9px rgba(45, 212, 191, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
}
.hero-panel h1 { margin: 0 0 6px; font-size: 1.72rem; font-weight: 800; }
.hero-panel .sub { margin: 0 0 18px; color: var(--night-muted); font-size: .95rem; }
.hero-stat { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.hero-stat .num { font-size: 3.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.hero-stat .unit { color: var(--night-muted); font-size: .85rem; font-weight: 600; }
.hero-note { color: var(--night-muted); font-size: .82rem; margin-top: 14px; }
.hero-note b { color: var(--night-ink); }

.search { position: relative; margin-top: 18px; }
.search input {
  width: 100%; padding: 12px 14px 12px 42px;
  background: rgba(255, 255, 255, .08); border: 1px solid var(--night-line);
  border-radius: 12px; color: var(--night-ink); font: inherit; font-size: .95rem; outline: none;
}
.search input::placeholder { color: var(--night-muted); }
.search input:focus { border-color: #3b82c4; background: rgba(255, 255, 255, .12); }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .55; pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 950;
  background: #12283f; border: 1px solid var(--night-line); border-radius: 12px;
  max-height: 240px; overflow: auto; display: none;
}
.search-results a {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px; color: var(--night-ink); text-decoration: none; font-size: .93rem;
}
.search-results a:hover, .search-results a.active { background: rgba(255, 255, 255, .08); }

/* legenda hărții */
.map-legend {
  position: absolute; z-index: 900; left: 22px; bottom: 76px;
  display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100vw - 44px);
}
.map-legend span {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(10, 24, 40, .8); backdrop-filter: blur(8px);
  border: 1px solid var(--night-line); border-radius: 999px;
  color: var(--night-ink); font-size: .74rem; font-weight: 600; padding: 5px 11px;
}
.map-legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* dot generic pe nivel */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.lvl-0 .dot, i.lvl-0 { background: var(--l0); } .lvl-1 .dot, i.lvl-1 { background: var(--l1); }
.lvl-2 .dot, i.lvl-2 { background: var(--l2); } .lvl-3 .dot, i.lvl-3 { background: var(--l3); }
.lvl-4 .dot, i.lvl-4 { background: var(--l4); } .lvl-5 .dot, i.lvl-5 { background: var(--l5); }
.lvl-x .dot, i.lvl-x { background: var(--lx); }

/* chip de nivel pe suprafață albă */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 700;
}
.chip .dot { width: 8px; height: 8px; }
.chip.lvl-0 { background: color-mix(in srgb, var(--l0) 16%, #fff); color: var(--l0t); }
.chip.lvl-1 { background: color-mix(in srgb, var(--l1) 15%, #fff); color: var(--l1t); }
.chip.lvl-2 { background: color-mix(in srgb, var(--l2) 20%, #fff); color: var(--l2t); }
.chip.lvl-3 { background: color-mix(in srgb, var(--l3) 16%, #fff); color: var(--l3t); }
.chip.lvl-4 { background: color-mix(in srgb, var(--l4) 13%, #fff); color: var(--l4t); }
.chip.lvl-5 { background: color-mix(in srgb, var(--l5) 14%, #fff); color: var(--l5t); }
.chip.lvl-x { background: #eef2f6; color: var(--lxt); }

/* tooltip Leaflet custom */
.leaflet-tooltip.ox-tip {
  background: #0e2135; border: 1px solid var(--night-line); border-radius: 12px;
  color: var(--night-ink); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5);
  padding: 10px 13px; line-height: 1.4;
}
.leaflet-tooltip.ox-tip::before { display: none; }
.ox-tip .t-name { font-weight: 800; font-size: .92rem; }
.ox-tip .t-city { color: var(--night-muted); font-size: .78rem; margin-bottom: 5px; }
.ox-tip .t-vals { font-size: .84rem; display: flex; gap: 10px; }
.ox-tip .t-vals b { font-weight: 800; }
.ox-tip .t-lvl { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; margin-top: 5px; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { background: rgba(10, 24, 40, .7) !important; color: var(--night-muted) !important; }
.leaflet-control-attribution a { color: #7fb6d9 !important; }
.leaflet-bar a { background: #12283f !important; color: var(--night-ink) !important; border-color: var(--night-line) !important; }
.hero-map .leaflet-bottom.leaflet-right { margin-bottom: 76px; } /* nu sub tile-urile de statistici */

/* ---------------- secțiuni conținut ---------------- */
section.band { padding: 52px 0 8px; }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.band-head h2 { margin: 0; font-size: 1.5rem; font-weight: 800; }
.band-head .hint { color: var(--muted); font-size: .88rem; }
.band-note { margin: 6px 0 0; color: var(--muted); font-size: .84rem; max-width: 620px; line-height: 1.5; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: -46px; position: relative; z-index: 500; }
.stat {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; border: 1px solid var(--line);
}
.stat .lbl { color: var(--muted); font-size: .8rem; font-weight: 600; margin-bottom: 6px; }
.stat .val { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .val small { font-size: .85rem; color: var(--muted); font-weight: 600; margin-left: 4px; }
.stat .cx { margin-top: 6px; }

/* carduri orașe */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card-link { text-decoration: none; color: inherit; display: block; }
.city-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; height: 100%;
  transition: transform .16s ease, box-shadow .16s ease;
}
.card-link:hover .city-card { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.city-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.city-card h3 { margin: 0; font-size: 1.06rem; font-weight: 800; }
.city-card .big { display: flex; align-items: baseline; gap: 7px; }
.city-card .big .v { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.city-card .big .u { color: var(--muted); font-size: .76rem; font-weight: 600; }
.city-card .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-top: 8px; }
.city-card.empty .big .v { color: var(--muted); font-size: 1.1rem; font-weight: 600; }

/* clasament orașe — un rând per oraș, bară pe nivel de calitate */
.rank { display: grid; gap: 8px; }
.rank-row {
  display: grid;
  grid-template-columns: 34px minmax(140px, 1.3fr) minmax(90px, 3fr) minmax(96px, auto);
  align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 18px; box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: transform .14s ease, box-shadow .14s ease;
}
.rank-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.rank-num { color: var(--muted); font-size: .84rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.rank-city { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rank-city .dot { flex: none; }
.rank-name { font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { color: var(--muted); font-size: .76rem; white-space: nowrap; flex: none; }
/* bară de calitate: plină = aer curat, scurtă = poluat. Culoare = nivel. */
.rank-bar { height: 11px; background: #e9eef3; border-radius: 999px; overflow: hidden; }
.rank-fill { display: block; height: 100%; border-radius: 999px; min-width: 6px; transition: width .35s ease; }
.rank-fill.lvl-0 { background: var(--l0); } .rank-fill.lvl-1 { background: var(--l1); }
.rank-fill.lvl-2 { background: var(--l2); } .rank-fill.lvl-3 { background: var(--l3); }
.rank-fill.lvl-4 { background: var(--l4); } .rank-fill.lvl-5 { background: var(--l5); }
.rank-val { text-align: right; white-space: nowrap; }
.rank-score { font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rank-score i { font-style: normal; font-weight: 600; font-size: .7rem; color: var(--muted); margin-left: 1px; }
.rank-val small { display: block; color: var(--muted); font-weight: 600; font-size: .68rem; letter-spacing: .01em; margin-top: 1px; }
.rank-row.empty { opacity: .66; }
.rank-row.empty .rank-bar { background: #f1f4f7; }
.rank-nodata { color: var(--muted); font-weight: 600; font-size: .82rem; }
@media (max-width: 620px) {
  .rank-row { grid-template-columns: 22px 1fr auto; gap: 10px; padding: 11px 14px 12px; row-gap: 8px; }
  .rank-sub { display: none; }
  .rank-bar { grid-column: 1 / -1; order: 3; }
  .rank-val { font-size: .98rem; }
}

/* explainer */
.explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.explain .ex {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.explain h3 { margin: 0 0 8px; font-size: 1.02rem; }
.explain p { margin: 0; color: var(--ink-2); font-size: .9rem; }

/* ---------------- pagini oraș / stație ---------------- */
.page-head { padding: 40px 0 26px; background: var(--night); color: var(--night-ink); }
.page-head .crumbs { font-size: .82rem; color: var(--night-muted); margin-bottom: 10px; }
.page-head .crumbs a { color: #7fb6d9; text-decoration: none; }
.page-head h1 { margin: 0 0 8px; font-size: 1.9rem; font-weight: 800; }
.page-head .meta { color: var(--night-muted); font-size: .88rem; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

.duo { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; margin-top: 22px; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.panel h2 { margin: 0 0 14px; font-size: 1.1rem; }
.mini-map { min-height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); position: relative; background: var(--night); }
.mini-map .lmap { position: absolute; inset: 0; }

.hero-city { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-city .num { font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.hero-city .lblu { color: var(--muted); font-size: .82rem; font-weight: 600; }

/* tile-uri poluanți */
.params-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ptile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; position: relative; overflow: hidden;
}
.ptile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pt, var(--line)); }
.ptile .p-name { font-weight: 800; font-size: .92rem; }
.ptile .p-desc { color: var(--muted); font-size: .74rem; margin-bottom: 8px; }
.ptile .p-val { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.ptile .p-val small { font-size: .74rem; color: var(--muted); font-weight: 600; margin-left: 4px; }
.ptile .p-ts { color: var(--muted); font-size: .76rem; margin-top: 4px; }
.ptile .spark { display: block; margin-top: 10px; width: 100%; height: auto; }
.ptile.pt-0 { --pt: var(--l0); color: var(--l0t); } .ptile.pt-1 { --pt: var(--l1); color: var(--l1t); }
.ptile.pt-2 { --pt: var(--l2); color: var(--l2t); } .ptile.pt-3 { --pt: var(--l3); color: var(--l3t); }
.ptile.pt-4 { --pt: var(--l4); color: var(--l4t); } .ptile.pt-5 { --pt: var(--l5); color: var(--l5t); }
.ptile.pt-n { --pt: var(--accent); color: var(--accent-ink); }
.ptile.pt-x { --pt: var(--lx); color: var(--lxt); }
.ptile .p-name, .ptile .p-val { color: var(--ink); }

/* stații în oraș */
.station-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px 18px; text-decoration: none; color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.station-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.station-row .s-name { font-weight: 800; font-size: .98rem; }
.station-row .s-city { color: var(--muted); font-size: .8rem; }
.station-row .s-vals { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pv { background: #f0f5f9; border-radius: 8px; padding: 3px 9px; font-size: .8rem; color: var(--ink-2); }
.pv b { color: var(--ink); }
.stack { display: grid; gap: 10px; }

/* butoane */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  padding: 11px 20px; border-radius: 12px; font: inherit; font-weight: 700; font-size: .92rem;
  text-decoration: none; transition: background .15s, transform .12s;
}
.btn:hover { background: var(--accent-ink); transform: translateY(-1px); }
.btn.ghost { background: #e8f0f6; color: var(--accent-ink); }
.btn.ghost:hover { background: #dbe8f2; }

/* filtre sortare */
.seg { display: inline-flex; background: #e8eff5; border-radius: 11px; padding: 3px; }
.seg button {
  border: none; background: transparent; cursor: pointer; font: inherit;
  font-size: .82rem; font-weight: 700; color: var(--ink-2); padding: 7px 14px; border-radius: 9px;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(11, 34, 55, .12); }

/* admin & forms */
.form input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; margin-bottom: 12px; background: #fff;
}
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl td, .tbl th { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }

/* footer — lipit de fundul paginii (body flex), fără alb dedesubt */
.site-foot {
  background: var(--night); color: var(--night-muted);
  margin-top: auto; padding: 26px 0 24px; font-size: .8rem; line-height: 1.7;
  border-top: 1px solid var(--night-line);
  position: relative;
}
.site-foot::before {
  content: ''; position: absolute; top: -1px; left: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, .45), transparent);
}
.site-foot .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.site-foot a { color: #9cc3de; text-decoration: none; }
.site-foot a:hover { color: var(--night-ink); text-decoration: underline; }
.site-foot .f-brand { display: flex; align-items: center; gap: 10px; }
.site-foot .f-brand svg { width: 26px; height: 26px; flex: none; opacity: .9; }
.site-foot .f-logo { color: var(--night-ink); font-weight: 800; font-size: .95rem; text-decoration: none; letter-spacing: -.01em; }
.site-foot .f-tag { font-size: .74rem; }
.site-foot .f-right { text-align: right; font-size: .76rem; }
.site-foot .f-sep { opacity: .45; margin: 0 6px; }
@media (max-width: 720px) {
  .site-foot .wrap { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-foot .f-right { text-align: left; }
}
/* spațiu de respiro înainte de footer pe paginile scurte */
.wrap:last-of-type { padding-bottom: 48px; }

/* responsive hero */
@media (max-width: 720px) {
  .site-head .wrap { padding-top: 12px; padding-bottom: 12px; }
  .logo { font-size: 1.1rem; }
  .logo .mark { width: 28px; height: 28px; }
  .site-nav a { padding: 6px 9px; font-size: .84rem; white-space: nowrap; }
  .hero-map { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .hero-panel { position: static; width: auto; margin: 68px 16px 12px; order: -1; }
  #map { position: relative; inset: auto; height: 52vh; min-height: 340px; }
  .map-legend { position: static; padding: 10px 16px 16px; order: 2; }
  .stats { margin-top: 16px; }
  .page-head h1 { font-size: 1.45rem; }
}
