:root {
  /* Brand Colors (DepoPin Swiss Clean Elevation) */
  --brand-primary: #4F46E5;
  --brand-primary-hover: #4338CA;
  --brand-deep: #1E1B6E;
  --brand-accent: #06B6D4;
  --brand-accent-soft: #ECFEFF;

  /* Backgrounds & Surfaces */
  --bg-app: #F4F6FB;
  --bg-surface: #FFFFFF;
  --bg-dropzone-active: #EEF2FF;
  --border-subtle: #E2E8F0;
  --border-focus: #4F46E5;

  /* Typography */
  --text-main: #090D16;
  --text-secondary: #475569;
  --text-muted: #64748B;

  /* Statuses (PDF Validation & Zero-Retention) */
  --status-success: #10B981;
  --status-success-bg: #ECFDF5;
  --status-warning: #F59E0B;
  --status-warning-bg: #FFFBEB;
  --status-danger: #F43F5E;
  --status-danger-bg: #FFF1F2;

  /* Shadows (Swiss Clean Elevation) */
  --shadow-card: 0 4px 20px -2px rgba(9, 13, 22, 0.05), 0 1px 3px -1px rgba(9, 13, 22, 0.03);
  --shadow-button: 0 4px 12px rgba(79, 70, 229, 0.25);

  /* Mapowanie kompatybilności wszystkich komponentów UI */
  --bg-main: var(--bg-app);
  --bg-elevated: #EAF0F8;
  --bg-card: var(--bg-surface);
  --bg-input: var(--bg-surface);
  --violet-primary: var(--brand-primary);
  --violet-hover: var(--brand-primary-hover);
  --violet-light: var(--brand-accent);
  --violet-glow: var(--bg-dropzone-active);
  --emerald: var(--status-success);
  --emerald-bg: var(--status-success-bg);
  --amber: var(--status-warning);
  --amber-bg: var(--status-warning-bg);
  --danger: var(--status-danger);
  --danger-bg: var(--status-danger-bg);
}

[data-theme="dark"] {
  --brand-primary: #6366F1;
  --brand-primary-hover: #4F46E5;
  --brand-deep: #1E1B6E;
  --brand-accent: #06B6D4;
  --brand-accent-soft: rgba(6, 182, 212, 0.14);

  --bg-app: #0B0F19;
  --bg-surface: #131B2E;
  --bg-dropzone-active: rgba(79, 70, 229, 0.16);
  --border-subtle: #243049;
  --border-focus: #6366F1;

  --text-main: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --status-success: #10B981;
  --status-success-bg: rgba(16, 185, 129, 0.14);
  --status-warning: #F59E0B;
  --status-warning-bg: rgba(245, 158, 11, 0.14);
  --status-danger: #F43F5E;
  --status-danger-bg: rgba(244, 63, 94, 0.14);

  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
  --shadow-button: 0 4px 14px rgba(99, 102, 241, 0.35);

  --bg-main: var(--bg-app);
  --bg-elevated: #19233A;
  --bg-card: var(--bg-surface);
  --bg-input: #0F1626;
  --violet-primary: var(--brand-primary);
  --violet-hover: var(--brand-primary-hover);
  --violet-light: var(--brand-accent);
  --violet-glow: var(--bg-dropzone-active);
  --emerald: var(--status-success);
  --emerald-bg: var(--status-success-bg);
  --amber: var(--status-warning);
  --amber-bg: var(--status-warning-bg);
  --danger: var(--status-danger);
  --danger-bg: var(--status-danger-bg);
}

/* Automatyczne przełączanie logo jasnego i ciemnego */
.brand-logo-img {
  height: 38px;
  width: auto;
  display: block;
}
.logo-for-dark {
  display: none !important;
}
[data-theme="dark"] .logo-for-light {
  display: none !important;
}
[data-theme="dark"] .logo-for-dark {
  display: block !important;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-main);
  background-image: radial-gradient(ellipse 80% 45% at 50% -10%, var(--violet-glow), transparent);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; }

