/* nazbieraj.pl — design tokens (single source of truth) */
:root {
  /* ── color ── */
  --bg:        #FBF7F0;
  --bg-soft:   #F4ECDF;
  --bg-warm:   #F7E9D7;
  --ink:       #1F1A14;
  --ink-2:     #5C5042;
  --ink-3:     #8B7E6E;
  --rule:      rgba(31,26,20,0.12);
  --rule-2:    rgba(31,26,20,0.06);

  --accent:        #C96442;
  --accent-hover:  #B5573A;
  --accent-soft:   #F4D9CD;
  --accent-ink:    #FFFFFF;

  --success: #2E7D5B;
  --danger:  #A8341E;
  --warning: #C98A1F;

  /* ── type ── */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --t-display:   clamp(32px, 7vw, 44px);
  --t-h1:        28px;
  --t-h2:        22px;
  --t-h3:        18px;
  --t-body:      16px;
  --t-small:     14px;
  --t-micro:     12px;

  /* ── space ── */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* ── radius ── */
  --r-1: 8px;
  --r-2: 12px;
  --r-3: 16px;
  --r-4: 24px;
  --r-pill: 999px;

  /* ── shadow ── */
  --shadow-1: 0 1px 2px rgba(31,26,20,0.06), 0 1px 1px rgba(31,26,20,0.04);
  --shadow-2: 0 4px 12px rgba(31,26,20,0.08), 0 2px 4px rgba(31,26,20,0.04);
  --shadow-3: 0 12px 32px rgba(31,26,20,0.12), 0 4px 8px rgba(31,26,20,0.06);

  /* ── motion ── */
  --ease: cubic-bezier(.2,.7,.3,1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;

  --container: 1120px;
  --content:    640px;
}

/* ───────── reset ───────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: var(--t-display); letter-spacing: -0.025em; }
h2 { font-size: var(--t-h1); letter-spacing: -0.02em; }
h3 { font-size: var(--t-h2); }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

/* ───────── components ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px;
  border-radius: var(--r-2); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  background: var(--ink); color: #fff;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: #2c241c; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { background: var(--bg-soft); }
.btn--soft { background: var(--bg-soft); color: var(--ink); }
.btn--soft:hover { background: var(--bg-warm); }
.btn--danger { background: transparent; color: var(--danger); border-color: rgba(168,52,30,0.25); }
.btn--danger:hover { background: rgba(168,52,30,0.06); }
.btn--lg { height: 56px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }

.card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  padding: var(--s-6);
}
.card--soft { background: var(--bg-soft); border-color: transparent; }
.card--warm { background: var(--bg-warm); border-color: transparent; }

.field { display: block; }
.field__label { font-size: var(--t-small); font-weight: 500; color: var(--ink-2); margin-bottom: 6px; display: block; }
.input {
  width: 100%; height: 52px; padding: 0 16px;
  background: #fff;
  border: 1px solid var(--rule); border-radius: var(--r-2);
  font-size: 15px;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder { color: var(--ink-3); }

.code-input { display: flex; gap: 8px; }
.code-input__cell {
  flex: 1; aspect-ratio: 1; max-width: 52px;
  background: #fff;
  border: 1.5px solid var(--rule); border-radius: var(--r-2);
  font-family: var(--font-mono); font-size: 22px; font-weight: 600;
  text-align: center;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.code-input__cell:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  background: var(--bg-soft); color: var(--ink-2);
  border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
}
.chip--accent { background: var(--accent-soft); color: var(--accent-hover); }
.chip--success { background: rgba(46,125,91,0.12); color: var(--success); }
.chip--danger  { background: rgba(168,52,30,0.10); color: var(--danger); }
.chip--ghost   { background: transparent; border: 1px solid var(--rule); color: var(--ink-2); }

.progress {
  position: relative; height: 8px; width: 100%;
  background: var(--rule-2); border-radius: var(--r-pill);
  overflow: hidden;
}
.progress__fill {
  position: absolute; inset: 0 auto 0 0;
  background: var(--accent); border-radius: inherit;
  transition: width var(--dur-3) var(--ease);
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s-4); }
@media (min-width: 768px) { .container { padding: 0 var(--s-6); } }

.stack > * + * { margin-top: var(--s-4); }
.stack-2 > * + * { margin-top: var(--s-2); }
.stack-3 > * + * { margin-top: var(--s-3); }
.stack-6 > * + * { margin-top: var(--s-6); }
.stack-8 > * + * { margin-top: var(--s-8); }

.section { padding: var(--s-12) 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

.underline-accent { display: inline-block; position: relative; }
.underline-accent::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 6px;
  background: var(--accent); border-radius: 4px; opacity: 0.6;
  transform: scaleX(0.92) skewX(-8deg);
}

.text-mono { font-family: var(--font-mono); }
.text-secondary { color: var(--ink-2); }
.text-tertiary { color: var(--ink-3); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.gap-6 { gap: var(--s-6); }
.mt-auto { margin-top: auto; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--rule); border: none; margin: 0; }

/* Brand wordmark */
.brand { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.brand span { color: var(--accent); }

/* Top bar — full-width sticky strip with content centred to the body width. */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 5;
}
.topbar__inner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; min-height: 56px;
  max-width: 480px;
  margin: 0 auto;
}
.topbar__title { font-family: var(--font-display); font-size: 17px; font-weight: 700; flex: 1; text-align: center; letter-spacing: -0.01em; }
.topbar__back, .topbar__action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-1);
  background: transparent; border: none; color: var(--ink); text-decoration: none;
}
.topbar__back:hover, .topbar__action:hover { background: var(--bg-soft); }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 80px; transform: translateX(-50%) translateY(-20px);
  background: var(--success); color: #fff; padding: 12px 20px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-2), transform var(--dur-2);
  z-index: 20; box-shadow: var(--shadow-2);
  max-width: calc(100% - 40px);
  text-align: center;
}
.toast--danger { background: var(--danger); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Inline alert (for server-rendered errors/success) */
.alert {
  border-radius: var(--r-2);
  padding: 12px 14px;
  font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert--success { background: rgba(46,125,91,0.10); color: var(--success); border: 1px solid rgba(46,125,91,0.25); }
.alert--danger  { background: rgba(168,52,30,0.08);  color: var(--danger);  border: 1px solid rgba(168,52,30,0.25); }
.alert--info    { background: var(--bg-soft); color: var(--ink-2); }
.alert svg { flex-shrink: 0; margin-top: 2px; }
