/* ==========================================================================
   Opłacalność paliwa w Polsce - arkusz stylów
   ========================================================================== */

:root {
  --bg: #0b1020;
  --bg-soft: #121a2e;
  --card: #151e33;
  --card-hi: #1b2740;
  --border: #253352;
  --text: #e8edf7;
  --text-dim: #93a1bd;
  --text-faint: #6b7a99;

  --fuel: #f97316;
  --diesel: #22d3ee;
  --lpg: #a78bfa;
  --brent: #f43f5e;
  --wage-avg: #34d399;
  --wage-min: #fbbf24;
  --fx-usd: #60a5fa;
  --fx-eur: #c084fc;
  --index: #facc15;

  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a { color: #7dd3fc; }

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 22px 60px;
}

/* ---------- nagłówek ---------- */
header.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

header.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 3.2vw, 34px);
  letter-spacing: -.02em;
  background: linear-gradient(92deg, #ffd28a, #f97316 45%, #38bdf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

header.hero .sub {
  margin: 0;
  color: var(--text-dim);
  max-width: 78ch;
}

.head-right { text-align: right; }
.head-right .stamp { font-size: 13px; color: var(--text-faint); }
.head-right .stamp b { color: var(--text-dim); font-weight: 600; }

button.btn {
  margin-top: 10px;
  background: var(--card-hi);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
button.btn:hover { background: #22314f; border-color: #3b4d75; }
button.btn:active { transform: translateY(1px); }
button.btn[disabled] { opacity: .55; cursor: progress; }

/* ---------- kafelki KPI ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
  margin: 22px 0 8px;
}

.kpi {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent, var(--border));
}
.kpi .k-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.kpi .k-value {
  font-size: 25px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.kpi .k-value small { font-size: 13px; font-weight: 500; color: var(--text-dim); margin-left: 3px; }
.kpi .k-foot { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.kpi .k-foot .up { color: var(--bad); }
.kpi .k-foot .down { color: var(--ok); }

/* ---------- pasek sterowania ---------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 14px;
  padding: 10px 12px;
  background: rgba(11, 16, 32, .86);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.seg { display: inline-flex; background: var(--card-hi); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  background: none;
  border: 0;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  padding: 6px 13px;
  border-radius: 7px;
  cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: #2b3d61; color: #fff; }

.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-dim); cursor: pointer; }
.toggle input { accent-color: var(--fuel); width: 15px; height: 15px; }

/* ---------- wykresy ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 2px;
  font-size: 17px;
  letter-spacing: -.01em;
}
.card .hint { margin: 0 0 10px; font-size: 13px; color: var(--text-faint); }
.chart { width: 100%; height: 420px; }
.chart.tall { height: 470px; }
.chart.short { height: 320px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: 20px;
}

/* ---------- sekcja pytań i odpowiedzi ---------- */
.card h3 {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 7px;
}
.card h3:first-of-type { margin-top: 14px; }

#faq p {
  margin: 0 0 6px;
  max-width: 84ch;
  color: #cfd8ea;
  font-size: 14px;
}
#faq h3 { border-left: 3px solid var(--fuel); padding-left: 10px; }

/* ---------- tabele i listy ---------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th, table.data td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.data th { color: var(--text-faint); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-hi);
  color: var(--text-dim);
}

.notes { color: var(--text-dim); font-size: 13.5px; }
.notes ul { margin: 8px 0 0; padding-left: 20px; }
.notes li { margin-bottom: 5px; }
.notes code { background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }

.banner {
  display: none;
  margin: 16px 0;
  padding: 12px 15px;
  border-radius: 11px;
  font-size: 14px;
  border: 1px solid;
}
.banner.show { display: block; }
.banner.warn { background: rgba(251, 191, 36, .09); border-color: rgba(251, 191, 36, .4); color: #fde68a; }
.banner.bad { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .45); color: #fecaca; }

footer.foot {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 12.5px;
}

footer.foot .copyright {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 13px;
}
footer.foot .copyright strong { color: var(--text); font-weight: 600; }

footer.foot .legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 16px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
footer.foot .legal-links a {
  text-decoration: none;
  color: var(--text-dim);
}
footer.foot .legal-links a:hover { color: var(--text); text-decoration: underline; }

/* Atrybucja źródeł danych w stopce */
footer.foot .attribution {
  margin: 16px 0 0;
  padding: 13px 15px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.6;
}
footer.foot .attribution p { margin: 0 0 8px; }
footer.foot .attribution p:last-child { margin-bottom: 0; }
footer.foot .attribution strong { color: var(--text-dim); font-weight: 600; }
footer.foot .attribution ul {
  margin: 0 0 8px;
  padding-left: 18px;
  columns: 2;
  column-gap: 26px;
}
footer.foot .attribution li { margin-bottom: 5px; break-inside: avoid; }
footer.foot .attribution .small { color: var(--text-faint); font-size: 12px; }

@media (max-width: 720px) {
  footer.foot .attribution ul { columns: 1; }
}

@media (max-width: 640px) {
  .wrap { padding: 18px 13px 40px; }
  .chart { height: 340px; }
  .head-right { text-align: left; }
}

/* ==========================================================================
   Strony z dokumentami prawnymi (regulamin, polityka prywatności, cookies)
   ========================================================================== */

.doc { max-width: 900px; }

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.doc-nav a { text-decoration: none; }
.doc-nav a:hover { text-decoration: underline; }
.doc-nav .spacer { flex: 1; }
.doc-nav .sep { color: var(--text-faint); }
.doc-nav .current { color: var(--text); font-weight: 600; }

.doc article h1 {
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: -.02em;
  margin: 0 0 6px;
}
.doc article h2 {
  font-size: 19px;
  margin: 34px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.doc article h3 { font-size: 16px; margin: 22px 0 8px; }
.doc article p, .doc article li { color: #cfd8ea; }
.doc article ul, .doc article ol { padding-left: 22px; }
.doc article li { margin-bottom: 6px; }
.doc article strong { color: var(--text); }

.doc-meta {
  color: var(--text-faint);
  font-size: 13px;
  margin: 0 0 4px;
}

.doc .lead {
  font-size: 16px;
  color: var(--text-dim);
  border-left: 3px solid var(--fuel);
  padding: 4px 0 4px 14px;
  margin: 20px 0 26px;
}

.doc table.data td, .doc table.data th { vertical-align: top; }

.doc .callout {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ok);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 20px 0;
  font-size: 14px;
}
.doc .callout p:first-child { margin-top: 0; }
.doc .callout p:last-child { margin-bottom: 0; }

.doc footer.foot { margin-top: 44px; }
.doc footer.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 10px;
}
