/* ============================================================
   components.css
   Wspólne, wielokrotnie powtarzane komponenty UI używane na wielu
   podstronach (sekcje, formularz kontaktowy, FAQ, karty realizacji,
   opinie, pasek CTA na mobile itd.).

   WAŻNE: ten plik musi być podpięty PO general.css, ale PRZED
   plikiem CSS właściwym dla danej podstrony (np. przed
   /css/kontakt.css) — dzięki temu lokalne nadpisania tych samych
   selektorów w pliku strony nadal działają zgodnie z kaskadą CSS.

   Metodologia (refaktoryzacja / deduplikacja CSS): do tego pliku
   trafiły WYŁĄCZNIE reguły, które (a) miały identyczną treść w 3
   lub więcej plikach CSS podstron ORAZ (b) nie miały ŻADNEJ innej,
   odmiennej wartości w którymkolwiek pozostałym pliku CSS (łącznie
   z general.css) — sprawdzone programowo przez porównanie każdego
   selektora względem wszystkich 11 plików źródłowych, nie tylko
   tych, które przekroczyły próg duplikacji. Każda reguła, która
   miała gdziekolwiek choć jeden odmienny wariant (np. .hero,
   .hero-actions, .price-card, .quote-card, .work-card, .stars —
   różne dla home/kontakt/cennik/tworzenie-stron/o-mnie), została
   świadomie POZOSTAWIONA lokalnie w pliku CSS danej podstrony,
   żeby nie zmienić wyglądu żadnej strony. Zweryfikowano zrzutami
   ekranu (Playwright, pełna wysokość strony) — 0 różnic pikselowych
   poza nieistotnymi driftami animacji wejścia (scroll-reveal). */

/* --- Nagłówki sekcji (bez .section-head h2 — ten ma 2 warianty
   font-size, patrz general.css i lokalne override w home/kontakt/
   tworzenie-stron-internetowych) --- */
.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}
.section-head p {
  color: var(--text-muted);
  font-size: 16.5px;
}
.band.alt {
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

/* --- Formularz kontaktowy (pola, etykiety) ---
   Uwaga: .form-card, .cta-grid, .cta-copy h2/p, .contact-alt,
   .contact-alt a, .field input/select/textarea, .hero-actions MAJĄ
   różne warianty na różnych stronach i celowo NIE zostały
   scentralizowane — pozostają zdefiniowane lokalnie. --- */
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 7px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-note {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 14px;
  text-align: center;
}

/* --- Zgoda RODO w formularzu kontaktowym (checkbox) ---
   Wspólna dla wszystkich stron z #contactForm — patrz main.js
   initContactForm (walidacja) i api/lib/Validator.php (backend). --- */
.field-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.field-consent input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.field-consent label {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-body);
}
.field-consent label a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.field-consent label a:hover {
  color: var(--accent);
}
.field-consent input[type="checkbox"].field-invalid {
  outline: 2px solid #e5484d;
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Stan formularza kontaktowego: błąd walidacji / sieci --- */
.form-status {
  font-size: 13.5px;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  margin-bottom: 16px;
}
.form-status.is-error {
  background: color-mix(in srgb, #e5484d 14%, transparent);
  border: 1px solid color-mix(in srgb, #e5484d 40%, transparent);
  color: #e5484d;
}
.field-invalid {
  border-color: #e5484d !important;
}

/* --- Karta sukcesu, którą JS podstawia w miejsce formularza po
   udanym wysłaniu (main.js, initContactForm -> replaceWithSuccess) --- */
.form-success {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 40px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: form-success-in 0.4s ease both;
}
@keyframes form-success-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.form-success svg {
  color: var(--status);
  margin-bottom: 6px;
}
.form-success h3 {
  font-size: 19px;
}
.form-success p {
  color: var(--text-muted);
  font-size: 14.5px;
  max-width: 380px;
}

/* --- Pasek CTA na dole ekranu (mobile) --- */
.mobile-cta-bar {
  display: none;
}
@media (max-width: 720px) {
  .mobile-cta-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 12px 16px;
    gap: 10px;
    box-shadow: 0 -12px 21px rgba(0, 0, 0, 0.12);
  }
  .mobile-cta-bar a {
    flex: 1;
    padding: 10px 0;
  }
}

/* --- Trust strip (liczby zaufania w hero) --- */
.trust-strip {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trust-item .num {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text);
  font-weight: 500;
}
.trust-item .lbl {
  font-size: 12.5px;
  color: var(--text-faint);
}

/* --- Karta "raportu" (dashboard mock w hero) --- */
.report-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 22px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
  transform: rotate(1deg);
}
.report-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 16px;
}
.report-card-head .who {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.dots3 {
  display: flex;
  gap: 4px;
}
.dots3 span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
}
.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.report-row:last-of-type {
  border-bottom: none;
}
.report-row .rl {
  font-size: 13.5px;
  color: var(--text-muted);
}
.report-row .rv {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.report-row .rv .n {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}
.report-row .rv .t {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--status);
  background: var(--status-dim);
  padding: 2px 7px;
  border-radius: 20px;
}
.report-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 7px;
}

