/* Fiberlogy – asystent filamentu: jasny układ ze zdjęciami w naturalnych barwach */
body:has(.fla) { overflow-x: clip; }

.fla {
  --fla-blue: #0202cc;
  --fla-blue-soft: #eceeff;
  --fla-grey: #8f8f8f;
  --fla-dark: #11121f;
  --fla-muted: #5d6178;
  --fla-bg: #f3f4fb;
  --fla-white: #fff;
  --fla-shadow: 0 14px 40px rgba(30, 40, 120, .1);
  --fla-ease: cubic-bezier(.2, .7, .2, 1);
  box-sizing: border-box;
  position: relative;
  left: 50%;
  width: 100vw;
  max-width: 1440px;
  margin: 3rem 0;
  padding: 64px 40px 56px;
  transform: translateX(-50%);
  overflow: hidden;
  background: var(--fla-bg);
  border-radius: 36px;
  color: var(--fla-dark);
}
.fla *, .fla *::before, .fla *::after { box-sizing: border-box; }
:where(.fla) button { font: inherit; }

/* delikatna poświata w tle: gradienty bez filtra blur (tanie w renderowaniu), animowany tylko transform */
.fla::before, .fla::after {
  content: ""; position: absolute; z-index: 0; width: 70%; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  animation: fla-drift 28s ease-in-out infinite; will-change: transform;
}
.fla::before { top: -35%; right: -15%; background: radial-gradient(circle closest-side, rgba(143, 155, 255, .55), rgba(143, 155, 255, 0)); }
.fla::after { bottom: -45%; left: -20%; background: radial-gradient(circle closest-side, rgba(127, 227, 255, .5), rgba(127, 227, 255, 0)); animation-delay: -14s; }
@keyframes fla-drift { 0%, 100% { transform: translate3d(-4%, -3%, 0); } 50% { transform: translate3d(4%, 4%, 0); } }
@keyframes fla-rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }
@keyframes fla-fade { from { opacity: 0; } to { opacity: 1; } }

.fla__container { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }

/* Nagłówek: tytuł po lewej, opis po prawej, pod spodem nawigacja */
.fla__header { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px 56px; align-items: end; margin-bottom: 44px; }
.fla__title { margin: 0; font-size: 48px; font-weight: 600; line-height: 1.05; letter-spacing: -2.2px; text-align: left; color: var(--fla-dark); text-wrap: balance; }
.fla__subtitle { margin: 0; font-size: 16px; line-height: 1.55; text-align: left; color: var(--fla-muted); }

