/* Materio website — Olive Green Material 3 palette lifted straight from the app
   (core/designsystem/theme/Color.kt). Offline-first calculator & optimizer.
   Slogan: Policz. Kup. Nie marnuj. */

:root {
  --olive: #626b38;
  --olive-dark: #4d5d2a;
  --on-primary: #ffffff;
  --primary-container: #e7efb1;
  --on-primary-container: #1c2400;
  --secondary-container: #dfe6c4;
  --tertiary: #3a665e;
  --tertiary-container: #bdece1;
  --bg: #fbfaf3;
  --surface: #ffffff;
  --surface-alt: #f4f6ee;
  --surface-container: #efeee4;
  --on-bg: #1b1c16;
  --on-surface: #1b1c16;
  --muted: #5c5f52;
  --outline: #c7c8b7;
  --error: #ba1a1a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(27,28,22,.08), 0 6px 20px rgba(27,28,22,.06);
  --shadow-lg: 0 8px 40px rgba(27,28,22,.14);
  --maxw: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --olive: #cbd88a;
    --olive-dark: #b7c476;
    --on-primary: #313600;
    --primary-container: #464f16;
    --on-primary-container: #e2ef9d;
    --secondary-container: #424a2c;
    --tertiary: #a1d0c5;
    --tertiary-container: #214a43;
    --bg: #12140d;
    --surface: #1b1c16;
    --surface-alt: #22241b;
    --surface-container: #1f211a;
    --on-bg: #e4e3d7;
    --on-surface: #e4e3d7;
    --muted: #a9ab9b;
    --outline: #46483b;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
    --shadow-lg: 0 8px 40px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--on-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--olive-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Header / nav ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--outline);
}
.nav { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--on-bg); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--on-bg); padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav-links a:hover { background: var(--surface-alt); text-decoration: none; }
.lang-select {
  font: inherit; font-weight: 600; font-size: .9rem;
  color: var(--on-bg); background: var(--surface-alt);
  border: 1px solid var(--outline); border-radius: 999px;
  padding: 7px 10px; cursor: pointer;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--olive); color: var(--on-primary); box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: var(--shadow-lg); }
.btn-ghost { background: transparent; color: var(--on-bg); border-color: var(--outline); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--on-bg); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 68px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 15% 0%, color-mix(in srgb, var(--primary-container) 60%, transparent), transparent 70%),
    radial-gradient(50% 50% at 100% 15%, color-mix(in srgb, var(--tertiary-container) 55%, transparent), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--outline);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .85rem;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--olive); }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 44ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.trust { display: flex; flex-wrap: wrap; gap: 18px 26px; margin-top: 8px; }
.trust span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; color: var(--muted); }
.trust svg { color: var(--olive); flex: none; }

/* Phone mockup */
.phone {
  width: 300px; max-width: 82%; margin: 0 auto; aspect-ratio: 300/620;
  background: var(--surface); border: 10px solid #14150f;
  border-radius: 40px; box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column;
}
.phone .status { height: 30px; background: var(--olive); }
.phone .screen { flex: 1; padding: 16px 14px; background: var(--bg); overflow: hidden; }
.phone .p-title { font-weight: 800; font-size: 1.1rem; margin-bottom: 2px; }
.phone .p-sub { font-size: .72rem; color: var(--muted); margin-bottom: 14px; }
.p-card { background: var(--surface); border: 1px solid var(--outline); border-radius: 12px; padding: 11px 12px; margin-bottom: 9px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); }
.p-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-container); color: var(--on-primary-container); display: grid; place-items: center; flex: none; }
.p-card b { font-size: .82rem; }
.p-card small { display: block; color: var(--muted); font-size: .68rem; }

/* ---------- Sections ---------- */
section.block { padding: 68px 0; }
.section-head { max-width: 62ch; margin: 0 auto 40px; text-align: center; }
.section-head .kicker { color: var(--olive-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; }
.alt { background: var(--surface-alt); }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-container); color: var(--on-primary-container); display: grid; place-items: center; margin-bottom: 14px; }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--muted); margin: 0; font-size: .96rem; }