.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--border-subtle); gap: 12px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  color: var(--text-main); font-weight: 800; font-size: 19px; letter-spacing: -0.02em;
}
.brand-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-deep));
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.28); flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--violet-primary); }

.hero { padding: 56px 0 44px; text-align: center; max-width: 860px; margin: 0 auto; }
.pill-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--violet-glow); border: 1px solid rgba(109, 40, 217, 0.25);
  color: var(--violet-light); padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(28px, 4vw, 46px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.18; margin-bottom: 18px; }
.hero p { font-size: 17px; color: var(--text-secondary); margin-bottom: 28px; }

/* Sztywne i symetryczne siatki (Naprawa problemu 3+1 kart!) */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 14px; padding: 24px; box-shadow: var(--shadow-card);
  transition: border-color 0.2s, transform 0.2s;
}
.card-featured { border: 2px solid var(--violet-primary); position: relative; }
.icon-box {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--violet-glow); color: var(--violet-primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px; flex-shrink: 0;
}
[data-theme="dark"] .icon-box { color: var(--violet-light); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: all 0.2s;
}
.btn-primary { background: var(--violet-primary); color: #fff !important; box-shadow: var(--shadow-button); }
.btn-primary:hover { background: var(--violet-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text-main); border-color: var(--border-subtle); }
.btn-secondary:hover { border-color: var(--violet-primary); color: var(--violet-primary); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(220, 38, 38, 0.25); }
.btn-danger:hover { background: var(--danger); color: #fff !important; }
.btn-full { width: 100%; }
.theme-toggle { padding: 8px 10px; border-radius: 8px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-main); cursor: pointer; display: inline-flex; align-items: center; }

.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 8px;
  background: var(--bg-input); border: 1px solid var(--border-subtle);
  color: var(--text-main); font-size: 14px; margin-bottom: 14px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--violet-glow); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-emerald { background: var(--emerald-bg); color: var(--emerald); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-violet { background: var(--violet-glow); color: var(--violet-primary); }
[data-theme="dark"] .badge-violet { color: var(--violet-light); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.65); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 16px; max-width: 580px; width: 100%; padding: 28px; box-shadow: var(--shadow-card); max-height: 92vh; overflow-y: auto; }
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; font-weight: 500; }
.alert-err { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220,38,38,0.25); }
.alert-ok { background: var(--emerald-bg); color: var(--emerald); border: 1px solid rgba(5,150,105,0.25); }
.hidden { display: none !important; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.feature-list { list-style: none; margin: 16px 0; }
.feature-list li { display: block !important; position: relative; padding-left: 26px; font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.55; }
.feature-list li .li-marker { position: absolute; left: 0; top: 1px; font-weight: 800; }

/* Os czasu na stronie glownej */
.process-timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; position: relative; margin-top: 20px; }
.process-step { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 22px; box-shadow: var(--shadow-card); }
.step-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-primary), var(--brand-deep)); color: #fff; font-weight: 800; font-size: 13.5px; display: flex; align-items: center; justify-content: center; }
.step-num.step-final { background: linear-gradient(135deg, var(--emerald), #047857); }

/* KREATOR SPRAWY KROK PO KROKU (WIZARD) */
.wizard-steps-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.wizard-step-pill { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border-subtle); background: var(--bg-elevated); font-size: 13.5px; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }
.wizard-step-pill.active { border-color: var(--violet-primary); background: var(--violet-glow); color: var(--violet-primary); }
[data-theme="dark"] .wizard-step-pill.active { color: var(--violet-light); }
.wizard-step-pill.done { border-color: var(--emerald); background: var(--emerald-bg); color: var(--emerald); }
.wizard-circle { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-card); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }

