/* ============ Koszt kilometra — styles ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-1: #0e1116;
  --bg-2: #151a22;
  --panel: #1a212c;
  --panel-2: #202938;
  --line: #2b3648;
  --text: #e8eef7;
  --dim: #93a3b8;
  --lime: #b8f245;
  --amber: #ffb454;
  --cyan: #53d8fb;
  --red: #ff6b6b;
  --radius: 20px;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 400px at 85% -5%, #b8f24512, transparent 60%),
    radial-gradient(700px 400px at 0% 20%, #53d8fb0e, transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: clamp(18px, 4vw, 48px); }

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: clamp(8px, 3vh, 30px); max-width: 760px; margin: 0 auto; }
.kicker {
  display: inline-block;
  background: #b8f2451a;
  border: 1px solid #b8f24540;
  color: var(--lime);
  padding: 6px 16px; border-radius: 999px;
  font-weight: 500; font-size: 0.82rem; letter-spacing: 0.04em;
}
.hero h1 {
  margin-top: 18px;
  font-size: clamp(1.9rem, 5.5vw, 3.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
.hero h1 em { font-style: normal; color: var(--lime); }
.subtitle { margin-top: 14px; color: var(--dim); font-size: clamp(1rem, 2.3vw, 1.12rem); line-height: 1.55; }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 22px;
  margin-top: clamp(30px, 5vh, 50px);
  align-items: start;
}
@media (max-width: 880px) { .grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.panel h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 18px; }
.h2-costs { margin-top: 26px; }

/* ---------- fields ---------- */
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 440px) { .field-row { grid-template-columns: 1fr; gap: 0; } }
.label { display: block; font-size: 0.86rem; font-weight: 500; color: var(--dim); margin-bottom: 7px; }
.unit { color: #8b98ad; font-size: 0.8em; }
input[type="number"] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 500;
  padding: 11px 14px;
  transition: border-color 0.15s ease;
}
input[type="number"]:focus { outline: none; border-color: var(--lime); }
output { font-family: var(--mono); color: var(--lime); font-weight: 700; }

input[type="range"] {
  width: 100%; margin-top: 6px;
  accent-color: var(--lime);
  cursor: pointer;
}

/* segmented control */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
@media (max-width: 440px) { .seg { grid-template-columns: repeat(2, 1fr); } }
.seg-btn {
  font-family: inherit; font-size: 0.85rem; font-weight: 500;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--dim);
  border-radius: 10px;
  padding: 9px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: #b8f24518;
  border-color: var(--lime);
  color: var(--lime);
  font-weight: 700;
}

.btn {
  font-family: inherit; font-weight: 700; font-size: 0.95rem;
  border: none; border-radius: 12px; cursor: pointer;
  padding: 12px 22px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn.reset {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  width: 100%;
  margin-top: 8px;
}
.btn.reset:hover { color: var(--text); border-color: var(--dim); }
.btn.share {
  background: var(--lime);
  color: #10160a;
  width: 100%;
  margin-top: 20px;
  font-size: 1.02rem;
  box-shadow: 0 8px 28px #b8f24540;
}
.btn.share:hover { opacity: 0.92; transform: translateY(-1px); }

/* ---------- results ---------- */
.result-panel { position: sticky; top: 18px; }
@media (max-width: 880px) { .result-panel { position: static; } }

.big-result { text-align: center; padding: 8px 0 4px; }
.big-label { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--dim); }
.big-num {
  font-family: var(--mono);
  font-size: clamp(3.2rem, 9vw, 4.6rem);
  font-weight: 700;
  color: var(--lime);
  line-height: 1.05;
  margin-top: 6px;
  text-shadow: 0 0 40px #b8f24555;
}
.big-unit { font-size: 0.32em; color: var(--dim); margin-left: 8px; font-weight: 500; }
.big-sub { margin-top: 6px; color: var(--dim); font-size: 0.95rem; }
.big-sub strong { color: var(--amber); font-family: var(--mono); }

/* donut */
.donut-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 22px; }
.donut {
  width: 130px; height: 130px; border-radius: 50%; flex-shrink: 0;
  background-color: var(--panel-2); /* fallback, gdy conic-gradient niedostępny */
  background-image: conic-gradient(var(--amber) 0 33%, var(--cyan) 33% 66%, var(--lime) 66% 100%);
  position: relative;
}
.donut::after {
  content: '';
  position: absolute; inset: 26px;
  background: var(--panel);
  border-radius: 50%;
}
.donut-legend { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 9px; }
.donut-legend li { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; color: var(--dim); }
.donut-legend b { margin-left: auto; font-family: var(--mono); color: var(--text); font-size: 0.92rem; }
.donut-legend i { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.donut-legend .c1 { background: var(--amber); }
.donut-legend .c2 { background: var(--cyan); }
.donut-legend .c3 { background: var(--lime); }

/* cost cards */
.cost-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.cost-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 10px;
  text-align: center;
}
.cc-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); margin-bottom: 5px; }
.cost-card b { font-family: var(--mono); font-size: clamp(0.95rem, 2.4vw, 1.15rem); overflow-wrap: anywhere; }

/* compare */
.compare { margin-top: 24px; }
.compare h3 { font-size: 0.95rem; margin-bottom: 12px; color: var(--dim); font-weight: 500; }
.comp-item {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 0.92rem;
}
.comp-item b { font-family: var(--mono); white-space: nowrap; }
.comp-item b.good { color: var(--lime); }
.comp-item b.bad { color: var(--red); }

/* ---------- explain ---------- */
.explain { margin-top: clamp(50px, 8vh, 90px); }
.explain h2, .faq h2 { text-align: center; font-size: clamp(1.4rem, 3.6vw, 2rem); font-weight: 700; margin-bottom: 26px; }
.explain-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.ex-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.ex-emoji { font-size: 1.7rem; }
.ex-card h3 { font-size: 1.05rem; margin: 10px 0 8px; }
.ex-card p { color: var(--dim); font-size: 0.93rem; line-height: 1.6; }
.ex-card strong { color: var(--amber); }

/* ---------- FAQ ---------- */
.faq { margin-top: clamp(50px, 8vh, 90px); }
.faq details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 16px 20px;
  font-weight: 500; font-size: 0.98rem;
  list-style: none; position: relative; padding-right: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute; right: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--lime); font-size: 1.3rem; font-weight: 400;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 20px 18px; color: var(--dim); line-height: 1.65; font-size: 0.93rem; }

/* ---------- footer ---------- */
.footer {
  margin-top: clamp(50px, 8vh, 90px);
  text-align: center;
  color: var(--dim);
  font-size: 0.85rem;
  line-height: 1.8;
  padding-bottom: 30px;
  max-width: 720px;
  margin-left: auto; margin-right: auto;
}
.footer .muted { color: #74839b; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--lime); color: #10160a;
  padding: 13px 26px; border-radius: 999px;
  font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 50;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ==== dodatki SEO/a11y ==== */
.noscript-note { background: #fff3cd; color: #5a4500; padding: 12px 16px; border-radius: 10px; margin: 16px auto; max-width: 720px; font-size: 0.95rem; }
.more-tools { margin-top: 14px; font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.more-tools a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.more-tools a:hover { opacity: 0.75; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto !important; }
}