/* Nawigacja kroków */
.fla__progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.fla__progress-dot {
  display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; padding: 6px 20px 6px 6px; cursor: default;
  background: rgba(255, 255, 255, .92); border: 1px solid rgba(2, 2, 204, .12); border-radius: 999px; color: var(--fla-muted);
  transition: background .35s ease, color .35s ease, border-color .35s ease;
}
.fla__progress-num {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 15px; font-weight: 600;
  background: var(--fla-blue-soft); color: var(--fla-blue); transition: background .4s, color .4s, transform .4s var(--fla-ease);
}
.fla__progress-label { font-size: 15px; font-weight: 600; letter-spacing: -.2px; white-space: nowrap; }
.fla__progress-dot--completed { cursor: pointer; color: var(--fla-dark); }
.fla__progress-dot--completed .fla__progress-num { background: var(--fla-blue); color: #fff; }
.fla__progress-dot--completed:hover { border-color: var(--fla-blue); }
.fla__progress-dot--active { background: var(--fla-blue); border-color: var(--fla-blue); color: #fff; box-shadow: 0 12px 30px rgba(2, 2, 204, .3); }
.fla__progress-dot--active .fla__progress-num { background: #fff; color: var(--fla-blue); transform: scale(1.04); }
.fla__progress-line { position: relative; flex: 1 1 24px; height: 2px; background: rgba(2, 2, 204, .15); border-radius: 2px; overflow: hidden; }
.fla__progress-line::after { content: ""; position: absolute; inset: 0; background: var(--fla-blue); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--fla-ease); }
.fla__progress-line--active::after { transform: scaleX(1); }

/* Kroki i pytania */
.fla__step { display: none; }
.fla__step--active { display: block; }
.fla__question { margin: 0 0 20px; font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -.6px; text-align: left; color: var(--fla-dark); }
.fla__step--active > .fla__question { animation: fla-fade .5s ease both; }
/* Etykieta etapu: otwiera każdy etap (po wyborze strona przewija się do kolejnej etykiety) */
.fla__stage { display: flex; align-items: center; gap: 12px; margin: 56px 0 16px; scroll-margin-top: 110px; }
.fla__step > .fla__stage:first-child { margin-top: 0; }
.fla__stage-num { display: grid; flex: 0 0 auto; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--fla-blue); color: #fff; font-size: 14px; font-weight: 600; }
.fla__stage-text { font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fla-blue); white-space: nowrap; }
.fla__stage-line { flex: 1 1 auto; height: 1px; background: rgba(2, 2, 204, .16); }

/* Karty: zdjęcie w naturalnych barwach (bez filtra i nakładek), tytuł pod spodem */
.fla__cards, .fla__options { display: grid; gap: 24px; }
.fla__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fla__options { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.fla__cards--scroll { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 4px 14px; }
.fla__cards--scroll .fla__card { flex: 0 0 380px; scroll-snap-align: start; }

.fla__card, .fla__option-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-start; padding: 12px 12px 22px; text-align: left; cursor: pointer;
  color: var(--fla-dark); background: var(--fla-white); border: 0; border-radius: 30px; box-shadow: var(--fla-shadow);
  isolation: isolate; transition: transform .5s var(--fla-ease);
}
/* cień po najechaniu: płynna zmiana przezroczystości zamiast animowania box-shadow */
.fla__card::after, .fla__option-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: 0 28px 64px rgba(30, 40, 200, .22); transition: opacity .5s ease;
}
.fla__card:hover, .fla__option-card:hover { transform: translate3d(0, -6px, 0); }
.fla__card:hover::after, .fla__option-card:hover::after { opacity: 1; }

.fla__card-image, .fla__option-card-image, .fla__compact-card-image { position: relative; overflow: hidden; border-radius: 22px; background: var(--fla-blue-soft); }
.fla__card-image { aspect-ratio: 5 / 4; }
.fla__option-card-image { aspect-ratio: 4 / 3; border-radius: 20px; }
.fla__card-image img, .fla__option-card-image img, .fla__compact-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; }

.fla__card-text { padding: 20px 76px 0 14px; }
.fla__card-title, .fla__option-card-title { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -.8px; color: var(--fla-dark); }
.fla__option-card-title { padding: 16px 52px 0 8px; font-size: 18px; letter-spacing: -.4px; }

