/* MyCarWallet — tokens follow car_expense_app/lib/theme/app_theme.dart */
:root {
  --asphalt: #000000;
  --asphalt-2: #111111;
  --panel: #232323;
  --input: #343434;
  --line: #464646;
  --muted: #9a9a9a; /* app accentGray #7A7A7A lifted for 4.5:1 body contrast */
  --chalk: #ffffff;
  --trail: #5be585;
  --trail-dim: #1d4a2c;
  --warn: #ff5252; /* Colors.redAccent */
  --soon: #ff9800; /* Colors.orange */

  --font: "Be Vietnam Pro", system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: clamp(2rem, 4.5vw, 2.441rem);
  --step-hero: clamp(2.9rem, 8.4vw, 6.1rem);

  --radius-btn: 12px; /* app ElevatedButton */
  --radius-card: 16px; /* app CardTheme */
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--chalk);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--trail);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--trail);
  color: var(--asphalt);
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--chalk);
  color: var(--asphalt);
  border-radius: var(--radius-btn);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus {
  top: 16px;
}

/* Language: PL by default, EN when html[data-lang="en"] */
html:not([data-lang="en"]) [data-l="en"],
html[data-lang="en"] [data-l="pl"] {
  display: none !important;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Top bar (shared) ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(0 0 0 / 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgb(255 255 255 / 0.07);
}
.bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.brand b {
  color: var(--trail);
  font-weight: 800;
}

.bar nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 28px);
  font-size: var(--step--1);
}
.bar nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 2px;
  transition: color 0.2s;
}
.bar nav a:hover,
.bar nav a[aria-current="page"] {
  color: var(--chalk);
}
.bar nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--trail);
}

.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.lang button {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}
.lang button[aria-pressed="true"] {
  background: var(--chalk);
  color: var(--asphalt);
}

@media (max-width: 640px) {
  .bar .hide-sm {
    display: none;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px; /* app button height */
  padding: 0 26px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: var(--step-0);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.25s;
}
.btn-primary {
  background: var(--chalk);
  color: var(--asphalt);
}
.btn-primary:hover {
  box-shadow: 0 0 0 4px rgb(91 229 133 / 0.28), 0 10px 40px rgb(91 229 133 / 0.25);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-quiet {
  color: var(--chalk);
  border: 1px solid var(--line);
}
.btn-quiet:hover {
  border-color: var(--chalk);
}
.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(40px, 7vw, 96px) clamp(32px, 6vw, 80px);
  isolation: isolate;
  overflow-x: clip;
}
.hero::before {
  /* blurred app wallpaper feel: soft green haze behind the phone */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 78% 55%, rgb(91 229 133 / 0.16), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, rgb(255 90 90 / 0.06), transparent 70%);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}
.hero h1 {
  margin: 0 0 24px;
  font-size: var(--step-hero);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero h1 .line {
  display: block;
}
.hero .lede {
  margin: 0 0 36px;
  max-width: 34ch;
  font-size: var(--step-1);
  line-height: 1.5;
  color: #cfcfcf;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.fine {
  margin: 20px 0 0;
  font-size: var(--step--1);
  color: var(--muted);
}

.stage {
  position: relative;
  aspect-ratio: 941 / 1040;
  max-width: 560px;
  justify-self: end;
  width: 100%;
}
.stage img {
  width: 100%;
  border-radius: 28px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 12%, #000 84%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 12%, #000 84%, transparent);
  mask-composite: intersect;
}
.trail {
  position: absolute;
  inset: -6% -10% -4% -14%;
  width: 124%;
  height: 110%;
  pointer-events: none;
  overflow: visible;
}
.trail path {
  fill: none;
  stroke: var(--trail);
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.trail .glow {
  stroke-width: 12;
  opacity: 0.35;
  filter: blur(6px);
}
.trail .core {
  stroke-width: 2.5;
}
.motion .trail path {
  stroke-dashoffset: 1;
}
.motion .stage img {
  opacity: 0;
}

@media (max-width: 860px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    justify-self: center;
    max-width: 460px;
  }
}

/* ---------- Odometer track (signature section) ---------- */
.route {
  padding-block: clamp(56px, 9vw, 120px);
  border-top: 1px solid rgb(255 255 255 / 0.07);
}
.route-head {
  max-width: 40ch;
  margin-bottom: clamp(32px, 5vw, 64px);
}
.route-head h2,
.privacy h2 {
  margin: 0 0 14px;
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.route-head p,
.privacy .intro {
  margin: 0;
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.5;
}

.route-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2fr);
  gap: clamp(24px, 5vw, 72px);
}

