/* ==========================================================================
   Warstwa integracyjna nowego designu (index.php).
   Style dla mechanizmow przeniesionych ze starej strony, ktore nie mialy
   odpowiednika w dostarczonym designie: pulsowanie karty "serwer testowy"
   (parametr ?testvps) oraz modal z prezentem (kurs n8n za 1 grosz).
   Uzywa wylacznie tokenow z style.css - zero wlasnych kolorow brandowych.
   ========================================================================== */

/* Cennik: oferta wylacznie roczna - plakietka pod opisem cen. */
#cennik .section-head .offer-only {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--orange-bright);
  background: var(--orange-soft);
  border: 1px solid var(--orange-line);
  border-radius: 100px;
}

/* Cennik: wyroznienie ograniczen planu (np. brak Dockera). */
.ptable .sub-alert { color: #ff5f57; font-weight: 600; }

/* Terminal w hero tylko na desktopie. Selektor musi trafic w .hero-aside, nie w stare .hero-grid. */
@media (max-width: 940px) {
  .hero-aside .terminal { display: none; }
}

/* NextCloud: ograniczenie oferty - ma byc dobrze widoczne pod cennikiem. */
.nc-limit {
  max-width: 780px;
  margin: 18px auto 0;
  padding: 14px 20px;
  text-align: center;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text-strong);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.nc-limit code {
  color: var(--orange-bright);
}

/* FROG: bez zielonego wyróznienia (ma nie konkurwac z platnymi planami). */
.ptable .pl-price.free { color: inherit; }
.ptable tr.free-row td {
  border-top: 1px solid var(--border);
  background: transparent;
}
.ptable tr.free-row:hover td { background: var(--surface-2); }
.ptable tr.free-row .pl-name { color: inherit; }
.tbadge.free {
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Filary ("Dlaczego Mikrus") reaguja na hover tak samo jak kafle "Mozliwosci":
   podswietlenie tla zamiast unoszenia sie kafla. */
.pillar { transition: border-color .2s, background .2s; }
.pillar:hover { border-color: var(--border-2); background: var(--surface-2); transform: none; }

/* Cennik: cena roczna przeliczona na miesiac pod kwota. */
.ptable .pl-price-main { display: block; }
.ptable .pl-mies {
  display: block;
  margin-top: 2px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
}
@media (max-width: 720px) {
  .ptable td.pl-price { flex-wrap: wrap; }
  .ptable td.pl-price .pl-mies { width: 100%; text-align: right; }
}

/* Cennik: wersja z $outOfStock. */
.ptable .pl-oos-name {
  color: #ff5f57;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.ptable td.pl-name .tbadge.brak {
  display: inline-block;
  margin: 0 0 0 8px;
  vertical-align: middle;
  transform: none;
  background: #ff5f57;
  color: #000;
  box-shadow: none;
  letter-spacing: 0.02em;
}

/* Badge PRO na zielono - pomaranczowy zlewal sie z akcentami cennika. */
.tbadge.pro {
  background: linear-gradient(180deg, #2ee08c, var(--green));
  color: #04140c;
  box-shadow: 0 4px 12px -4px rgba(33, 208, 122, 0.75);
}
@media (max-width: 720px) {
  .ptable tr.free-row {
    border-color: var(--border);
    background: var(--surface);
  }

  /* Na telefonie najpierw 2.1 (najczesciej wybierany), potem 1.0. Desktop bez zmian. */
  .cat-panel[data-panel="vps"] .ptable tbody {
    display: flex;
    flex-direction: column;
  }
  .cat-panel[data-panel="vps"] .ptable tbody tr.plan-m21 { order: -2; }
  .cat-panel[data-panel="vps"] .ptable tbody tr.plan-m10 { order: -1; }
  .ptable tbody tr { scroll-margin-top: 110px; }
}

/* ---------- Regulamin: wyroznienia jak na obecnej stronie ----------
   Numeracja i naglowki punktow glownych w kolorze brandowym, a w punktach
   zagniezdzonych wyroznione fragmenty ("Lista uslug zakazanych" itp.).
   Odpowiednik privacy-policy.css ze starej skorki. */
.doc-content--regulamin > ol > li {
  color: var(--text-strong);
  font-weight: 700;
  margin-top: 36px;
}
.doc-content--regulamin > ol > li:first-child {
  margin-top: 9px;
}
.doc-content--regulamin > ol > li::marker {
  color: var(--orange-bright);
  font-weight: 700;
}
.doc-content--regulamin > ol > li > ol > li {
  color: var(--text);
  font-weight: 400;
}
.doc-content--regulamin > ol > li > ol > li::marker {
  color: currentColor;
  font-weight: 400;
}
.doc-content--regulamin > ol > li > ol > li b,
.doc-content--regulamin > ol > li > ol > li strong {
  color: var(--orange-bright);
  font-weight: 700;
}

/* ---------- Pulsowanie sekcji testowej (?testvps) ---------- */
.risk.is-pulsing { position: relative; isolation: isolate; }
.risk.is-pulsing::before,
.risk.is-pulsing::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--orange);
  box-shadow: 0 0 24px 4px rgba(238, 114, 37, 0.45), 0 0 48px 8px rgba(238, 114, 37, 0.25);
  z-index: -1;
  pointer-events: none;
  will-change: transform, opacity;
  animation: ng-trial-pulse 2.2s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}
.risk.is-pulsing::after { animation-delay: 1.1s; }

@keyframes ng-trial-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.06); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .risk.is-pulsing::before,
  .risk.is-pulsing::after { animation: none; display: none; }
}