.fla__card-arrow {
  position: absolute; right: 20px; bottom: 20px; z-index: 1; display: grid; place-items: center; width: 50px; height: 50px; margin: 0; border-radius: 50%;
  background: var(--fla-blue-soft); color: var(--fla-blue); transition: transform .5s var(--fla-ease), background .3s ease, color .3s ease;
}
.fla__card-arrow svg { display: block; width: 22px; height: 22px; }
.fla__option-card .fla__card-arrow { right: 14px; bottom: 14px; width: 40px; height: 40px; }
.fla__option-card .fla__card-arrow svg { width: 18px; height: 18px; }
.fla__card:hover .fla__card-arrow, .fla__option-card:hover .fla__card-arrow { transform: rotate(-45deg); background: var(--fla-blue); color: #fff; }

/* karty bez zdjęcia */
.fla__card--noimg, .fla__option-card--noimg { justify-content: flex-end; background: linear-gradient(150deg, var(--fla-blue), #4b3bff 70%, #00b7ff); }
.fla__card--noimg { min-height: 280px; }
.fla__option-card--noimg { min-height: 170px; }
.fla__card--noimg .fla__card-title, .fla__option-card--noimg .fla__option-card-title { color: #fff; }
.fla__card--noimg .fla__card-arrow, .fla__option-card--noimg .fla__card-arrow { background: #fff; }

/* Zwinięte kontenery etapów 1 i 2 (wybrana ścieżka i wybrany cel): jeden, wspólny wygląd */
.fla__compact-cards, .fla__tags { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fla__compact-card, .fla__tag {
  display: flex; align-items: center; gap: 14px; min-width: 0; padding: 10px 20px 10px 10px; text-align: left; cursor: pointer; color: var(--fla-dark);
  background: var(--fla-white); border: 2px solid transparent; border-radius: 22px; box-shadow: 0 8px 24px rgba(30, 40, 120, .07);
  transition: border-color .3s ease, transform .45s var(--fla-ease);
}
.fla__compact-card:hover, .fla__tag:hover { transform: translate3d(0, -3px, 0); border-color: rgba(2, 2, 204, .35); }
.fla__compact-card--active, .fla__tag--active, .fla__compact-card--active:hover, .fla__tag--active:hover { border-color: var(--fla-blue); }
.fla__compact-card-image, .fla__tag-thumb { position: relative; flex: 0 0 72px; width: 72px; height: 72px; overflow: hidden; border-radius: 14px; background: var(--fla-blue-soft); }
.fla__compact-card-image img, .fla__tag-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fla__compact-card-title, .fla__tag-text { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.2; letter-spacing: -.3px; color: var(--fla-dark); }
.fla__compact-card--noimg, .fla__tag--noimg { padding: 22px 20px; }

/* Wejście elementów (kolejno) */
.fla__step--active :is(.fla__card, .fla__option-card, .fla__compact-card, .fla__tag, .fla__filter, .fla__product-card) { animation: fla-rise .6s var(--fla-ease) backwards; }
.fla__step--active :is(.fla__card, .fla__option-card, .fla__compact-card, .fla__tag, .fla__filter, .fla__product-card):nth-child(2) { animation-delay: .05s; }
.fla__step--active :is(.fla__card, .fla__option-card, .fla__compact-card, .fla__tag, .fla__filter, .fla__product-card):nth-child(3) { animation-delay: .1s; }
.fla__step--active :is(.fla__card, .fla__option-card, .fla__compact-card, .fla__tag, .fla__filter, .fla__product-card):nth-child(4) { animation-delay: .15s; }
.fla__step--active :is(.fla__card, .fla__option-card, .fla__compact-card, .fla__tag, .fla__filter, .fla__product-card):nth-child(5) { animation-delay: .2s; }
.fla__step--active :is(.fla__card, .fla__option-card, .fla__compact-card, .fla__tag, .fla__filter, .fla__product-card):nth-child(6) { animation-delay: .25s; }
.fla__step--active :is(.fla__card, .fla__option-card, .fla__compact-card, .fla__tag, .fla__filter, .fla__product-card):nth-child(n+7) { animation-delay: .3s; }

/* Wyniki: filtry */
.fla__filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; margin-top: 20px; }
.fla__filter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 30px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.fla__filter:hover { border-color: var(--fla-blue); }
.fla__filter:has(.fla__filter-checkbox:checked) { border-color: var(--fla-blue); background: rgba(2, 2, 204, .05); }
.fla__filter-checkbox { position: absolute; width: 0; height: 0; opacity: 0; }
.fla__filter-checkmark {
  position: relative;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 2px solid var(--fla-grey);
  border-radius: 6px;
  transition: background .2s, border-color .2s;
}
.fla__filter-checkbox:checked + .fla__filter-checkmark { background: var(--fla-blue); border-color: var(--fla-blue); }
.fla__filter-checkbox:checked + .fla__filter-checkmark::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 7px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.fla__filter-checkbox:focus-visible + .fla__filter-checkmark { outline: 2px solid var(--fla-blue); outline-offset: 2px; }
.fla__filter-label { font-size: 18px; font-weight: 600; line-height: 1.2; letter-spacing: -.72px; color: #000; }

/* Wyniki: nagłówek i karty produktów */
.fla__results-header { margin: 56px 0 20px; text-align: left; }
.fla__results-title { margin: 0; font-size: 40px; font-weight: 600; line-height: 1.1; letter-spacing: -1.8px; color: var(--fla-dark); }
.fla__results-subtitle { margin: 10px 0 24px; font-size: 16px; line-height: 1.5; color: var(--fla-muted); }

.fla__product-cards { margin-top: 20px; }
.fla__track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 4px 4px 24px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.fla__track::-webkit-scrollbar { display: none; }
.fla__product-card { flex: 0 0 465px; max-width: 100%; background: #fff; border-radius: 32px; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); scroll-snap-align: start; }
.fla__product-card-inner { display: flex; flex-wrap: wrap; gap: 20px; height: 100%; padding: 35px 40px; }
.fla__product-info { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.fla__product-name { margin: 0 0 30px; font-size: 30px; font-weight: 500; line-height: 1.2; letter-spacing: -1.6px; color: var(--fla-dark); }
.fla__product-description { margin: 10px 0 0; font-size: 14px; line-height: 1.4; color: var(--fla-dark); }
.fla__product-image { display: flex; flex-shrink: 0; align-items: flex-start; justify-content: center; width: 135px; }
.fla__product-image img { max-width: 100%; height: auto; border-radius: 30px; }
.fla__product-actions { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; margin-top: auto; }
.fla__no-products { margin: 0; font-size: 16px; text-align: center; color: var(--fla-grey); }

/* Przycisk „Zobacz produkt” – wygląd i zachowanie jak przycisk w boksach Filamentów:
   kontur, wersaliki, wypełnienie wjeżdża od lewej po najechaniu */
.fla__btn {
  position: relative;
  z-index: 0;
  display: inline-block;
  overflow: hidden;
  padding: 12px 35px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 1px;
  text-decoration: none;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--fla-blue);
  border-radius: 20px;
  transition: color .4s ease;
}
.fla__btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fla-blue);
  transform: translateX(-101%);
  transition: transform .4s ease;
}
.fla__btn--filled { color: var(--fla-blue); }
.fla__btn--filled:hover, .fla__btn--filled:focus-visible { color: #fff; opacity: 1; }
.fla__btn:hover::before, .fla__btn:focus-visible::before { transform: translateX(0); }

.fla__nav { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.fla__arrow {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 62px;
  padding: 0;
  color: var(--fla-blue);
  background: transparent;
  border: 1px solid var(--fla-blue);
  border-radius: 20px;
  cursor: pointer;
  transition: background .3s ease, color .3s ease;
}
.fla__arrow:hover, .fla__arrow:focus-visible { background: var(--fla-blue); color: #fff; }
.fla__arrow--prev .fla__arrow-inner { transform: rotate(180deg); }
.fla__arrow-inner { display: inline-flex; align-items: center; justify-content: center; }

.fla :focus-visible { outline: 2px solid var(--fla-blue); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .fla *, .fla::before, .fla::after { transition: none !important; animation: none !important; }
}

@media (max-width: 1024px) {
  .fla { padding: 44px 20px 40px; border-radius: 28px; }
  .fla__header { grid-template-columns: 1fr; gap: 14px; }
  .fla__title, .fla__results-title { font-size: 34px; letter-spacing: -1.4px; }
  .fla__cards { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 4px 18px; gap: 18px; }
  .fla__card { flex: 0 0 300px; scroll-snap-align: start; }
  .fla__options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fla__compact-cards, .fla__tags, .fla__filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fla__product-card { flex-basis: 85vw; }
}

@media (max-width: 640px) {
  .fla { padding: 34px 14px 30px; }
  .fla__title, .fla__results-title { font-size: 28px; }
  .fla__progress { gap: 8px; }
  .fla__progress-dot { padding: 4px; }
  .fla__progress-label { display: none; }
  .fla__stage { margin: 40px 0 14px; }
  .fla__card { flex-basis: 82%; }
  .fla__options { grid-template-columns: 1fr 1fr; gap: 12px; }
  .fla__compact-cards, .fla__tags, .fla__filters { grid-template-columns: 1fr; gap: 12px; }
  .fla__option-card-title { font-size: 16px; padding-right: 8px; }
  .fla__option-card .fla__card-arrow { display: none; }
  .fla__product-card-inner { flex-direction: column; padding: 28px 24px; }
  .fla__product-image { width: 100%; }
  .fla__product-image img { display: block; max-width: 240px; margin: 0 auto; }
}
