/* Identyfikacja Cerville (cerville.com.pl): grafitowe tło, szary pasek menu, złoty akcent,
   granat z logo, font Rubik i ostre narożniki. */
:root {
  /* Kontrolki formularzy leżą na białych panelach, więc zostają w wersji jasnej. */
  color-scheme: light;
  --page: #27252b;
  --bar: #3b393e;
  --card-dark: #5f5e61;
  --surface: #ffffff;
  --soft: #f3f2f4;
  --line: #d6d4d4;
  --ink: #1d1d1d;
  --muted: #646464;
  --on-dark: #ffffff;
  --on-dark-muted: #bfbfbf;
  --gold: #eeb111;
  --gold-dark: #d29b0a;
  --navy: #013d7d;
  --navy-soft: #e8eef6;
  --danger: #b3261e;
  font-family: Rubik, 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font-size: 15px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Nagłówek: biały blok marki + grafitowy pasek jak menu na stronie */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
}
.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 22px;
  color: var(--navy);
  background: var(--surface);
  text-decoration: none;
}
.brand__name { font-size: 22px; font-weight: 500; letter-spacing: .38em; margin-right: -.38em; }
.brand__tag { margin-top: 4px; color: var(--gold-dark); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.steps { display: flex; align-items: stretch; gap: 4px; padding: 0 10px; background: var(--bar); }
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--on-dark);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: default;
}
.step span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--on-dark);
  background: var(--card-dark);
  font-size: 12px;
}
.step.is-active { border-bottom-color: var(--gold); color: var(--gold); }
.step.is-active span { color: var(--ink); background: var(--gold); }

.logout { display: flex; margin-left: auto; }
.logout__button { padding: 0 16px; border: 0; color: var(--on-dark-muted); background: transparent; font-size: 13px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.logout__button:hover { color: var(--gold); }

/* Logowanie */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: min(400px, 100%); }
.brand--login { align-items: center; padding: 22px; }
.login__form { display: grid; gap: 12px; padding: 28px; background: var(--bar); border-top: 4px solid var(--gold); }
.login__form label { color: var(--on-dark); font-weight: 500; }
.login__form input { min-height: 46px; padding: 10px 12px; border: 1px solid var(--card-dark); border-radius: 0; color: var(--ink); background: var(--surface); }
.login__form input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 2px rgba(238, 177, 17, .35); }
.login__form .button { margin-top: 6px; }
.login__error { margin: 0; padding: 10px 12px; color: var(--on-dark); background: var(--danger); }