/* ---------- Calculators ---------- */
.calc-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.calc-tab {
  font: inherit; font-weight: 650; font-size: .92rem; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--outline);
  background: var(--surface); color: var(--on-bg);
}
.calc-tab[aria-selected="true"] { background: var(--olive); color: var(--on-primary); border-color: var(--olive); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.calc {
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.calc h3 { display: flex; align-items: center; gap: 10px; }
.calc h3 .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--tertiary-container); color: var(--tertiary); display: grid; place-items: center; flex: none; }
.calc .desc { color: var(--muted); font-size: .9rem; margin: 4px 0 16px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 5px; }
.field input, .field select {
  width: 100%; font: inherit; font-size: .95rem;
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--outline); background: var(--bg); color: var(--on-bg);
}
.field input:focus, .field select:focus { outline: 2px solid var(--olive); border-color: var(--olive); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc .btn-primary { width: 100%; justify-content: center; margin-top: 6px; }
.result {
  margin-top: 16px; padding: 16px; border-radius: var(--radius-sm);
  background: var(--primary-container); color: var(--on-primary-container);
  display: none;
}
.result.show { display: block; }
.result.err { background: color-mix(in srgb, var(--error) 16%, var(--surface)); color: var(--error); }
.result .big { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.result .rows { margin-top: 10px; display: grid; gap: 3px; font-size: .9rem; }
.result .rows div { display: flex; justify-content: space-between; gap: 12px; }
.hint { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { font: inherit; font-size: .78rem; cursor: pointer; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--outline); background: var(--surface-alt); color: var(--on-bg); }
.chip:hover { background: var(--secondary-container); }

/* ---------- Stores ---------- */
.stores-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.map-frame { width: 100%; aspect-ratio: 4/3; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface-alt); }
.chain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.chain {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: var(--radius-sm); font-weight: 600; font-size: .86rem; color: var(--on-bg);
}
.chain:hover { background: var(--surface-alt); text-decoration: none; }
.chain .swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.store-status { margin-top: 14px; font-size: .9rem; color: var(--muted); min-height: 1.4em; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--olive); color: var(--on-primary);
  border-radius: 24px; padding: 48px 32px; text-align: center; box-shadow: var(--shadow-lg);
}
.cta-banner h2 { color: var(--on-primary); }
.cta-banner p { color: color-mix(in srgb, var(--on-primary) 85%, transparent); max-width: 50ch; margin: 0 auto 22px; }
.cta-banner .btn-primary { background: var(--on-primary); color: var(--olive-dark); }
.badge-store { display: inline-flex; align-items: center; gap: 10px; background: #14150f; color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 600; }
.badge-store:hover { text-decoration: none; opacity: .92; }
.badge-store small { display: block; font-size: .66rem; opacity: .8; font-weight: 500; }
.badge-store b { font-size: 1.05rem; }

/* ---------- Footer ---------- */
footer.site { background: var(--surface-container); border-top: 1px solid var(--outline); padding: 44px 0 28px; margin-top: 20px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
footer .brand { margin-bottom: 10px; }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
footer a { color: var(--muted); }
footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--on-bg); margin: 0 0 12px; }
.foot-bottom { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--outline); display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; color: var(--muted); font-size: .88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .features { grid-template-columns: 1fr 1fr; }
  .stores-wrap { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--outline); padding: 8px; box-shadow: var(--shadow-lg); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .nav-links .lang-select, .nav-links .btn { margin: 6px 6px; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   materio-web additions — trust band, steps, FAQ, badges, doc
   ============================================================ */

/* Skip link (a11y) */
.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--olive); color: var(--on-primary); padding: 10px 16px; border-radius: 0 0 10px 0; font-weight: 700; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; border-radius: 4px; }

/* Store badges (Google Play) */
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.gp-badge {
  display: inline-flex; align-items: center; gap: 12px;
  background: #14150f; color: #fff; padding: 11px 20px 11px 18px;
  border-radius: 14px; font-weight: 600; box-shadow: var(--shadow);
  transition: transform .06s ease, box-shadow .2s ease, opacity .2s ease;
}
.gp-badge:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.gp-badge:active { transform: translateY(1px); }
.gp-badge svg { flex: none; }
.gp-badge small { display: block; font-size: .68rem; opacity: .82; font-weight: 500; letter-spacing: .02em; }
.gp-badge b { font-size: 1.14rem; line-height: 1.1; }

/* Trust / stats band */
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { text-align: center; padding: 8px; }
.stat .num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; color: var(--olive-dark); line-height: 1; }
.stat .lbl { color: var(--muted); font-weight: 600; font-size: .92rem; margin-top: 8px; }