/* UKLAD USTAWIEN KONTA Z BOCZNA NAWIGACJA */
.settings-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 6px; background: var(--bg-card); padding: 12px; border-radius: 12px; border: 1px solid var(--border-subtle); }
.settings-nav-btn { text-align: left; padding: 11px 14px; border-radius: 8px; border: none; background: transparent; color: var(--text-secondary); font-size: 13.5px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all 0.15s; }
.settings-nav-btn:hover { background: var(--bg-elevated); color: var(--text-main); }
.settings-nav-btn.active { background: var(--violet-glow); color: var(--violet-primary); }
[data-theme="dark"] .settings-nav-btn.active { color: var(--violet-light); }

/* Przelaczniki suwakowe i paski postepu */
.toggle-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-secondary); padding: 6px 12px; border-radius: 8px; background: var(--bg-main); border: 1px solid var(--border-subtle); }
.toggle-row input { display: none; }
.toggle-switch { width: 36px; height: 20px; background: var(--border-subtle); border-radius: 999px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle-switch::after { content: ""; width: 14px; height: 14px; background: #fff; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: transform 0.2s; }
.toggle-row input:checked + .toggle-switch { background: var(--violet-primary); }
.toggle-row input:checked + .toggle-switch::after { transform: translateX(16px); }
.case-progress-track { width: 100%; height: 8px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; margin: 10px 0 14px; border: 1px solid var(--border-subtle); }
.case-progress-fill { height: 100%; background: linear-gradient(90deg, var(--violet-primary), var(--emerald)); transition: width 0.3s; }
.tpl-item-row { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 14px; margin-bottom: 10px; }

/* PELNA RESPONSYWNOSC MOBILNA (Smartfony i Tablety) */
@media (max-width: 960px) {
  .grid-3, .grid-4, .process-timeline { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4, .process-timeline, .wizard-steps-bar { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 28px; }
  .card { padding: 18px; }
  .navbar { flex-direction: column; align-items: stretch; }
  .nav-links { justify-content: space-between; width: 100%; }
}

/* Naprawa ikony w pastylce nad naglowkiem na telefonach */
.pill-badge svg { flex-shrink: 0; }

/* Interaktywne karty cennika (podswietlenie po kliknieciu) */
.pricing-card {
  cursor: pointer;
  transition: all 0.22s ease;
}
.pricing-card.card-featured {
  border: 2px solid var(--violet-primary) !important;
  box-shadow: 0 10px 30px -4px rgba(109, 40, 217, 0.22);
  transform: translateY(-3px);
}

/* Kwadratowy przycisk ikony (Samouczek '?' oraz Przelacznik motywu) */
.icon-only-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.icon-only-btn:hover {
  border-color: var(--violet-primary);
  color: var(--violet-primary);
}

/* Naprawa gornej belki menu na urzadzeniach mobilnych */
@media (max-width: 768px) {
  .navbar {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 14px 0 !important;
    gap: 12px !important;
  }
  .nav-links {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center !important;
    align-items: center;
    gap: 8px !important;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
  }
  .nav-links a:not(.btn) {
    font-size: 13px;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
  }
  .pill-badge {
    font-size: 12px;
    padding: 6px 12px;
    text-align: left;
  }
}

/* Strefa wgrywania plikow dla Klienta (Drag & Drop + Mobile) */
.upload-zone {
  border: 2px dashed var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-top: 12px;
  display: block;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--violet-primary);
  background: var(--violet-glow);
}
.upload-zone input[type="file"] {
  display: none;
}
.pin-boxes-input {
  font-size: 24px !important;
  font-weight: 800;
  text-align: center;
  letter-spacing: 8px;
  padding: 14px !important;
  max-width: 280px;
  margin: 0 auto 18px !important;
  display: block;
}
.client-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}
.client-item-card.status-uploaded {
  border-left: 5px solid var(--emerald);
}
.client-item-card.status-rejected {
  border-left: 5px solid var(--danger);
}
.client-item-card.status-pending {
  border-left: 5px solid var(--violet-primary);
}

/* Pasek Cooldownu Powiadomien i Centrum Komunikacji */
.cooldown-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.cooldown-track {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
}
.cooldown-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--violet-primary));
  transition: width 0.4s ease;
}