/* --- Pulsujący wskaźnik "online/dostępny" --- */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status);
  position: relative;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--status);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% {
    transform: scale(0.4);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* --- Pasek logotypów zaufania (tylko .logo-row — .logo-strip ma
   różne warianty marginesów na home/o-mnie i został lokalny) --- */
.logo-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  align-items: center;
}
.logo-row span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-faint);
  opacity: 0.6;
}

/* --- Karty "problemów" (pain points) --- */
.pain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.pain-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 24px;
}
.pain-card .ico {
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  color: var(--accent);
}
.pain-card p {
  font-size: 14.5px;
  color: var(--text-muted);
}
.pain-card p strong {
  color: var(--text);
  font-weight: 600;
}

/* --- Zakres usług (scope) — .scope-wrap i .scope-note mają lokalne
   warianty na niektórych stronach i zostały tam, gdzie się różnią --- */
.scope-list {
  display: grid;
  gap: 2px;
}
.scope-item .chk {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--status-dim);
  color: var(--status);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.scope-item .chk svg {
  width: 12px;
  height: 12px;
}
.scope-item h4 {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 3px;
}
.scope-item p {
  font-size: 14px;
  color: var(--text-muted);
}
.scope-note .eyebrow {
  margin-bottom: 14px;
}
.scope-note h3 {
  font-size: 20px;
  margin-bottom: 12px;
}
.scope-note p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 20px;
}

/* --- Proces współpracy (kroki) --- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.process-step {
  padding: 0 22px 0 0;
  position: relative;
}
.process-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 20px;
  right: -2px;
  width: calc(100% - 44px);
  height: 1px;
  background: var(--line);
  display: none;
}
.process-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 18px;
  display: block;
}
.process-step h4 {
  font-size: 17px;
  margin-bottom: 8px;
}
.process-step p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.process-step .time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 10px;
  display: inline-block;
}

/* --- Cennik / karty planów (tylko elementy identyczne wszędzie;
   .price-card, .price-grid, .price-feat itd. mają lokalne warianty
   na cennik.css i tworzenie-stron-internetowych.css) --- */
.pricing-step:last-of-type {
  margin-bottom: 0;
}
.price-feat li {
  display: flex;
  gap: 9px;
  font-size: 14px;
  color: var(--text-muted);
  align-items: flex-start;
}
.price-feat li svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--status);
  margin-top: 3px;
}
.price-feat li strong {
  color: var(--text);
  font-weight: 600;
}
.price-fine {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-faint);
}
/* Uwaga: .price-card-hero (i .hero-main .price / .hero-feats
   .price-feat) NIE sa tu scentralizowane, mimo ze mialy identyczna
   tresc w 5 plikach zrodlowych. Element w HTML laczy klasy
   "price-card price-card-hero" na tym samym wezle, a .price-card
   (display:flex) musi byc nadpisany przez .price-card-hero
   (display:grid) w konkretnej kolejnosci zdefiniowanej lokalnie w
   pliku strony (.price-card-hero MUSI byc PO .price-card). Centrali-
   zacja przesunelaby te regule PRZED .price-card i odwrocila kaskade,
   co zmienialo layout na 4 stronach - wykryte i naprawione zrzutami
   ekranu (Playwright). Reguly zostaly przywrocone lokalnie do:
   analityka-i-seo.css, aplikacje-i-automatyzacje.css,
   dostepnosc-cyfrowa.css, sklepy-internetowe.css (tworzenie-stron-
   internetowych.css ma wlasny, odrebny wariant tego komponentu). */

