/* Design system 4CONVY — podstawy: reset, typografia, ikony, przyciski, pola formularzy, fokus.
   Wartości tylko ze zmiennych z ds-tokeny.css (bez hexów). Ruch (przejścia, wciśnięcie) dopisuje ds-ruch.css. */

*, *::before, *::after { box-sizing: border-box; }
/* Lista z klasą to klocek, nie tekst: bez kropek i wcięcia przeglądarki. :where = zerowa waga, klocek nadpisuje. */
:where(ul[class], ol[class]) { list-style: none; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--f-body); font-size: var(--fs-body); font-weight: var(--fw-body); line-height: var(--lh-body);
}
h1, h2, h3 { font-family: var(--f-head); color: var(--text); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: var(--fs-title); font-weight: var(--fw-title); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-h2); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-h3); }
p { margin: 0 0 1em; }
a { color: var(--text); text-underline-offset: 3px; }
small, .maly { font-size: var(--fs-small); font-weight: var(--fw-small); }
.liczby { font-family: var(--f-num); font-size: var(--fs-num); font-weight: var(--fw-num); font-variant-numeric: tabular-nums; }
.pomocniczy { color: var(--muted); }
.tylko-czytnik {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }

/* Telefon: strefa dotyku 44 px, większy tekst przycisku (README „Telefon”) */
@media (max-width: 599px) {
  :root { --hit-pad: 2px; --cb: 22px; --opt-min: 44px; --fs-btn: 14px; --row-h: 44px; }
}

/* ---------- Ikony (sprite w komponenty/ikony.html) ---------- */
.ikona {
  width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.ikona--16 { width: 16px; height: 16px; }
.ikona--18 { width: 18px; height: 18px; }
.ikona--36 { width: 36px; height: 36px; }
.znaczek { width: 12px; height: 12px; flex: none; }

/* ---------- Przyciski ---------- */
.btn-p, .btn-s, .btn-t, .btn-d {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--ctl-h); padding: 0 var(--btn-px); border: 0; border-radius: var(--r-ctl);
  font-family: var(--f-btn); font-size: var(--fs-btn); font-weight: var(--fw-btn); line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer; background: transparent; color: var(--text);
}
/* niewidoczny dopisek: na telefonie strefa dotyku 44 px przy widocznych 40 */
.btn-p::after, .btn-s::after, .btn-t::after, .btn-d::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(var(--hit-pad) * -1); bottom: calc(var(--hit-pad) * -1);
}
.btn-p { background: var(--accent); color: var(--on-accent); }
.btn-p:hover { background: var(--accent-hover); }
.btn-s { background: var(--bg); box-shadow: inset 0 0 0 1px var(--fline); }
.btn-s:hover { background: var(--tint-fld); box-shadow: inset 0 0 0 1px var(--fline-hover); }
.btn-t { padding: 0 10px; text-decoration: underline; text-underline-offset: 3px; }
.btn-t:hover { background: var(--tint-fld); }
.btn-d { background: var(--bg); color: var(--error-fg); box-shadow: inset 0 0 0 1px var(--error); }
.btn-d:hover { background: var(--error-bg); }
.btn-p:disabled, .btn-s:disabled, .btn-t:disabled, .btn-d:disabled,
.btn-p[aria-disabled="true"], .btn-s[aria-disabled="true"], .btn-t[aria-disabled="true"], .btn-d[aria-disabled="true"] {
  background: var(--dis-bg); color: var(--dis-fg); box-shadow: inset 0 0 0 1px var(--dis-line); cursor: not-allowed; text-decoration: none;
}
.rzad-przyciskow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
@media (max-width: 599px) {
  .btn-p { width: 100%; }
}