/* Pastylki kategorii szablonow */
.cat-pills-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cat-pill {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.cat-pill:hover, .cat-pill.active {
  background: var(--violet-primary);
  color: #fff;
  border-color: var(--violet-primary);
}

/* Boks czystego wniosku do pobrania dla klienta */
.blank-form-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--violet-glow);
  border: 1px solid rgba(109, 40, 217, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 10px 0;
}

/* Przelacznik Rozliczenie Roczne (-20%) / Miesieczne */
.billing-cycle-wrap {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 5px;
  border-radius: 999px;
  margin-bottom: 28px;
  gap: 4px;
}
.cycle-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cycle-tab-btn.active {
  background: var(--violet-primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(109, 40, 217, 0.28);
}
.price-old-strike {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 600;
  margin-right: 8px;
}
.price-Save-pill {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald);
}

/* Przejrzysta karta pozycji dokumentowej w kreatorze (Pelna szerokosc pol) */
.item-builder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}
.item-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.bank-attach-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 10px 12px;
  margin-top: 10px;
}

/* Idealne wyrownanie kafelkow cennika (Flexbox + Floating Badge) */
.pricing-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  padding-top: 30px;
}
.pricing-floating-badge {
  position: absolute;
  top: -13px;
  right: 22px;
  background: var(--violet-primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(109, 40, 217, 0.3);
}
.pricing-head-block {
  min-height: 76px;
}
.pricing-price-block {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.pricing-card .feature-list {
  flex-grow: 1;
  margin-top: 0;
  margin-bottom: 22px;
}
.pricing-footer-note {
  margin-top: 28px;
  text-align: center;
  font-size: 14.5px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

/* Przywrocenie widocznej linii osi czasu (Timeline) miedzy krokami na desktopach */
.process-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  position: relative;
  margin-top: 24px;
}
.process-step {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
}
@media (min-width: 961px) {
  .process-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 42px;
    right: -23px;
    width: 23px;
    height: 3px;
    background: linear-gradient(90deg, var(--violet-primary), var(--emerald));
    z-index: 2;
  }
}

/* Naprawa wyrownania pol w koszyku rejestracji B2B (rowna wysokosc w wierszach) */
.form-grid-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 12px;
  align-items: end;
}
.form-grid-row-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1.3fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: end;
}
.form-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.form-col input, .form-col select {
  margin-bottom: 0 !important;
}
@media (max-width: 680px) {
  .form-grid-row, .form-grid-row-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Rozbudowana stopka komercyjna (4 kolumny) */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 52px 0 32px;
  margin-top: 40px;
  color: var(--text-secondary);
  font-size: 13.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 28px;
  margin-bottom: 32px;
}
.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}
.footer-links {
  list-style: none;
}
.footer-links li {
  margin-bottom: 8px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover {
  color: var(--violet-primary);
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Wyroznienie spraw gotowych do pobrania i zamkniecia w Rejestrze Spraw */
.case-card-ready {
  border: 2px solid var(--emerald) !important;
  box-shadow: 0 8px 28px -4px rgba(5, 150, 105, 0.18) !important;
}
.ready-banner-strip {
  background: var(--emerald-bg);
  border: 1px solid rgba(5, 150, 105, 0.35);
  color: var(--emerald);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Przelacznik Aktywne / Wszystkie sprawy oraz Dzwonek Powiadomien */
.filter-segmented {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 4px;
  gap: 4px;
}
.filter-seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.filter-seg-btn.active {
  background: var(--violet-primary);
  color: #fff;
}
.notif-bell-wrap {
  position: relative;
  display: inline-flex;
}
.notif-badge-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-main);
}

/* Blokada poziomego rozjezdzania ekranu na smartfonach */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Przycisk X w prawym gornym rogu okienka modalnego */
.modal-card {
  position: relative;
}
.modal-close-x {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
  padding: 0;
  z-index: 60;
}
.modal-close-x:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

/* Zawsze widoczny (Sticky) komunikat o bledach w koszyku */
.sticky-modal-alert {
  position: sticky;
  top: -10px;
  z-index: 55;
  box-shadow: 0 10px 25px -4px rgba(220, 38, 38, 0.35);
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 2px solid #dc2626 !important;
}
[data-theme="dark"] .sticky-modal-alert {
  background: #3b1219 !important;
  color: #fca5a5 !important;
  border-color: #ef4444 !important;
}

/* Nowoczesny 3-kolumnowy pasek gwarancji pod cennikiem */
.trust-strip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
}
.trust-strip-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-card);
}
.trust-strip-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--violet-glow);
  color: var(--violet-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Suwak licencji dla Pakietu Organizacja / Koordynator */
.coord-slider-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
input[type="range"].license-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--border-subtle);
  border-radius: 999px;
  outline: none;
  padding: 0;
  margin: 10px 0 6px;
  border: none;
}
input[type="range"].license-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--violet-primary);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.45);
}

