.home-hero-swap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "head"
    "stage"
    "form";
  align-items: start;
  justify-items: center;
  row-gap: 28px;
  width: 100%;
}

/* kafelki i formularz nie mogą rozpychać kolumny siatki */
.home-hero-swap__head,
.home-role,
.home-seek-panel__chooser,
.home-seek-panel__tiles,
.home-hero-swap .training-filters__form {
  min-width: 0;
}

.firstStepFilters {
  position: relative;
}

.home-hero-swap__head {
  grid-area: head;
  display: grid;
  justify-items: center;
  align-items: start;
  width: 100%;
  min-height: 45px;
}

.home-gate__title,
.home-seek-panel__headline {
  grid-area: 1 / 1;
}

.home-role {
  grid-area: stage;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 0;
}

.home-seek-panel {
  display: contents;
}

.home-seek-panel__chooser {
  grid-area: stage;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 30px;
  width: max-content;
  max-width: 100%;
}

.home-seek-panel__headline,
.home-seek-panel__chooser {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.home-seek-panel__tiles {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.home-seek-panel > [class*="col-"] {
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  padding-left: 0;
  padding-right: 0;
}

#filters_form_checkboxes {
  grid-area: form;
  width: 100%;
  max-width: 1180px;
}

.home-seek-panel__headline,
.home__filters .home-seek-panel__headline {
  width: 100%;
  margin: 0;
  color: #fff;
  font-family: Saira, Poppins, sans-serif;
  font-size: 20px !important;
  font-weight: 700;
  line-height: 1.25 !important;
  text-align: center;
}

.home-seek-panel__lead,
.home-seek-panel__service-title,
.home-seek-panel__area-title {
  margin: 0;
  color: #fff;
  font-family: Saira, Poppins, sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
}

.home-seek-panel__lead {
  white-space: nowrap;
  text-align: left;
}

.home-seek-panel__service-title,
.home-seek-panel__area-title {
  display: none;
}

/* Skrót trzyma lewą krawędź treści, nie krawędź ekranu — stąd pusty
   .container, który daje dokładnie tę samą szerokość co reszta strony. */
.home-how-jump-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 32px;
  z-index: 4;
  pointer-events: none;
}

.home-how-jump-wrap > .container {
  display: flex;
}

.home-how-jump {
  position: static;
  display: inline-flex;
  align-items: center;
  width: auto;
  padding: 0;
  background: none;
  box-shadow: none;
  color: #1c1c1c;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html.home-seek .home-how-jump {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* drugi krok zapytania nie ma skrótu do "Jak to działa" */
#mainPageDynamicFilters:has(.secondStepFilters:not(.d-none)) .home-how-jump {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Typografia i promień jak w białej pigułce portalu (.proper-button--white). */
.home-how-jump__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 32px;
  border-radius: 60px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(0, 85, 151, 0.4);
  color: #000;
  font-family: Roboto, Poppins, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.home-how-jump:hover,
.home-how-jump:focus-visible {
  color: #1c1c1c;
  text-decoration: none;
}

html.home-seek .home-role,
html.home-seek .home-gate__title {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html.home-seek .home-seek-panel__headline,
html.home-seek .home-seek-panel__chooser {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

html.home-seek:not(:has(.is-spec-focus)) #filters_form_checkboxes,
#mainPageDynamicFilters:not(.is-spec-focus) #filters_form_checkboxes,
html:not(.home-seek) #filters_form_checkboxes {
  display: none;
}

.home-hero-swap.is-animating .home-role,
.home-hero-swap.is-animating .home-gate__title {
  transition: opacity 0.32s ease, visibility 0s linear 0.32s;
}

.home-hero-swap.is-animating .home-seek-panel__headline,
.home-hero-swap.is-animating .home-seek-panel__chooser,
.home-hero-swap.is-animating .home-how-jump {
  transition: opacity 0.32s ease 0.04s, visibility 0s;
}

.home-gate__title,
.home__filters .home-role h1.home-gate__title {
  margin: 0;
  max-width: 100%;
  min-height: 45px;
  box-sizing: border-box;
  color: #fff;
  font-family: Saira, Poppins, sans-serif;
  font-size: clamp(22px, 2.8vw, 36px) !important;
  font-weight: 600;
  line-height: 1.25 !important;
  text-align: center;
}

.home-seek-panel.is-spreading .training-filters__filter-item {
  transition: none !important;
  animation: home-tile-spread 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--spread-delay, 0) * 1ms);
}

@keyframes home-tile-spread {
  from {
    opacity: 0;
    transform: translateX(var(--spread-from, 0)) scale(0.82);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.home-gate__tiles,
.home-seek-panel__tiles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 24px;
  width: 100%;
  min-height: 110px;
}

.home__filters .training-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 !important;
  margin: 0;
}

.home-gate__tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  min-height: 56px;
  padding: 12px 20px;
  border: 0;
  border-radius: 28px;
  background: #fff;
  color: #2b2d38;
  box-shadow: 0 10px 28px rgba(18, 62, 110, 0.14);
  font-family: Roboto, Poppins, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
}