/* Hero */
.hero__inner { width: min(1180px, calc(100% - 32px)); margin: 16px auto 0; padding: 48px 44px 52px; color: var(--on-dark); background: linear-gradient(120deg, #1d1c20 0%, var(--bar) 100%); border-left: 6px solid var(--gold); }
.eyebrow, .section-number { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow { color: var(--gold); }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(30px, 4vw, 46px); font-weight: 700; line-height: 1.1; }
.hero p { max-width: 700px; margin: 18px 0 0; color: var(--on-dark-muted); font-size: 17px; font-weight: 300; line-height: 1.6; }

/* Panele kroków */
.container { width: min(1180px, calc(100% - 32px)); margin: 16px auto 64px; }
.panel { margin-top: 16px; padding: 34px; background: var(--surface); }
.panel__heading { display: flex; justify-content: space-between; gap: 32px; align-items: end; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.panel__heading h2 { margin: 0; font-size: 26px; font-weight: 700; }
.panel__heading p { max-width: 440px; margin: 0; color: var(--muted); line-height: 1.55; }
.section-number { color: var(--gold-dark); margin-bottom: 6px; }

.upload-grid { display: grid; grid-template-columns: 1fr; gap: 18px; max-width: 540px; margin: 0 auto; }
.file-card { min-height: 210px; padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; border: 2px dashed var(--line); background: var(--soft); transition: border-color .2s; }
.file-card:hover { border-color: var(--gold); }
.file-card input { width: min(100%, 320px); margin-top: 10px; color: var(--muted); }
.file-card__icon { display: grid; place-items: center; width: 58px; height: 58px; color: var(--on-dark); background: var(--navy); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.file-card span:not(.file-card__icon) { color: var(--muted); font-size: 14px; }

/* Przyciski: złoty jak akcenty na stronie, z ciemnym tekstem dla kontrastu */
.button { display: inline-block; border: 0; border-radius: 0; padding: 12px 20px; text-decoration: none; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; transition: background .18s; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button--primary { color: var(--ink); background: var(--gold); }
.button--primary:hover:not(:disabled) { background: var(--gold-dark); }
.button--ghost { color: var(--ink); background: var(--soft); border: 1px solid var(--line); }
.button--ghost:hover:not(:disabled) { border-color: var(--card-dark); }
.button--wide { grid-column: 1 / -1; justify-self: center; min-width: 260px; }
.button--large { padding: 16px 28px; font-size: 16px; }

/* Podsumowanie jak kafle produktów: szare tło, biały tekst */
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.summary-card { padding: 18px; color: var(--on-dark); background: var(--card-dark); }
.summary-card span { display: block; color: var(--on-dark-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.summary-card strong { display: block; margin-top: 7px; font-size: 18px; font-weight: 500; overflow-wrap: anywhere; }

.sheet-info { margin: 0 0 18px; padding: 12px 16px; color: var(--ink); background: var(--soft); border-left: 4px solid var(--navy); }
.sheet-info--error { color: var(--danger); border-left-color: var(--danger); font-weight: 500; }
.category-info { color: var(--muted); font-weight: 300; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 18px; margin-bottom: 22px; }
.form-grid label:not(.check-row) { display: grid; align-content: start; gap: 8px; font-weight: 500; }
select, input[type='search'] { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: var(--surface); }
select:focus, input[type='search']:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 2px var(--navy-soft); }
.check-row { display: flex; align-items: center; gap: 10px; color: var(--ink); }
input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--navy); }

#variables-preview { margin-top: 26px; }
.variable-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.variable-chip { padding: 12px 14px; border-left: 4px solid var(--gold); background: var(--soft); }
.variable-chip strong { color: var(--navy); font-weight: 500; }
.variable-chip small { color: var(--muted); }
.warning-list { margin-top: 16px; padding: 15px 18px 15px 34px; color: #6b4a00; background: #fdf3d6; border-left: 4px solid var(--gold); }
.warning-list li + li { margin-top: 8px; }
h3 { margin: 26px 0 14px; font-size: 16px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }


.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 24px 0 14px; }
.toolbar input { flex: 1 1 240px; }
.selected-count { margin-left: auto; padding: 8px 12px; color: var(--ink); background: var(--gold); font-weight: 500; }
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { position: sticky; top: 0; padding: 12px; text-align: left; color: var(--on-dark); background: var(--bar); font-weight: 500; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: var(--soft); }
tr.is-selected td { background: #fdf3d6; }
.photo-badge { display: inline-block; padding: 2px 8px; color: var(--on-dark); background: var(--navy); font-size: 12px; font-weight: 500; }
.photo-badge--missing { color: var(--ink); background: var(--line); }
.order-buttons { display: flex; gap: 4px; }
.order-buttons button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); }
.order-buttons button:hover { border-color: var(--gold); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 16px 0 24px; color: var(--muted); }

.progress-card, .result-card { margin-top: 24px; padding: 22px; background: var(--soft); border-left: 4px solid var(--navy); }
.progress-line { display: flex; justify-content: space-between; margin-bottom: 10px; }
.progress-track { height: 10px; overflow: hidden; background: var(--line); }
#progress-bar { width: 0; height: 100%; background: var(--gold); transition: width .3s; }
.result-card { border-left-color: var(--gold); }
.result-card h3 { margin-top: 0; color: var(--navy); }
.result-actions { display: flex; gap: 10px; margin-top: 18px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 420px; padding: 15px 18px; color: var(--on-dark); background: var(--danger); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); z-index: 10; }

@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr; }
  .steps { overflow-x: auto; padding: 0; }
  .step { padding: 12px; white-space: nowrap; }
}
@media (max-width: 760px) {
  .hero__inner { padding: 32px 22px; }
  .panel { padding: 22px; }
  .panel__heading { display: block; }
  .panel__heading p { margin-top: 12px; }
  .upload-grid, .form-grid, .summary-grid { grid-template-columns: 1fr; }
  .button--wide { grid-column: auto; }
}