/* ---------- Pola formularzy ---------- */
.pole { margin: 0 0 var(--fld-gap); }
.etykieta { display: block; margin: 0 0 var(--lbl-gap); font-size: var(--fs-body); font-weight: 600; }
.etykieta.wymagane::after { content: " *"; }
.podpowiedz-pola { margin: var(--lbl-gap) 0 0; font-size: var(--fs-small); color: var(--muted); }
.pole-wej {
  display: block; width: 100%; height: calc(var(--ctl-h) + 2 * var(--hit-pad)); padding: 0 var(--fld-px);
  border: 0; border-radius: var(--r-ctl); background: var(--fld-bg); color: var(--text);
  font-family: var(--f-body); font-size: var(--fld-fs); line-height: 1.3; box-shadow: var(--fld-sh);
}
textarea.pole-wej { height: calc(var(--ta-h) + 2 * var(--hit-pad)); padding-top: 10px; padding-bottom: 10px; resize: vertical; }
.pole-wej::placeholder { color: var(--muted); }
.pole-wej:hover, .pole-wej.jest-najechane { background: var(--fld-bg-hover); box-shadow: var(--fld-sh-hover); }
.pole-wej:focus, .pole-wej.jest-fokus { background: var(--fld-bg-focus); box-shadow: var(--fld-sh-focus); outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.pole-wej:disabled { background: var(--dis-bg); color: var(--dis-fg); box-shadow: inset 0 0 0 1px var(--dis-line); cursor: not-allowed; }
.pole.jest-blad .pole-wej { box-shadow: var(--fld-sh-err); }
.pole-blad {
  display: flex; align-items: flex-start; gap: 6px; margin: var(--lbl-gap) 0 0;
  font-size: var(--fs-small); font-weight: 500; color: var(--error-fg);
}
.pole-blad .ikona { width: 16px; height: 16px; stroke: var(--error); }

/* Pole wyboru i przełącznik */
.opcja { display: flex; align-items: center; gap: 10px; min-height: var(--opt-min); cursor: pointer; }
.opcja input { margin: 0; }
.opcja input[type="checkbox"]:not([role="switch"]), .opcja input[type="radio"] {
  appearance: none; position: relative; flex: none; width: var(--cb); height: var(--cb);
  background: var(--fld-bg); box-shadow: var(--fld-sh); border-radius: var(--r-ctl); cursor: pointer;
}
.opcja input[type="radio"] { border-radius: var(--r-tag); }
.opcja input[type="checkbox"]:not([role="switch"]):hover, .opcja input[type="radio"]:hover { box-shadow: var(--fld-sh-hover); }
.opcja input[type="checkbox"]:not([role="switch"]):checked, .opcja input[type="radio"]:checked { background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opcja input[type="checkbox"]:not([role="switch"]):checked::after {
  content: ""; position: absolute; left: 33%; top: 14%; width: 30%; height: 52%;
  border-right: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: rotate(45deg);
}
.opcja input[type="radio"]:checked::after {
  content: ""; position: absolute; inset: 30%; border-radius: var(--r-tag); background: var(--on-accent);
}
.opcja input:disabled { cursor: not-allowed; background: var(--dis-bg); box-shadow: inset 0 0 0 1px var(--dis-line); }
.opcja:has(input:disabled) { color: var(--dis-fg); cursor: not-allowed; }
.opcja input[role="switch"] {
  appearance: none; position: relative; flex: none; width: var(--sw-w); height: var(--sw-h);
  border-radius: var(--sw-r); background: var(--bg); box-shadow: var(--fld-sh); cursor: pointer;
}
.opcja input[role="switch"]::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: calc(var(--sw-h) - 8px); height: calc(var(--sw-h) - 8px);
  border-radius: var(--r-tag); background: var(--fline);
}
.opcja input[role="switch"]:checked { background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opcja input[role="switch"]:checked::after { background: var(--on-accent); transform: translateX(calc(var(--sw-w) - var(--sw-h))); }

/* Strefa wgrywania pliku */
.strefa-pliku {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 112px; padding: var(--sp-4); text-align: center; color: var(--muted);
  border: 1px dashed var(--fline); border-radius: var(--r-card); background: var(--bg);
}
.strefa-pliku:hover, .strefa-pliku.jest-najechane { background: var(--tint-fld); border-color: var(--fline-hover); }
.pole.jest-blad .strefa-pliku { border: 2px dashed var(--error); }