.odo {
  position: sticky;
  top: 110px;
  align-self: start;
  padding: 24px;
  background: rgb(35 35 35 / 0.55);
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: var(--radius-card);
}
.odo-label {
  margin: 0;
  font-size: var(--step--1);
  color: var(--muted);
}
.odo-value {
  display: block;
  margin: 4px 0 18px;
  font-size: clamp(2.2rem, 4.2vw, 3rem);
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.odo-value small {
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 6px;
}
/* service bar, same shape as the app's Status serwisowy tiles */
.svc {
  height: 6px;
  border-radius: 99px;
  background: var(--input);
  overflow: hidden;
}
.svc i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--trail);
  transform-origin: left;
}
.js .svc i {
  transform: scaleX(0);
}
.svc-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.odo-note {
  margin: 18px 0 0;
  font-size: var(--step--1);
  color: var(--muted);
}
/* Same states as the app's service tiles: orange when close, red when due */
.odo {
  transition: border-color 0.3s, box-shadow 0.3s;
}
.odo-value,
.odo-note {
  transition: color 0.3s;
}
.svc i {
  transition: background-color 0.3s;
}
.odo-warn {
  display: none;
  width: 0.55em;
  height: 0.55em;
  margin-left: 8px;
  vertical-align: -0.02em;
}
.odo.soon .svc i {
  background: var(--soon);
}
.odo.soon .odo-note {
  color: var(--soon);
}
.odo.due {
  border-color: rgb(255 82 82 / 0.5);
  box-shadow: 0 0 18px 2px rgb(255 82 82 / 0.15);
}
.odo.due .svc i {
  background: var(--warn);
}
.odo.due .odo-value,
.odo.due .odo-note {
  color: var(--warn);
}
.odo.due .odo-value small {
  color: rgb(255 82 82 / 0.7);
}
.odo.due .odo-warn {
  display: inline-block;
}