/* How it works — numbered steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); padding: 28px 24px 24px; box-shadow: var(--shadow); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; background: var(--olive); color: var(--on-primary);
  font-weight: 800; font-size: 1.15rem; margin-bottom: 14px;
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); margin: 0; font-size: .96rem; }

/* Trust / privacy split */
.trust-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.trust-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 16px; }
.trust-list li { display: flex; gap: 14px; align-items: flex-start; }
.trust-list .tick { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--primary-container); color: var(--on-primary-container); display: grid; place-items: center; margin-top: 2px; }
.trust-list b { display: block; }
.trust-list span.d { color: var(--muted); font-size: .95rem; }
.trust-panel { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.trust-panel h3 { display: flex; align-items: center; gap: 10px; }
.trust-panel .shield { width: 40px; height: 40px; border-radius: 11px; background: var(--tertiary-container); color: var(--tertiary); display: grid; place-items: center; flex: none; }
.trust-panel ul { margin: 14px 0 0; padding-left: 18px; color: var(--muted); display: grid; gap: 8px; }
.trust-panel ul li::marker { color: var(--olive); }

/* FAQ (details/summary) */
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; }
.faq summary { cursor: pointer; padding: 18px 20px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--olive); font-weight: 700; line-height: 1; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 20px 18px; color: var(--muted); }

/* Section intro alignment helper */
.section-head.left { text-align: left; margin-left: 0; }

/* ---------- Legal / document page ---------- */
.doc { max-width: 820px; margin: 0 auto; padding: 40px 20px 64px; }
.doc h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.doc h2 { font-size: 1.35rem; margin-top: 2.2rem; padding-bottom: 6px; border-bottom: 1px solid var(--outline); }
.doc h3 { font-size: 1.08rem; margin-top: 1.5rem; }
.doc p, .doc li { color: var(--on-bg); }
.doc .muted { color: var(--muted); }
.doc ul { padding-left: 20px; }
.doc ul li::marker { color: var(--olive); }
.doc code { background: var(--surface-alt); padding: 1px 6px; border-radius: 5px; font-size: .92em; }
.doc hr { border: none; border-top: 2px solid var(--outline); margin: 48px 0; }
.doc .toc { background: var(--surface-alt); border: 1px solid var(--outline); border-radius: var(--radius); padding: 18px 22px; margin: 22px 0 8px; }
.doc .toc ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; grid-template-columns: 1fr 1fr; }
.doc .lang-switch { display: inline-flex; gap: 6px; margin: 8px 0 24px; flex-wrap: wrap; }
.doc .lang-switch a { padding: 6px 14px; border: 1px solid var(--outline); border-radius: 999px; font-weight: 600; font-size: .9rem; background: var(--surface); }
.doc-back { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; }

@media (max-width: 900px) {
  .stat-band { grid-template-columns: 1fr 1fr; gap: 26px 18px; }
  .steps { grid-template-columns: 1fr; }
  .trust-split { grid-template-columns: 1fr; gap: 28px; }
  .doc .toc ul { grid-template-columns: 1fr; }
}

/* Two-column split (rooms, store finder) */
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.store-panel .fld-label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.search-row { display: flex; gap: 8px; }
.search-row input {
  flex: 1; min-width: 0; font: inherit; font-size: .98rem;
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--outline); background: var(--bg); color: var(--on-bg);
}
.search-row input:focus { outline: 2px solid var(--olive); border-color: var(--olive); }
.search-row .btn { flex: none; }
@media (max-width: 900px) { .split-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .search-row { flex-wrap: wrap; } .search-row .btn { width: 100%; justify-content: center; } }

/* Store finder — nearby list */
.store-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.store-item { display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius-sm);
  padding: 12px 14px; box-shadow: var(--shadow); }
.store-info { min-width: 0; }
.store-info b { display: block; font-size: .98rem; line-height: 1.25; }
.store-meta { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.store-dist { font-weight: 700; color: var(--olive-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }
.store-empty { color: var(--muted); font-size: .92rem; padding: 6px 2px; }
.store-search-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--outline); }
@media (max-width: 420px) {
  .store-item { flex-direction: column; align-items: stretch; }
  .store-actions { justify-content: space-between; }
}