/* Przelacznik Konto Firmowe / Konto Indywidualne w Koszyku */
.account-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-elevated);
  padding: 5px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}
.acc-type-btn {
  padding: 9px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}
.acc-type-btn.active {
  background: var(--bg-card);
  color: var(--violet-primary);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* Kompleksowe reguly mobilne na samym dole arkusza (Gwarancja pierwszenstwa na smartfonach!) */
@media (max-width: 960px) {
  .process-timeline, .grid-3, .grid-4, .trust-strip-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 720px) {
  .container, .container-narrow {
    padding: 0 14px !important;
  }
  .process-timeline, .grid-2, .grid-3, .grid-4, .trust-strip-grid, .wizard-steps-bar {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .process-step::after {
    display: none !important;
  }
  .card, .process-step {
    padding: 18px 16px !important;
  }
  .showcase-outer-card {
    padding: 20px 14px !important;
  }
  .modal-backdrop {
    padding: 10px !important;
  }
  .modal-card {
    padding: 20px 16px !important;
    max-height: 94vh !important;
  }
  .billing-cycle-wrap {
    display: flex !important;
    flex-direction: column !important;
    border-radius: 14px !important;
    width: 100% !important;
  }
  .cycle-tab-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Jednolity, wspolny baner pod cennikiem (nie sugeruje podzialu na kolumny pakietow) */
.unified-guarantee-banner {
  margin-top: 32px;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.06), rgba(5, 150, 105, 0.06));
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--violet-primary);
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: var(--shadow-card);
}
.unified-guarantee-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}
.unified-guarantee-points {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.unified-guarantee-points div {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Idealne wyrownanie wierszy formularza w koszyku (bez przesuwania pola hasla) */
.form-grid-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 12px;
  align-items: start !important;
}
.form-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.form-col .field-label {
  min-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bogaty wyglad okienek Samouczka i Informacji '?' */
.rich-guide-header {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-deep));
  color: #fff;
  padding: 22px 24px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.rich-guide-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.rich-guide-num {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--violet-primary);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Przestronny, czytelny Empty State dla nowego konta bez spraw */
.empty-state-box {
  background: var(--bg-card);
  border: 2px dashed var(--border-subtle);
  border-radius: 16px;
  padding: 56px 24px;
  text-align: center;
  margin: 16px 0 32px;
  min-height: 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--violet-glow);
  color: var(--violet-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* NOWOCZESNE MENU MOBILNE (HAMBURGER DRAWER) NA STRONIE GLOWNEJ */
.mobile-menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.mobile-nav-drawer {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
  margin-top: 10px;
  box-shadow: var(--shadow-card);
}
.mobile-nav-drawer a {
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  background: var(--bg-elevated);
}
.mobile-nav-drawer .btn-primary {
  color: #fff !important;
  text-align: center;
  margin-top: 4px;
}

/* NAPRAWA BANERA POD PAKIETAMI NA TELEFONACH (Image 8) */
.unified-guarantee-header svg {
  flex-shrink: 0;
}
.unified-guarantee-points {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.unified-guarantee-points > div {
  display: block !important;
  position: relative;
  padding-left: 24px;
  line-height: 1.5;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.unified-guarantee-points > div .ug-check {
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--emerald);
  font-weight: 800;
}

/* CZERWONY BANER OSTRZEGAWCZY NIEUDANEJ PLATNOSCI (5 DNI DO BLOKADY) */
.past-due-red-banner {
  background: linear-gradient(90deg, #991b1b, #dc2626);
  color: #fff;
  padding: 12px 20px;
  font-size: 13.5px;
  border-bottom: 2px solid #7f1d1d;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.35);
}

/* TWARDA BLOKADA DOSTEPU (HARD SUBSCRIPTION LOCK SCREEN) */
.lock-screen-card {
  max-width: 620px;
  margin: 44px auto;
  border: 2px solid var(--danger) !important;
  box-shadow: 0 18px 45px -10px rgba(220, 38, 38, 0.25) !important;
  text-align: center;
  padding: 36px 28px !important;
}

/* NAPRAWA WYPYCHANIA FORMULARZA KOSZYKA POZA EKRAN TELEFONU (Image 7) */
.form-grid-row, .form-grid-row-3, .form-col {
  min-width: 0 !important;
  max-width: 100% !important;
}
.form-col .field-label {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.35 !important;
  min-height: 0 !important;
  margin-bottom: 6px !important;
}
.form-col input, .form-col select {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 860px) {
  .unified-guarantee-points {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

@media (max-width: 768px) {
  /* Czysty, jednolinijkowy pasek nawigacji na telefonach */
  .landing-desktop-links {
    display: none !important;
  }
  .mobile-menu-toggle {
    display: inline-flex !important;
  }
  .mobile-nav-drawer.open {
    display: flex !important;
  }
  .navbar {
    flex-wrap: nowrap !important;
    padding: 12px 0 !important;
  }
  .panel-top-actions {
    width: auto !important;
    border-top: none !important;
    padding-top: 0 !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  .panel-top-actions .btn span {
    display: none !important;
  }
  /* Wszystkie wiersze formularza w koszyku i ustawieniach układają się w 1 czystą kolumnę (100% szerokości) */
  .form-grid-row, .form-grid-row-3 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}

/* INTERAKTYWNE KARTY-BANERY NAWIGACYJNE (Zamiast surowych przyciskow tekstowych) */
.nav-banner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.nav-banner-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card);
  width: 100%;
}
.nav-banner-card:hover {
  border-color: var(--violet-light);
  transform: translateY(-2px);
}
.nav-banner-card.active {
  border: 2px solid var(--violet-primary);
  background: linear-gradient(135deg, var(--violet-glow), var(--bg-card));
  box-shadow: 0 8px 24px -4px rgba(109, 40, 217, 0.2);
}
.nav-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.nav-banner-card.active .nav-banner-icon {
  background: var(--violet-primary);
  border-color: var(--violet-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.35);
}
.nav-banner-title {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 3px;
  line-height: 1.25;
}
.nav-banner-card.active .nav-banner-title {
  color: var(--violet-primary);
}
[data-theme="dark"] .nav-banner-card.active .nav-banner-title {
  color: var(--violet-light);
}
.nav-banner-sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ZINTEGROWANY PASEK NARZEDZIOWY NAD REJESTREM SPRAW */
.toolbar-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* KARTY BOCZNEGO MENU USTAWIEN (Z ikonami i opisem zamiast cyfr 1, 2, 3, 4) */
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  padding: 0;
  border: none;
}
.settings-nav-btn {
  text-align: left;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.18s;
  box-shadow: var(--shadow-card);
}
.settings-nav-btn:hover {
  border-color: var(--violet-light);
}
.settings-nav-btn.active {
  border: 2px solid var(--violet-primary);
  background: linear-gradient(135deg, var(--violet-glow), var(--bg-card));
}
.settings-nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--violet-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-nav-btn.active .settings-nav-icon {
  background: var(--violet-primary);
  color: #fff;
}

@media (max-width: 920px) {
  .nav-banner-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .toolbar-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-left, .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }
}