.stops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(56px, 9vw, 112px);
}
.stop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
}
.stop:nth-child(even) .stop-img {
  order: 2;
}
.stop-img img {
  border-radius: var(--radius-card);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 12%, #000 84%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to bottom, transparent, #000 12%, #000 84%, transparent);
  mask-composite: intersect;
}
.km {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border: 1px solid var(--trail-dim);
  border-radius: 99px;
  color: var(--trail);
  font-size: var(--step--1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stop h3 {
  margin: 0 0 12px;
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.stop p {
  margin: 0;
  max-width: 38ch;
  color: #c4c4c4;
}

@media (max-width: 860px) {
  .odo.due .odo-note,
  .odo.soon .odo-note {
    display: block;
    grid-column: 1 / -1;
    margin-top: 8px;
  }
  .route-grid {
    grid-template-columns: 1fr;
  }
  .odo {
    top: 76px;
    z-index: 5;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 16px;
    background: rgb(17 17 17 / 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .odo-label,
  .odo-note {
    display: none;
  }
  .odo-value {
    margin: 0;
    font-size: 1.6rem;
  }
  .stop {
    grid-template-columns: 1fr;
  }
  .stop:nth-child(even) .stop-img {
    order: 0;
  }
  .stop-img {
    max-width: 440px;
  }
}

/* ---------- Privacy summary ---------- */
.privacy {
  padding-block: clamp(56px, 9vw, 120px);
  background: var(--asphalt-2);
  border-block: 1px solid rgb(255 255 255 / 0.07);
}
.privacy .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(28px, 6vw, 96px);
}
.facts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.facts li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.facts li:last-child {
  border-bottom: 1px solid var(--line);
}
.facts svg {
  width: 22px;
  height: 22px;
  margin-top: 3px;
  color: var(--trail);
}
.facts strong {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}
.facts span {
  color: var(--muted);
}
.docs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
@media (max-width: 860px) {
  .privacy .wrap {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer (shared) ---------- */
.foot {
  padding-block: 40px 48px;
  font-size: var(--step--1);
  color: var(--muted);
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
}
.foot a {
  color: var(--chalk);
  text-underline-offset: 3px;
}
.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Legal documents ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 3px;
  background: var(--trail);
  transform-origin: left;
  transform: scaleX(0);
}
.no-js .progress,
html:not(.js) .progress {
  display: none;
}

.doc-head {
  padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4vw, 48px);
}
.doc-head h1 {
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
  color: var(--muted);
  font-size: var(--step--1);
}
.doc-meta div {
  display: grid;
}
.doc-meta dt {
  font-size: 0.75rem;
}
.doc-meta dd {
  margin: 0;
  color: var(--chalk);
  font-weight: 500;
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 99px;
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 600;
}
.jump a:hover {
  border-color: var(--chalk);
}

.doc-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  padding-bottom: 96px;
}

.toc {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  font-size: var(--step--1);
  scrollbar-width: thin;
}
.toc details {
  margin-bottom: 16px;
}
.toc summary {
  cursor: pointer;
  font-weight: 700;
  padding: 6px 0;
  list-style: none;
}
.toc summary::-webkit-details-marker {
  display: none;
}
.toc summary::after {
  content: " +";
  color: var(--muted);
}
.toc details[open] summary::after {
  content: " –";
}
.toc ol {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--line);
}
.toc a {
  display: block;
  padding: 5px 0 5px 12px;
  margin-left: -13px;
  border-left: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.35;
}
.toc a:hover {
  color: var(--chalk);
}
.toc a.on {
  color: var(--chalk);
  border-left-color: var(--trail);
}

/* Content keeps its original markup; style by element, not by old utility classes */
.doc {
  max-width: 68ch;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #c9c9c9;
}
.doc .version {
  margin: 0 0 40px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  font-size: var(--step--1);
  color: var(--muted);
}
.doc .version p {
  margin: 0;
}
.doc .version span {
  color: var(--chalk);
  font-weight: 600;
}
.doc section {
  margin: 0;
}
.doc section#polish {
  margin-top: 40px;
  padding-top: 56px;
  border-top: 2px solid var(--chalk);
}
.doc h2 {
  margin: 0 0 18px;
  color: var(--chalk);
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.doc h3 {
  color: var(--chalk);
  font-size: var(--step-1);
  margin: 28px 0 10px;
}
.doc p {
  margin: 0 0 16px;
}
.doc ul,
.doc ol {
  margin: 0 0 16px;
  padding-left: 1.3em;
}
.doc ul {
  list-style: disc;
}
.doc li {
  margin-bottom: 8px;
}
.doc li::marker {
  color: var(--trail);
}
.doc strong {
  color: var(--chalk);
  font-weight: 600;
}
.doc em {
  color: var(--muted);
}
.doc a {
  color: var(--trail);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.doc .subtle-divider {
  height: 1px;
  margin: 44px 0;
  background: rgb(255 255 255 / 0.08);
}
.doc .table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.doc th,
.doc td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgb(255 255 255 / 0.07);
}
.doc th {
  color: var(--chalk);
  font-weight: 600;
  background: var(--panel);
}
.doc tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc {
    position: static;
    max-height: none;
    padding: 4px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-btn);
  }
  .toc details {
    margin: 6px 0;
  }
}