/* Puls Wybieram w podswietlonym wierszu cennika (?product=).
   Tylko transform: scale - nie rusza layoutu tabeli. */
.ptable tr.featured a.btn.is-pulsing {
  animation: ng-wybieram-pulse 0.55s ease-in-out 2;
}
@keyframes ng-wybieram-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
@media (prefers-reduced-motion: reduce) {
  .ptable tr.featured a.btn.is-pulsing { animation: none; }
}

/* Kafelek MCP na stronie glownej: dwa lekkie pulsy, gdy wjedzie na srodek.
   Tylko transform + box-shadow - bez ruszania layoutu siatki. */
.feature[data-mcp-pulse].is-pulsing {
  position: relative;
  z-index: 1;
  will-change: transform, box-shadow;
  animation: ng-mcp-pulse 0.7s ease-in-out 2;
}
@keyframes ng-mcp-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 transparent;
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 1px var(--orange-line), 0 12px 28px -12px rgba(238, 114, 37, 0.5);
  }
}
@media (prefers-reduced-motion: reduce) {
  .feature[data-mcp-pulse].is-pulsing { animation: none; will-change: auto; }
}

/* ---------- Modal z prezentem do serwera testowego ---------- */
.ng-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.ng-modal[hidden] { display: none; }
.ng-modal.open { opacity: 1; pointer-events: auto; }

.ng-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 9, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ng-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 30px 26px;
  text-align: center;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 64px -18px rgba(0, 0, 0, 0.75);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.ng-modal.open .ng-modal__dialog { transform: translateY(0) scale(1); }

.ng-modal__close {
  position: absolute;
  top: 6px;
  right: 12px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}
.ng-modal__close:hover { color: var(--text); transform: scale(1.1); }

.ng-modal__title { margin: 0 0 10px; font-size: 22px; line-height: 1.3; }
.ng-modal__title b { color: var(--orange-bright); }
.ng-modal__lead { margin: 0 0 22px; color: var(--muted); font-size: 15px; }

.ng-modal__actions { display: grid; gap: 10px; }
@media (min-width: 640px) {
  .ng-modal__actions { grid-auto-flow: column; justify-content: center; gap: 12px; }
  .ng-modal__actions .btn { min-width: 200px; }
}

body.ng-modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .ng-modal,
  .ng-modal__dialog { transition: none; }
}

/* ---------- "Ktory model wybrac": tabela na desktopie, karty na telefonie ---------- */
.mfit-mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}
.mfit-mark svg { width: 15px; height: 15px; }
.mfit-mark--ok { background: var(--green-soft); color: var(--green); }
.mfit-mark--mid { background: var(--orange-soft); color: var(--orange-bright); }
.mfit-mark--no { background: rgba(255, 95, 87, 0.12); color: #ff5f57; }

.mfit-scroll-hint {
  display: none;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 10px;
}
.mfit-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
}
.mfit-legend li { display: inline-flex; align-items: center; gap: 8px; }
.mfit-legend .mfit-mark { width: 24px; height: 24px; }
.mfit-legend .mfit-mark svg { width: 13px; height: 13px; }

/* ----- Desktop / tablet: klasyczna tabela ----- */
@media (min-width: 761px) {
  .mfit-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-card);
  }
  .mfit {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
  }
  .mfit thead th {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-strong);
    text-align: center;
    padding: 16px 12px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  .mfit thead th:first-child,
  .mfit tbody th {
    text-align: left;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0;
  }
  .mfit tbody th {
    font-size: 15px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    white-space: nowrap;
  }
  .mfit tbody td {
    text-align: center;
    padding: 14px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }
  .mfit tbody tr:last-child th,
  .mfit tbody tr:last-child td { border-bottom: none; }
  .mfit tbody tr:hover th,
  .mfit tbody tr:hover td { background: rgba(255,255,255,0.02); }
  /* pierwsza kolumna zostaje widoczna przy przewijaniu w bok */
  .mfit thead th:first-child,
  .mfit tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    box-shadow: 8px 0 12px -12px rgba(0,0,0,0.7);
  }
  .mfit thead th:first-child { z-index: 2; }
}
@media (min-width: 761px) and (max-width: 940px) {
  .mfit-scroll-hint { display: block; }
}

