/* ForceKit — warstwa na oficjalnym Salesforce Lightning Design System (SLDS).
   SLDS ładuje się pierwszy (public/slds), ten plik nakłada layout powłoki,
   akcenty kategorii i drobne korekty. */

:root {
  --bg: #f3f2f2;
  --surface: #ffffff;
  --surface-alt: #fafaf9;
  --border: #dddbda;
  --border-strong: #c9c7c5;
  --text: #181818;
  --heading: #16325c;
  --text-muted: #706e6b;
  --primary: #0176d3;
  --primary-hover: #014486;
  --primary-soft: #eaf3fe;
  --accent: #2e844a;
  --danger: #ba0517;
  --warning: #dd7a01;
  --radius: 8px;
  /* Wysokość paska: global header (~50px) + context bar (~40px). */
  --header-h: 90px;
  --sidebar-w: 288px;
  --maxw: 1120px;
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --font: "Salesforce Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  min-height: 100vh;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1, h2, h3 {
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 300;
}
h2 {
  font-size: 1.25rem;
  font-weight: 700;
}
p {
  color: var(--text-muted);
}

/* ====================== Header (SLDS global header + context bar) ====================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
}
.slds-global-header.slds-grid {
  align-items: center;
  height: 50px;
  padding: 0 1rem;
  background: var(--header-bg, #fff);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: 0.4rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--heading);
  background: none;
  width: auto;
  height: auto;
}
.brand:hover {
  text-decoration: none;
}
.slds-global-header__item_search {
  flex: 1;
  max-width: 520px;
  margin: 0 1rem;
}
.slds-global-header__item_search .slds-input {
  border-radius: 999px;
}
.sf-global-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.sf-link {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.sf-link:hover {
  color: var(--primary);
  text-decoration: none;
}
.sf-app-name {
  font-weight: 700;
  /* Pasek kontekstowy ma białe tło, więc nazwa aplikacji musi być ciemna,
     inaczej biały tekst SLDS (.slds-context-bar__label-action) jest niewidoczny. */
  color: var(--heading);
}
/* Wyrównanie App Launchera (kropki) i nazwy do środka paska w pionie. */
.slds-context-bar__primary {
  align-items: center;
}
.sf-app-launcher {
  display: flex;
  align-items: center;
}
/* SLDS centruje siatkę kropek tylko w poziomie (margin-inline:auto),
   więc w pionie ląduje przy górze kontenera — wymuszamy środek. */
.sf-app-launcher .slds-icon-waffle_container {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sf-launcher-trigger {
  background: none;
}

/* ====================== App Launcher (modal) ====================== */
.sf-launcher-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 7vh 1rem 3vh;
  overflow-y: auto;
}
.sf-launcher-modal {
  position: relative;
  width: 100%;
  max-width: 1140px;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}
.sf-launcher-head {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 3.25rem 1.25rem 1.5rem;
}
.sf-launcher-title {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--heading);
  margin: 0;
  white-space: nowrap;
}
.sf-launcher-search {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
}
.sf-launcher-search .slds-input {
  border-radius: 999px;
}
.sf-launcher-close {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  background: transparent;
}
.sf-launcher-close:hover {
  color: var(--heading);
  background: var(--surface-alt);
}
.sf-launcher-close .slds-icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}
.sf-launcher-body {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.sf-launcher-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 1rem;
}
.sf-launcher-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem 1rem;
}
.sf-launcher-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border-radius: 6px;
  background: var(--surface-alt);
  border: 1px solid transparent;
}
.sf-launcher-card:hover {
  text-decoration: none;
  background: var(--primary-soft);
  border-color: var(--border);
}
.sf-launcher-tile {
  flex: 0 0 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.sf-launcher-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sf-launcher-name {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
}
.sf-launcher-card:hover .sf-launcher-name {
  text-decoration: underline;
}
.sf-launcher-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.3;
}
.sf-launcher-empty {
  color: var(--text-muted);
  padding: 1rem 0;
}
@media (max-width: 900px) {
  .sf-launcher-grid { grid-template-columns: 1fr; }
  .sf-launcher-head { flex-wrap: wrap; gap: 0.75rem; }
  .sf-launcher-search { max-width: none; order: 3; flex-basis: 100%; }
}

/* Burger tylko na mobile. */
.sf-burger {
  display: none;
}

/* ====================== Powłoka: sidebar + treść ====================== */
.app-shell {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - var(--header-h));
}

.sf-sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
  padding-bottom: 2rem;
}
.sf-quickfind-wrap {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.sf-quickfind-wrap .slds-input {
  border-radius: 6px;
}

/* Kafelek z emoji-ikoną narzędzia w nawigacji. */
.sf-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-inline-end: 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1;
}
.sf-item-icon {
  margin-inline-end: 0.6rem;
}
.slds-nav-vertical__action {
  display: flex;
  align-items: center;
}
.sf-nav-empty {
  font-size: 0.85rem;
}

/* Przyciemnienie tła pod wysuniętym sidebarem (mobile). */
.sf-scrim {
  position: fixed;
  inset: var(--header-h) 0 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 40;
}

/* ----- Główna treść ----- */
.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 380px at 100% -5%, rgba(1, 118, 211, 0.06), transparent 60%),
    var(--bg);
}
.content-inner {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 2rem 2rem;
}