.home-gate__tile:hover,
.home-gate__tile:focus-visible {
  color: #2b2d38;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(18, 62, 110, 0.18);
}

.home-gate__tile:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.home-gate__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.home-gate__icon img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.home-gate__tile-label {
  min-width: 0;
  white-space: nowrap;
}

@media (min-width: 768px) {
  body.is-home {
    padding-top: 0 !important;
  }

  .home__filters {
    position: relative;
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .home__filters:has(.secondStepFilters.d-none) {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    padding: 0 !important;
    margin: 0 !important;
  }

  .home__filters:has(.secondStepFilters.d-none) .home__filters--bgImg,
  .home__filters:has(.secondStepFilters.d-none) .home__filters--bgImg img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .home__filters .firstStepFilters {
    position: relative;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    box-sizing: border-box;
    padding-top: clamp(108px, 18vh, 200px);
    padding-bottom: 80px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .home__filters .firstStepFilters::-webkit-scrollbar {
    display: none;
  }

  /* Drugi krok zaczyna się pod przyklejoną belką nagłówka */
  .home__filters .secondStepFilters {
    padding-top: 56px;
  }

  .home-hero-swap {
    row-gap: 28px;
  }

  /* Makieta: nagłówek na 25,3% wysokości hero, rząd wyśrodkowany na 45,6% */
  #mainPageDynamicFilters:not(.is-spec-focus) .firstStepFilters {
    padding-top: 0;
    padding-bottom: 0;
  }

  #mainPageDynamicFilters:not(.is-spec-focus) .home-hero-swap {
    position: absolute;
    inset: 0;
    display: block;
  }

  #mainPageDynamicFilters:not(.is-spec-focus) .home-hero-swap__head {
    position: absolute;
    top: 25.3%;
    left: 0;
    right: 0;
  }

  #mainPageDynamicFilters:not(.is-spec-focus) .home-role {
    position: absolute;
    top: 45.6%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
  }

  #mainPageDynamicFilters:not(.is-spec-focus) .home-seek-panel__chooser {
    position: absolute;
    bottom: calc(54.4% - 55px);
    left: 50%;
    transform: translateX(-50%);
  }

  .home-how-jump-wrap {
    bottom: 3.7%;
  }

  .home-gate__title,
  .home__filters .home-role h1.home-gate__title {
    white-space: nowrap;
  }

  .home-gate__tiles {
    flex-wrap: nowrap;
    gap: 20px;
  }

  .home-gate__tile {
    min-height: 58px;
    padding: 12px 22px;
  }
}

@media (max-width: 767px) {
  .home-hero-swap {
    row-gap: 20px;
    padding: 0 16px 32px;
  }

  .home-hero-swap__head {
    min-height: 58px;
  }

  .home-gate__title,
  .home__filters .home-role h1.home-gate__title {
    white-space: normal !important;
    font-size: 22px !important;
    line-height: 1.3 !important;
    padding: 0 8px;
    min-height: 58px;
  }

  .home-seek-panel__headline {
    font-size: 18px;
    padding: 0 8px;
  }

  .home-seek-panel__lead {
    white-space: normal;
    font-size: 16px;
    padding: 0;
    text-align: left;
  }

  .home-seek-panel__chooser {
    width: 100%;
    gap: 16px;
  }

  /* na telefonie hero rośnie z treścią — miejsce na przycisk w dolnym lewym rogu */
  .home-hero-swap {
    padding-bottom: 92px;
  }

  .home-how-jump-wrap {
    bottom: 16px;
  }

  /* .home-hero-swap dokłada na telefonie 16px do paddingu .container */
  .home-how-jump-wrap > .container {
    padding-left: 23.5px;
    padding-right: 23.5px;
  }

  .home-how-jump__btn {
    min-height: 45px;
    padding: 0 24px;
    font-size: 16px;
  }

  .home-gate__tiles {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    max-width: 300px;
    min-height: 0;
  }

  .home-seek-panel__tiles {
    min-height: 110px;
  }

  .home-gate__tile {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
  }

  .home-gate__tile-label {
    white-space: normal;
  }

  .home-gate__icon,
  .home-gate__icon img {
    width: 24px;
    height: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-swap.is-animating .home-role,
  .home-hero-swap.is-animating .home-gate__title,
  .home-hero-swap.is-animating .home-seek-panel__headline,
  .home-hero-swap.is-animating .home-seek-panel__chooser,
  .home-seek-panel.is-spreading .training-filters__filter-item {
    transition: none;
    animation: none;
  }
}

/* Swiper poniżej 780px centruje środek listy — kafelki mają startować od lewej */
@media (max-width: 779px) {
  .home-seek-panel__tiles {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .home-seek-panel__tiles::-webkit-scrollbar {
    display: none;
  }

  .home__filters .home-seek-panel__tiles .training-filters {
    justify-content: flex-start;
    transform: none !important;
  }
}