/* ----- Telefon: kazde zastosowanie to karta z kafelkami modeli (zero scrolla w bok) ----- */
@media (max-width: 760px) {
  .mfit-wrap { display: block; overflow: visible; border: none; background: none; box-shadow: none; }
  .mfit { display: block; width: 100%; min-width: 0; border-collapse: collapse; }
  .mfit thead {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .mfit tbody { display: block; }

  .mfit tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 16px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }
  .mfit tbody tr:last-child { margin-bottom: 0; }

  .mfit tbody th {
    grid-column: 1 / -1;
    display: block;
    position: static;
    box-shadow: none;
    margin-bottom: 4px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border);
    background: none;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-strong);
  }

  .mfit tbody td.mfit-c {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
  }
  .mfit tbody td.mfit-c::before { content: attr(data-model); }
  /* w kafelku kolor niesie samo tlo, wiec znaczek bez wlasnej obwodki */
  .mfit tbody td.mfit-c .mfit-mark { width: 18px; height: 18px; background: none; }
  .mfit tbody td.mfit-c .mfit-mark svg { width: 13px; height: 13px; }

  .mfit tbody td.mfit-c--ok { border-color: var(--green-line); background: var(--green-soft); color: var(--green); }
  .mfit tbody td.mfit-c--mid { border-color: var(--orange-line); background: var(--orange-soft); color: var(--orange-bright); }
  .mfit tbody td.mfit-c--no { border-color: rgba(255,95,87,0.30); background: rgba(255,95,87,0.10); color: #ff5f57; }

  .mfit-legend { gap: 8px 16px; font-size: 13px; }
}
@media (max-width: 380px) {
  .mfit tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   Przyciski w tresci dokumentow
   `.doc-content a` (0,1,1) bije `.btn-primary` (0,1,0), wiec przycisk wewnatrz
   dokumentu dostawal pomaranczowy tekst i podkreslenie zamiast wariantu .btn.
   ========================================================================== */
.doc-content a.btn { text-decoration: none; }
.doc-content a.btn-primary { color: #fff; }
.doc-content a.btn-ghost { color: var(--text); }
.doc-content a.btn-green { color: #04140c; }
.doc-content a.btn-primary:hover { color: #fff; }
.doc-content a.btn-ghost:hover { color: var(--text); }
.doc-content a.btn-green:hover { color: #04140c; }

/* ==========================================================================
   Podstrony z markdowna (/pages/SLUG) - elementy, ktorych .doc-content nie stylowal
   ========================================================================== */
.doc-content--md code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-3); border-radius: 6px; padding: 1px 6px; color: var(--text); overflow-wrap: anywhere; }
.doc-content--md pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; }
.doc-content--md img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.doc-content--md hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.doc-content--md table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 16px 0; }
.doc-content--md th, .doc-content--md td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.doc-content--md th { background: var(--surface-2); color: var(--text-strong); font-family: var(--font-mono); font-size: 13px; }
.doc-content--md td { color: var(--muted); background: var(--surface); }

/* Karta artykulu: tlo pod tekstem i tytul do lewej (regulamin zostaje wycentrowany). */
.md-article { max-width: 820px; margin-inline: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 40px 44px 28px; }
.md-article .doc-head { max-width: none; margin: 0 0 8px; text-align: left; }
.md-article .doc-head h1 { margin-top: 0; }
.md-article .doc-content { max-width: none; }
@media (max-width: 720px) { .md-article { padding: 24px 18px 12px; } }

/* ==========================================================================
   Black Friday (/bf2026) - duzy licznik do konca promocji i kody w kartach
   ========================================================================== */
.bf-count { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 760px; margin: 34px auto 18px; }
.bf-count .stat { padding: 22px 8px; text-align: center; min-width: 0; }
.bf-count .n { font-size: clamp(36px, 9vw, 84px); line-height: 1; color: var(--orange-bright); font-variant-numeric: tabular-nums; }
.bf-count .l { margin-top: 10px; font-family: var(--font-mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.ptable td.pl-name.bf-promo { color: var(--green); }
@media (min-width: 721px) { .ptable td.pl-name.bf-promo, #bonusy .ptable td.c { white-space: nowrap; } }
.ptable th.bf-opis, .ptable td.bf-opis { text-align: left; }
@media (max-width: 720px) {
  .ptable td.bf-opis { display: block; line-height: 1.55; }
  .ptable td.bf-opis::before { display: block; margin-bottom: 6px; }
  #kursy .ptable tr { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 8px; }
  #kursy .ptable td { padding: 0; margin: 0; border: none; font-size: 16px; text-align: left; }
  #kursy .ptable td.pl-name { flex: 1; }
  #kursy .ptable td.c { white-space: nowrap; }
  #kursy .ptable td::before { display: none; }
  #kursy .ptable input { flex-shrink: 0; }
}
.ptable td.bf-opis .hlx, #kursy .hlx { color: var(--orange-bright); font-weight: 600; }
#kursy label:has(input:checked) { color: var(--green); }
#notka-prawna .section-head p { text-align: justify; hyphens: auto; }
@media (max-width: 480px) { .bf-count { gap: 8px; } .bf-count .stat { padding: 16px 4px; } }
