/* ==========================================================================
   TanieAI - wspólna baza stylów (landing, logowanie, regulamin, panel, admin)
   Świat: paragon. Papier termiczny, druk mono, pomarańcz i granat z logo.
   ========================================================================== */

:root {
  color-scheme: light;

  /* kolory - próbki z assets/logo.png: granat #161248, pomarańcz #F76021 */
  --ink: #161248;
  --ink-2: #3b3873;
  --muted: #66638c;
  --faint: #8f8cad;

  --orange: #f76021;
  --orange-hover: #e5520f;
  --orange-deep: #c2410c;      /* pomarańcz do małego tekstu na jasnym tle (kontrast 5:1) */
  --orange-tint: #fff0e6;
  --orange-wash: #ffe2d1;

  --ground: #f6f4f1;
  --surface: #ffffff;
  --line: #e8e3dc;
  --line-2: #d9d3ca;

  --green: #14804a;
  --green-tint: #e3f5ec;
  --amber: #a35700;
  --amber-tint: #fff1d6;
  --red: #c42b2b;
  --red-tint: #fde8e8;

  /* typografia */
  --font-ui: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Urbanist', 'Onest', system-ui, sans-serif;
  --font-mono: 'Spline Sans Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* kształt i ruch */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 20px;
  --shadow-1: 0 1px 2px rgba(22, 18, 72, 0.06), 0 10px 28px -14px rgba(22, 18, 72, 0.22);
  --shadow-2: 0 2px 4px rgba(22, 18, 72, 0.06), 0 24px 48px -20px rgba(22, 18, 72, 0.32);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* układ */
  --header-h: 76px;
  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure { margin-top: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
code, kbd, samp, pre { font-family: var(--font-mono); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.on-orange :focus-visible { outline-color: var(--ink); }

::selection { background: var(--orange); color: var(--ink); }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; z-index: 100; top: 10px; left: 10px;
  padding: 12px 18px; border-radius: var(--r-sm);
  background: var(--ink); color: #fff; font-weight: 700; text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- ikony ---------- */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico--fill { fill: currentColor; stroke: none; }
.ico--sm { width: 16px; height: 16px; }

/* ---------- przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 1.5px solid transparent; border-radius: var(--r);
  font: 600 15px/1 var(--font-ui); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .ico { width: 18px; height: 18px; transition: transform 0.2s var(--ease); }
.btn:hover .ico--go { transform: translateX(3px); }

.btn--primary { background: var(--orange); color: var(--ink); box-shadow: 0 10px 24px -12px rgba(247, 96, 33, 0.9); }
.btn--primary:hover { background: var(--orange-hover); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: #241e6b; }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--orange-tint); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }

.link {
  color: inherit; font-weight: 600; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  padding-bottom: 2px; transition: background-size 0.25s var(--ease);
}
.link:hover { background-size: 0 2px; background-position: 100% 100%; }

/* ---------- znaczniki ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 6px;
  background: var(--orange-tint); color: var(--orange-deep);
  font: 600 11px/1.2 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
.tag--green { background: var(--green-tint); color: var(--green); }
.tag--amber { background: var(--amber-tint); color: var(--amber); }
.tag--red { background: var(--red-tint); color: var(--red); }
.tag--ink { background: var(--ink); color: #fff; }
.tag--plain { background: transparent; color: var(--muted); padding-inline: 0; }

.eyebrow {
  font: 600 12px/1.2 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange-deep);
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.eyebrow::before { content: ''; width: 22px; height: 2px; background: currentColor; }

/* ---------- nagłówek ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__bar {
  height: 100%; display: flex; align-items: center; gap: 36px;
}
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { height: 56px; width: auto; transition: transform 0.25s var(--ease); }
.brand:hover img { transform: scale(1.04); }

.nav { display: flex; align-items: center; gap: 6px; margin-right: auto; }
.nav a {
  position: relative; padding: 10px 14px; border-radius: 8px;
  font-weight: 600; font-size: 15px; text-decoration: none; color: var(--ink-2);
  transition: color 0.15s, background-color 0.15s;
}
.nav a:hover { color: var(--ink); background: var(--orange-tint); }
.nav a[aria-current='page'], .nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--orange); border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.login-link { font-weight: 600; font-size: 15px; text-decoration: none; padding: 10px 6px; color: var(--ink-2); }
.login-link:hover { color: var(--ink); }

.lang { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--ground); border: 1px solid var(--line); }
.lang button {
  min-width: 38px; min-height: 32px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
  font: 600 12px/1 var(--font-mono); letter-spacing: 0.04em; color: var(--muted);
  transition: background-color 0.15s, color 0.15s;
}
.lang button:hover { color: var(--ink); }
.lang button.active, .lang button[aria-pressed='true'] { background: var(--ink); color: #fff; }

.menu-btn {
  display: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line-2);
  background: #fff; align-items: center; justify-content: center; cursor: pointer;
}

.scroll-progress {
  position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%;
  background: var(--orange); transform-origin: 0 50%; transform: scaleX(var(--page-p, 0));
}

.nav__login { display: none; }

@media (max-width: 960px) {
  /* backdrop-filter robi z nagłówka blok zawierający dla position:fixed (menu mobilne), więc go wyłączamy */
  .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }
  .site-header__bar { gap: 12px; }
  .menu-btn { display: inline-flex; margin-left: 4px; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    padding: 12px var(--gutter) 32px; background: #fff; overflow-y: auto;
    transform: translateY(-8px); opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s 0.25s;
  }
  .nav a { padding: 18px 4px; border-radius: 0; font-size: 20px; font-family: var(--font-display); font-weight: 700; border-bottom: 1px solid var(--line); }
  .nav a.is-active::after { display: none; }
  body.nav-open .nav { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s; }
  body.nav-open { overflow: hidden; }
  .login-link { display: none; }
  .nav__login { display: block; color: var(--orange-deep); }
}
@media (max-width: 520px) {
  .header-actions .btn { padding: 0 12px; }
  .btn-label-full { display: none; }
}
@media (min-width: 521px) {
  .btn-label-short { display: none; }
}

/* ---------- paragon (element wspólny) ---------- */
.receipt {
  position: relative; background: #fff; color: var(--ink);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
  padding: 26px 24px 30px;
  filter: drop-shadow(0 22px 28px rgba(22, 18, 72, 0.28));
}
/* postrzępione brzegi papieru: zęby 20×10 px, ten sam kolor co papier */
.receipt::before, .receipt::after {
  content: ''; position: absolute; left: 0; right: 0; height: 10px; background-repeat: repeat-x; background-size: 20px 10px;
}
.receipt::before {
  top: -9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10' viewBox='0 0 20 10'%3E%3Cpath fill='%23fff' d='M0 10 10 0l10 10z'/%3E%3C/svg%3E");
}
.receipt::after {
  bottom: -9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10' viewBox='0 0 20 10'%3E%3Cpath fill='%23fff' d='M0 0h20L10 10z'/%3E%3C/svg%3E");
}
.receipt--plain::before, .receipt--plain::after { display: none; }
.receipt hr { border: 0; border-top: 2px dashed var(--line-2); margin: 14px 0; }
.rc-head { text-align: center; text-transform: uppercase; letter-spacing: 0.06em; }
.rc-head strong { display: block; font: 700 18px/1.2 var(--font-mono); letter-spacing: 0.1em; }
.rc-head span { color: var(--muted); font-size: 11px; }
.rc-line { display: flex; align-items: baseline; gap: 8px; }
.rc-line > i { flex: 1; min-width: 12px; border-bottom: 2px dotted rgba(22, 18, 72, 0.32); transform: translateY(-3px); }
.rc-line b { font-weight: 600; }
.rc-line--total { font-weight: 700; font-size: 15px; }
.rc-line--total > i { border-bottom-color: var(--ink); opacity: 0.35; }
.rc-foot { text-align: center; color: var(--muted); font-size: 11px; margin: 14px 0 0; text-transform: uppercase; letter-spacing: 0.06em; }
.barcode { display: block; width: 100%; height: 44px; margin: 14px 0 6px; color: var(--ink); }
.stamp {
  display: inline-block; padding: 6px 14px; border: 3px solid var(--orange-deep); color: var(--orange-deep); border-radius: 6px;
  font: 800 16px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; transform: rotate(-8deg);
  mix-blend-mode: multiply;
}

/* ---------- stopka ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 56px 0 28px; }
.footer-main { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; align-items: flex-start; }
.footer-brand img { height: 84px; width: auto; margin-bottom: 14px; }
.footer-brand p { margin: 0; max-width: 34ch; color: var(--muted); font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 28px; padding-top: 6px; }
.footer-links a { font-weight: 600; text-decoration: none; color: var(--ink-2); padding: 8px 0; }
.footer-links a:hover { color: var(--orange-deep); }
.legal { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 20px; }
.legal summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 6px 0; }
.legal p { margin: 12px 0 0; font-size: 13px; line-height: 1.65; color: var(--muted); max-width: 90ch; }
.legal a { color: var(--orange-deep); }
.footer-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-top: 24px; font: 500 12px/1.5 var(--font-mono); color: var(--faint); }

/* ---------- formularze ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.input {
  min-height: 48px; width: 100%; padding: 0 14px; border-radius: var(--r); border: 1.5px solid var(--line-2); background: #fff; color: var(--ink);
  font: 500 15px var(--font-ui); transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(22, 18, 72, 0.12); }
.input--mono { font-family: var(--font-mono); font-size: 13px; }

/* ---------- ruch ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