/* --- Opinie klientów (quote cards) — tylko elementy identyczne
   wszędzie; .quote-card, .stars, .quote-who, .quote-card p.q mają
   lokalne warianty na home.css/kontakt.css i zostały tam --- */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.quote-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}
.quote-who .role {
  font-size: 12px;
  color: var(--text-faint);
}
/* Prawdziwe zdjęcie klienta (zamiast inicjałów w .quote-avatar) —
   używane przez komponent opinii renderowany z main.js
   (initTestimonials, patrz [data-testimonials-grid]) na podstronach
   usługowych oraz przez HOME dla tych samych 3 realnych opinii. */
.quote-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* --- FAQ (akordeon) --- */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--line-soft);
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 22px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 16px;
}
.faq-q .plus {
  flex: none;
  width: 20px;
  height: 20px;
  position: relative;
}
.faq-q .plus::before,
.faq-q .plus::after {
  content: "";
  position: absolute;
  background: var(--accent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.faq-q .plus::before {
  width: 14px;
  height: 2px;
}
.faq-q .plus::after {
  width: 2px;
  height: 14px;
  transition: transform 0.2s ease;
}
.faq-item.open .plus::after {
  transform: translate(-50%, -50%) rotate(90deg) scale(0);
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.faq-a p {
  padding: 0 4px 22px;
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 640px;
}

/* ============================================================
   COOKIE CONSENT — baner zgody na cookies (components/cookie-consent.js)
   z-index 200: musi być NAD chat-widgetem (150) i mobile-cta-bar (90),
   żeby zawsze dało się podjąć decyzję, ale poniżej ewentualnych
   natywnych dialogów przeglądarki.
   ============================================================ */
.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  opacity: 0;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
  pointer-events: none;
}
.cookie-consent.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cookie-consent.is-hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}
.cookie-consent-inner {
  max-width: 900px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-consent-text {
  flex: 1;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}
.cookie-consent-text a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-consent-text a:hover {
  color: var(--accent);
}
.cookie-consent-actions {
  display: flex;
  gap: 10px;
  flex: none;
  flex-wrap: wrap;
}
.cookie-consent-actions .btn-sm {
  padding: 9px 16px;
  font-size: 13.5px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .cookie-consent {
    /* Nad mobile-cta-bar (fixed bottom, ok. 60-70px wysokości z paddingiem) */
    padding-bottom: calc(16px + 64px + env(safe-area-inset-bottom));
  }
  .cookie-consent-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .cookie-consent-actions {
    flex-direction: column;
  }
  .cookie-consent-actions .btn-sm {
    width: 100%;
    text-align: center;
  }
}

/* ============================================================
   COOKIE CONSENT — przycisk zmiany zgody (po podjęciu decyzji)
   Lewy dolny róg — lustrzane odbicie chat-widgetu (prawy dolny róg),
   ten sam z-index co pełny baner (200), żeby zawsze dało się otworzyć
   panel wyboru ponad chat-widgetem/mobile-cta-bar.
   ============================================================ */
.cookie-consent-toggle {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 150;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}
.cookie-consent-toggle.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.cookie-consent-toggle:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}
.cookie-consent-toggle svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 720px) {
  .cookie-consent-toggle {
    left: 14px;
    bottom: calc(14px + 64px + env(safe-area-inset-bottom));
  }
}

/* ============================================================
   PRZEŁĄCZNIK MOTYWU (jasny / ciemny)
   ============================================================ */
.theme-toggle {
  position: fixed;
  bottom: 0;
  transform: translateY(-50%);
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 13px 13px;
  border-radius: var(--radius-l) 0 0 var(--radius-l);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}

.icon-sun,
.icon-moon {
  display: none;
}
.icon-sun svg,
.icon-moon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Pokazywanie odpowiedniej ikony zależnie od motywu */
[data-theme="dark"] .icon-sun {
  display: inline-flex;
}
[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}
[data-theme="light"] .icon-moon {
  display: inline-flex;
}

@media (max-width: 880px) {
  .report-row .rv .n {
    font-size: 14px;
  }
}

@media (max-width: 720px) {
  .theme-toggle {
    bottom: 56px;
  }
}
