:root {
  --bg: #eef1f6;
  --paper: #ffffff;
  --ink: #1a2332;
  --muted: #5d6b7c;
  --line: #dce3ec;
  --accent: #c45c26;
  --accent-dark: #9a4318;
  --ok: #2c7a54;
  --warn: #a15c12;
  --bad: #b42318;
  --navy: #17324f;
  --soft: #f6f8fb;
  --shadow: 0 10px 28px rgba(23, 50, 79, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 420px at 8% -10%, #ffe8d6 0%, transparent 55%),
    radial-gradient(900px 380px at 100% 0%, #d9e7f6 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
  font-size: 15px;
}

.wrap { width: min(920px, calc(100% - 28px)); margin: 0 auto; }

.top {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 700; }
.brand small { display: block; font-weight: 400; opacity: .72; font-size: 11px; letter-spacing: .02em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); display: grid; place-items: center;
  font-size: 12px; letter-spacing: .04em;
}
.top nav { display: flex; gap: 8px; align-items: center; }
.top nav a { color: #d7e3ef; text-decoration: none; font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.top nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.top nav .btn { color: #fff; padding: 7px 12px; }

main { padding: 22px 0 72px; }

.page-head { margin: 4px 0 16px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.page-head h1, .hero h1, .card > h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 15px; max-width: 62ch; margin: 0 0 12px; }

.hero {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 26px 24px;
  box-shadow: var(--shadow);
}
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }

.how, .steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.step, .how li {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px 11px;
}
.step strong, .how b { display: block; font-size: 13px; margin-bottom: 3px; color: var(--navy); }
.step span, .how li { font-size: 13px; color: var(--muted); }
.how b { color: var(--navy); }
.how .num {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 12px; margin-right: 6px; font-weight: 700;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin-top: 14px;
  box-shadow: 0 6px 18px rgba(23, 50, 79, .05);
}
.card h2 { margin: 0 0 10px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.card-step h2 .n {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 12px; flex-shrink: 0;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 8px 13px;
  font-weight: 650;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--soft); color: var(--navy); }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #246646; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }

label { display: block; font-size: 12px; font-weight: 650; margin: 8px 0 3px; color: #314155; }
.field-hint { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin: -1px 0 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid #f0c3a6; border-color: var(--accent);
}
textarea { min-height: 64px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-weight: 400; font-size: 13px; }
.check input { margin-top: 3px; }

.pozycja {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
  background: var(--soft);
}
.pozycja.is-err {
  border-color: var(--bad);
  box-shadow: 0 0 0 2px rgba(196, 64, 64, .15);
}
.pozycja-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px;
}
.pozycja-nr { font-weight: 750; font-size: 13px; color: var(--navy); }
.pozycja-linia {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1.3fr) 76px;
  gap: 8px;
  align-items: end;
}
.pozycja-ilosc input { max-width: 100%; }
.mat-inny-wrap { margin-top: 8px; }
[hidden] { display: none !important; }
.mat-val { cursor: pointer; background: #fff !important; }
.mat-val::placeholder { color: var(--accent); font-weight: 650; }

.file-drop {
  display: block; margin: 0; cursor: pointer; position: relative;
  border: 1.5px dashed #c5d0dc;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 58px;
}
.file-drop:hover, .file-drop.is-over { border-color: var(--accent); background: #fff7f1; }
.file-drop.has-file { border-style: solid; border-color: #b7d4c4; background: #f3faf6; }
.file-drop input {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer;
}
.file-drop-ui { display: block; }
.file-drop-ui strong { display: block; font-size: 13px; color: var(--navy); }
.file-name { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; word-break: break-all; }

.dxf-box { margin-top: 10px; }
.dxf-canvas {
  width: 100%;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: grab;
  display: block;
  touch-action: none;
}
.dxf-canvas[hidden] { display: none; }
.dxf-hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.dxf-hint.is-warn { color: var(--warn); font-weight: 650; }

.alert { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: 14px; }
.alert-bad { background: #fde8e8; color: var(--bad); }
.alert-warn { background: #fff3d6; color: var(--warn); }
.dxf-ostrzezenia .alert { margin: 5px 0 0; font-size: 13px; }
.dxf-wymiary { margin: 5px 0 0; }
.bulk-drop { margin-bottom: 13px; border-style: dashed; }

/* Wątek pytań do oferty */
.watek { display: flex; flex-direction: column; gap: 8px; margin: 0 0 13px; }
.watek-msg { padding: 8px 12px; border-radius: 10px; max-width: 89%; line-height: 1.45; font-size: 14px; }
.watek-msg small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.watek-msg.od-klienta { background: var(--soft); border: 1px solid var(--line); align-self: flex-start; }
.watek-msg.od-firmy { background: #fff7f1; border: 1px solid #f3d3bd; align-self: flex-end; }
.dostawa { display: flex; gap: 13px; flex-wrap: wrap; margin: 5px 0 8px; }
.odp-edycja { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.odp-edycja input { font-weight: 650; }
/* Statystyki */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(144px, 1fr)); gap: 8px; margin: 8px 0 13px; }
.stat-tiles div { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat-tiles b { display: block; font-size: 22px; }
.stat-tiles span { font-size: 12px; color: var(--muted); }
.alert-ok { background: #e6f4ec; color: var(--ok); }
.alert-info { background: #eef3f8; color: var(--navy); }

.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-nowe { background: #e8eef5; }
.badge-w_trakcie, .badge-do_akceptacji { background: #fff3d6; color: var(--warn); }
.badge-gotowe { background: #d9f0e3; color: var(--ok); }
.badge-blad, .badge-odrzucone { background: #fde8e8; color: var(--bad); }

.status-hero { text-align: left; }
.status-hero .mono { font-size: 22px; }
.link-box {
  display: block;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  word-break: break-all;
  font-size: 13px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 700; }
th.num, td.num { text-align: right; white-space: nowrap; }
td.num input { max-width: 89px; text-align: right; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.badge-zamowione, .badge-w_realizacji { background: #dbe7f5; color: var(--navy); }
.badge-do_odbioru { background: #d9f0e3; color: var(--ok); }

/* Pasek kroków na stronie statusu */
.postep { list-style: none; display: flex; gap: 5px; margin: 0 0 13px; padding: 0; counter-reset: none; }
.postep li {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted); text-align: center; position: relative;
}
.postep li span {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--soft); border: 2px solid var(--line); font-weight: 700; font-size: 12px; position: relative; z-index: 1;
}
.postep li::before {
  content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line);
}
.postep li:first-child::before { display: none; }
.postep li.zrobione span { background: var(--ok); border-color: var(--ok); color: #fff; }
.postep li.zrobione::before, .postep li.teraz::before { background: var(--ok); }
.postep li.teraz { color: var(--ink); font-weight: 700; }
.postep li.teraz span { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 5px rgba(196, 92, 38, .16); }
@media (max-width: 610px) {
  .postep li { font-size: 0; }          /* na telefonie same kółka… */
  .postep li.teraz { font-size: 12px; } /* …i nazwa bieżącego kroku */
}

/* Kwoty oferty na stronie statusu i w „Moich ofertach” */
.ceny { margin: 13px 0; }
.ceny table { margin-bottom: 8px; }
.ceny-suma {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 21px;
  margin: 0 0 8px auto;
  max-width: 377px;
  font-size: 14px;
}
.ceny-suma dt { color: var(--muted); }
.ceny-suma dd { margin: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ceny-suma .brutto { font-weight: 700; font-size: 17px; color: var(--ink); padding-top: 5px; border-top: 1px solid var(--line); }
table.moje td.akcje { white-space: nowrap; }
table.moje td.akcje a { margin-right: 8px; }

.foot { border-top: 1px solid var(--line); padding: 16px 0 24px; color: var(--muted); font-size: 12px; }
.foot a { color: var(--navy); }
.hp-wrap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.note-legal { font-size: 13.5px; line-height: 1.55; color: var(--navy); margin: 10px 0 0; }
.note-legal a { font-weight: 650; }
.foot-legal { margin: 0 0 8px; font-size: 12px; color: var(--muted); }

code, .mono { font-family: ui-monospace, Consolas, monospace; }

.form-end {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-top: 8px;
}
.form-end .check { margin-top: 0; max-width: 52ch; }

.mat-modal[hidden] { display: none !important; }
.mat-modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(23, 50, 79, .48);
  display: grid; place-items: center; padding: 16px;
}
.mat-dialog {
  width: min(520px, 100%);
  max-height: min(82vh, 700px);
  overflow: hidden;
  background: var(--paper);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(27, 42, 65, .22);
  padding: 14px 14px 10px;
  display: flex; flex-direction: column;
}
.mat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mat-head h2 { margin: 0; font-size: 18px; }
.mat-head-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mat-item-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 650; margin-top: 2px; letter-spacing: .02em; }
.mat-tabs { display: flex; gap: 8px; margin: 10px 0 8px; }
.mat-tab {
  flex: 1; border: 1px solid var(--line); background: var(--soft);
  border-radius: 9px; padding: 8px 8px; font: inherit; font-weight: 650; font-size: 13px; cursor: pointer;
  color: var(--navy);
}
.mat-tab.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.mat-list { overflow: auto; flex: 1; min-height: 160px; border-top: 1px solid var(--line); padding-top: 8px; }
.mat-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer;
}
.mat-item:hover { background: #efe8dc; }
.mat-item-inny { color: var(--muted); font-style: italic; }
.mat-empty { padding: 18px 8px; color: var(--muted); font-size: 13px; }
.giecie-podsumowanie { font-size: 12px; color: var(--navy); margin: 6px 0 0; font-weight: 650; }
.giecie-hint { font-size: 12px; color: var(--warn); margin: 8px 0 0; font-weight: 650; }
.warstwy-ciecia-info { font-size: 12px; color: var(--navy); margin: 6px 0 0; font-weight: 650; }
.giecie-layers { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.svc-switches { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.row-switch { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 650; cursor: pointer; }
.zgoda-mail { margin-top: 12px; }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #c5ced8; border-radius: 24px; transition: .15s; }
.slider:before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(27, 42, 65, .2); }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider:before { transform: translateX(16px); }

.wiz-track {
  list-style: none; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  margin: 0 0 14px; padding: 0;
}
.wiz-track li {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px; font-size: 13px; font-weight: 650; color: var(--muted);
}
.wiz-track li span {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #d5dde6; color: #314155; font-size: 12px;
}
.wiz-track li.is-on { border-color: var(--accent); color: var(--navy); box-shadow: 0 0 0 2px #f3d5c2; }
.wiz-track li.is-on span { background: var(--accent); color: #fff; }
.wiz-track li.is-done { color: var(--ok); }
.wiz-track li.is-done span { background: var(--ok); color: #fff; }
.wiz-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding: 12px 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  position: sticky; bottom: 10px; box-shadow: var(--shadow);
}
.wiz-bar-spacer { flex: 1; }

@media (max-width: 720px) {
  .steps, .how, .grid-2, .pozycja-linia { grid-template-columns: 1fr; }
  .hero { padding: 20px 14px; }
  .page-head h1, .hero h1, .card > h1 { font-size: 24px; }
  .form-end { flex-direction: column; align-items: stretch; }
}

/* --- z wersji online: serwer wyłączony, stopka z linkami, regulamin, zgoda cookies, malowanie --- */
.alert-offline {
  background: #fde8e8;
  color: var(--bad);
  border: 1px solid #f0c4c4;
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.45;
}
.alert-offline a { color: var(--bad); font-weight: 700; }
.btn-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
  background: #8a96a3;
}

.offline-panel {
  background: var(--paper);
  border: 1px solid #f0c4c4;
  border-left: 6px solid var(--bad);
  border-radius: 16px;
  padding: 40px 32px;
  box-shadow: 0 10px 30px rgba(27, 42, 65, .06);
  max-width: 40rem;
  margin: 24px auto;
}
.offline-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bad);
}
.offline-panel h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.2;
  color: var(--bad);
}
.offline-lead {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--ink);
}
.offline-mail {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.5;
}
.offline-mail-addr {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.4;
}
.offline-mail-addr a {
  display: block;
  color: var(--bad);
  font-weight: 700;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.foot-inner { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.foot-links { display: inline-flex; flex-wrap: wrap; gap: 12px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }

.legal h1 { margin: 0 0 10px; font-size: 26px; line-height: 1.2; }
.legal h2 { margin: 22px 0 8px; font-size: 17px; }
.legal p, .legal li { color: var(--ink); }
.legal ul { margin: 0 0 10px; padding-left: 1.2em; }
.legal .lead { margin-bottom: 18px; }

/* Consent modal (jak na mpelektronik.pl) */
#cookie-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 42, 65, .48);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}
#cookie-modal-overlay.active { display: flex; }
#cookie-modal {
  width: min(560px, 96%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(27, 42, 65, .22);
  padding: 20px 20px 16px;
  color: var(--ink);
  max-height: 90vh;
  overflow: auto;
}
.cookie-modal h2 { margin: 0 0 8px; font-size: 18px; }
.cookie-modal p { color: var(--muted); margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.cookie-modal a { color: var(--navy); font-weight: 650; }
.cookie-modal .cookies-list { margin-top: 8px; }
.cookie-modal .cookie-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.4;
}
.cookie-modal .cookie-item input { margin-top: 3px; flex-shrink: 0; }
.cookie-modal .actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}
.cookie-modal .actions .btn:disabled { opacity: .45; cursor: not-allowed; }

.paint-wrap { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 13px; }
.paint-wrap[hidden] { display: none !important; }
.paint-wrap select { max-width: 320px; }