/* ====================== Strona główna ====================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(46, 132, 74, 0.1);
  border: 1px solid rgba(46, 132, 74, 0.25);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
}
.welcome {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}
.welcome h1 {
  margin-top: 0.4rem;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
}
.welcome p.lead {
  font-size: 0.92rem;
  max-width: 620px;
  margin: 0.4rem auto 0;
}
.section-title {
  margin: 1rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.05rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.card {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 3px;
  background: var(--accent-color, var(--primary));
}
.card:hover {
  border-color: var(--accent-color, var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}
.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  font-size: 1.5rem;
  background: color-mix(in srgb, var(--accent-color, var(--primary)) 14%, white);
  border: 1px solid color-mix(in srgb, var(--accent-color, var(--primary)) 30%, transparent);
}
.card .cat {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}
.card h3 {
  color: var(--heading);
  margin: 0.2rem 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.card p {
  margin: 0;
  font-size: 0.9rem;
}

/* ====================== Strona narzędzia ====================== */
.tool {
  padding: 0.5rem 0 2rem;
  max-width: 820px;
}
.tool-head {
  margin-bottom: 1.5rem;
}
.tool-head .icon {
  font-size: 1.8rem;
}
.tool-head h1 {
  font-weight: 600;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ====================== Formularze (strony narzędzi, bez klas .slds-) ====================== */
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--heading);
}
textarea,
input[type="text"]:not(.slds-input),
input[type="number"]:not(.slds-input),
select:not(.slds-select) {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: var(--font);
}
textarea {
  font-family: var(--mono);
  resize: vertical;
  min-height: 140px;
}
textarea:focus,
input[type="text"]:not(.slds-input):focus,
input[type="number"]:not(.slds-input):focus,
select:not(.slds-select):focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.field {
  margin-bottom: 1.1rem;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; }
}
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  margin: 0.5rem 0 1rem;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 400;
  font-size: 0.9rem;
  margin: 0;
  color: var(--text);
  cursor: pointer;
}
.checkbox input {
  width: auto;
  accent-color: var(--primary);
}

/* Przyciski na stronach narzędzi (nie używają klas .slds-button). */
.content button:not(.slds-button),
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  line-height: 1.4;
}
.content button:not(.slds-button):hover,
.btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  text-decoration: none;
}
.content button.secondary,
.btn.secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border-strong);
}
.content button.secondary:hover {
  background: var(--surface-alt);
  border-color: var(--primary);
}
.btn-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ====================== Wyniki ====================== */
.output {
  margin-top: 1.5rem;
}
pre.result {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: var(--text);
}
.result-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-family: var(--mono);
  font-size: 1.05rem;
}
.result-field .val {
  flex: 1;
  user-select: all;
  word-break: break-all;
}
.result-field .label {
  font-family: var(--font);
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.note {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
.warnings {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.warnings li {
  border-inline-start: 3px solid var(--warning);
  background: rgba(221, 122, 1, 0.08);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  color: var(--text);
  border-radius: 6px;
}

/* ====================== Tabele ====================== */
.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.content th,
.content td {
  text-align: start;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.content th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.content tbody tr:hover {
  background: var(--surface-alt);
}
.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-weight: 600;
}
.tag.added { background: rgba(46, 132, 74, 0.15); color: var(--accent); }
.tag.removed { background: rgba(186, 5, 23, 0.12); color: var(--danger); }
.tag.changed { background: rgba(221, 122, 1, 0.15); color: var(--warning); }

.zero-trust {
  border: 1px solid var(--border);
  background: var(--surface);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: var(--shadow-card);
}
.zero-trust strong { color: var(--accent); }

/* ====================== Przełącznik języka ====================== */
.lang {
  position: relative;
}
.lang > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  cursor: pointer;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.85rem;
  user-select: none;
  background: var(--surface);
}
.lang > summary::-webkit-details-marker {
  display: none;
}
.lang > summary:hover {
  color: var(--text);
  border-color: var(--primary);
}
.lang .chev {
  font-size: 0.7rem;
}
.lang[open] > summary .chev {
  transform: rotate(180deg);
}
.lang ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  min-width: 190px;
  max-height: 60vh;
  overflow: auto;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.35);
  z-index: 100;
}
.lang ul a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 7px;
  color: var(--text);
  font-size: 0.9rem;
}
.lang ul a:hover {
  background: var(--surface-alt);
  text-decoration: none;
}
.lang ul a.active {
  color: var(--primary);
  background: var(--primary-soft);
}

/* ====================== Stopka ====================== */
.site-footer {
  position: sticky;
  bottom: 0;
  z-index: 40;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 0.85rem 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.site-footer .container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-footer strong { color: var(--heading); }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

/* ====================== Treść dokumentów ====================== */
.prose p, .prose li { color: var(--text-muted); }
.prose h2 { margin-top: 2rem; }
.prose code {
  font-family: var(--mono);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  font-size: 0.88em;
}

/* ====================== Responsywność ====================== */
@media (max-width: 900px) {
  :root { --header-h: 50px; }
  .slds-context-bar { display: none; }
  .sf-burger {
    display: inline-flex;
  }
  .slds-global-header__item_search {
    max-width: none;
  }
  .sf-sidebar {
    position: fixed;
    inset-inline-start: 0;
    top: var(--header-h);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 24px -8px rgba(0, 0, 0, 0.25);
  }
  [dir="rtl"] .sf-sidebar {
    transform: translateX(100%);
  }
  .sf-sidebar.sf-open {
    transform: translateX(0);
  }
  .content-inner {
    padding: 1.25rem 1.1rem 2rem;
  }
}
@media (min-width: 901px) {
  .sf-scrim { display: none; }
}
@media (max-width: 560px) {
  .brand-name { display: none; }
  .site-footer .container { flex-direction: column; }
}
