.subpage-hero {
  position: relative;
  padding:80px 0 70px;
  min-height:640px;
  overflow: hidden;
  background:
    linear-gradient(90deg, #ffffff 0%, #ffffff 48%, #f7f9fd 100%);
}

.subpage-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 55%;
  height: 100%;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.92) 0%,
      rgba(255, 255, 255, 0.42) 35%,
      rgba(255, 255, 255, 0.15) 100%
    ),
    var(--subpage-hero-image) center right / cover no-repeat;
  filter: saturate(0.95);
}

.subpage-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 42%;
  width: 22%;
  height: 100%;
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.85) 35%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
}

.subpage-hero .container {
  position: relative;
  z-index: 1;
}

.communication-hero {
  --subpage-hero-image: url("../img/sprawy-komunikacyjne.png");
}

.property-hero {
  --subpage-hero-image: url("../img/sprawy-majatkowe.png");
}

.personal-hero {
  --subpage-hero-image: url("../img/szkody-osobowe.png");
}

.training-hero {
  --subpage-hero-image: url("../img/szkolenia.png");
}

.info-box {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.info-box h2 {
  font-size: 32px;
}

.info-box p {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
}

.info-box p:last-child {
  border-bottom: 0;
}

.cards {
  grid-template-columns: repeat(4, 1fr);
}

.cards article {
  transition: transform .25s, box-shadow .25s;
}

.cards article:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 45px rgba(15, 68, 153, .16);
}

.training-modules {
  display: grid;
  gap: 18px;
  margin-top: 36px;
}

.training-module {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 22px;
  align-items: start;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.training-module span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.training-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 36px;
}

.training-program-wide {
  width: min(1450px, calc(100% - 40px));
  margin: auto;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 56px;
  align-items: center;
}

.training-image-box {
  position: relative;
  height: 68%;
  min-height: 520px;
  width: 100%;
  border-radius: 2400px;
  overflow: hidden;
  box-shadow:
    0 35px 80px rgba(15,68,153,.12),
    0 10px 25px rgba(15,68,153,.08);
}

.training-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

#program {
  overflow: hidden;
}

.training-benefits {
  position: relative;
  overflow: hidden;
}

.training-benefits-icon {
  position: absolute;
  left: 60px;
  bottom: -18px;
  width: 300px;
  height: 300px;
  opacity: .06;
  filter: brightness(0) invert(1);
  pointer-events: none;
  transform: rotate(-10deg);
}

.training-benefits .container {
  position: relative;
  z-index: 1;
}

.contact-page {
  padding: 90px 0;
  background:
    radial-gradient(circle at 75% 12%, rgba(15, 68, 153, 0.10), transparent 30%),
    linear-gradient(#fff, #f7f9fd);
}

.contact-intro {
  max-width: 760px;
  margin-bottom: 42px;
}

.contact-intro h1 {
  margin: 0 0 20px;
  color: var(--dark);
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.contact-intro p {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.7;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 70px;
}

.contact-card {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}

.contact-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 55px rgba(15, 68, 153, .16);
}

.contact-card span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 16px;
  background: var(--soft);
  font-size: 24px;
}

.contact-card h3 {
  margin: 0 0 10px;
}

.contact-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.contact-card strong {
  color: var(--blue);
}

.contact-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 80px;
}

.contact-flow div {
  position: relative;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.contact-flow span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.contact-flow h3 {
  margin: 0 0 10px;
}

.contact-flow p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.contact-documents {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 54px;
  align-items: center;
  margin-bottom: 80px;
  padding: 48px;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

.contact-documents h2 {
  margin-bottom: 14px;
}

.contact-documents p {
  color: var(--muted);
  line-height: 1.7;
}

.document-list p {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
}

.document-list p:last-child {
  border-bottom: 0;
}

.contact-cta {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 34px;
  align-items: center;
  padding: 52px;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--dark), var(--blue));
  color: #fff;
  overflow: hidden;
}

.contact-cta-icon {
  position: absolute;
  right: 15px;
  bottom: -45px;
  width: 200px;
  height: 200px;
  opacity: .06;
  filter: brightness(0) invert(1);
  pointer-events: none;
  transform: rotate(10deg);
}

.contact-cta h2 {
  color: #fff;
}

.contact-cta p {
  max-width: 720px;
  color: rgba(255, 255, 255, .82);
  line-height: 1.7;
}

.contact-cta > div,
.contact-cta > a {
  position: relative;
  z-index: 1;
}

.faq-hero {
  padding: 90px 0;
  background:
    radial-gradient(circle at 80% 12%, rgba(15, 68, 153, 0.10), transparent 30%),
    linear-gradient(#fff, #f7f9fd);
}

.faq-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

.faq-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.faq-categories button {
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}

.faq-categories button:hover,
.faq-categories button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.faq-list {
  display: grid;
  gap: 18px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px;
  border: 0;
  background: #fff;
  color: var(--dark);
  font: inherit;
  font-size: 19px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.faq-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  transition:
    transform .25s ease,
    background-color .25s ease;
}

.faq-icon img {
  width: 16px;
  height: 16px;
  display: block;
  transition: transform .25s ease;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 28px;
  transition: max-height .28s ease, padding .28s ease;
}

.faq-answer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 1000px;
  padding: 0 28px 24px;
}

.faq-item.active .faq-icon {
  background: rgba(15, 68, 153, .10);
}

.faq-item.active .faq-icon img {
  transform: rotate(45deg);
}

.faq-question:hover .faq-icon {
  background: rgba(15, 68, 153, .10);
}

.faq-item.hidden {
  display: none;
}

.faq-cta {
  position: relative;
  overflow: hidden;
}

.faq-cta-icon {
    position: absolute;
    right: 55px;
    bottom: 0px;
    width: 250px;
    height: 250px;
    opacity: .06;
    filter: brightness(0) invert(1);
    pointer-events: none;
    transform: rotate(8deg);
}

.faq-cta .container {
  position: relative;
  z-index: 1;
}

.faq-main {
  padding-bottom: 45px;
}

.faq-topics .cards {
  grid-template-columns: repeat(3, 1fr);
  max-width: 900px;
}

.contact-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-weight: 800;
}

.contact-card-link .link-arrow {
  width: 15px;
  height: 15px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  transform: translateY(1px);
}

.faq-public-state {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  box-shadow: var(--shadow);
}

.faq-public-state.error {
  border-color: rgba(217, 45, 32, .24);
  color: #b42318;
  background: #fffafa;
}

@media (max-width: 1200px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .contact-page {
    padding: 60px 0;
  }

  .contact-documents,
  .contact-cta {
    padding: 30px;
  }

  .faq-hero {
    padding: 60px 0;
  }

  .faq-question {
    padding: 20px;
    font-size: 17px;
    gap: 12px;
    line-height: 1.4;
  }

  .faq-item.active .faq-answer {
    padding: 0 20px 22px;
  }

  .training-module,
  .training-options {
    grid-template-columns: 1fr;
  }

  .faq-hero h1 {
    font-size: clamp(34px, 9vw, 40px);
    line-height: 1.08;
  }

  .faq-hero .lead {
    font-size: 17px;
    line-height: 1.65;
  }

  .faq-categories {
    gap: 8px;
    margin-bottom: 30px;
  }

  .faq-categories button {
    padding: 10px 15px;
    font-size: 14px;
  }

  .faq-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .faq-topics .cards {
    grid-template-columns: 1fr;
  }

  .faq-cta-icon {
    width: 150px;
    height: 150px;
    right: -20px;
    bottom: -20px;
    opacity: .04;
  }

  .faq-cta .btn {
    width: 100%;
  }

  .faq-main {
    padding-bottom: 36px;
  }

  .contact-intro h1 {
    font-size: clamp(34px, 9vw, 40px);
    line-height: 1.08;
  }

  .contact-intro p {
    font-size: 17px;
    line-height: 1.65;
  }

  .contact-cards {
    gap: 16px;
    margin-bottom: 52px;
  }

  .contact-card {
    padding: 24px;
  }

  .contact-flow {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 60px;
  }

  .contact-flow div {
    padding: 22px;
  }

  .contact-documents {
    gap: 28px;
    margin-bottom: 60px;
    padding: 26px 22px;
    border-radius: 22px;
  }

  .contact-cta {
    gap: 24px;
    padding: 30px 22px;
    border-radius: 24px;
  }

  .contact-cta .btn {
    width: 100%;
  }

  .contact-cta-icon {
    width: 140px;
    height: 140px;
    right: -20px;
    bottom: -25px;
    opacity: .04;
  }

  .subpage-hero {
    padding: 60px 0;
  }

  .service-hero h1 {
    font-size: clamp(34px, 9vw, 40px);
    line-height: 1.08;
  }

  .service-hero .lead {
    font-size: 17px;
    line-height: 1.65;
  }

  .service-hero .actions {
    flex-direction: column;
  }

  .service-hero .actions .btn {
    width: 100%;
  }

  .info-box {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .info-box h2 {
    font-size: 27px;
  }

  .info-box p {
    gap: 10px;
    padding: 11px 0;
    line-height: 1.5;
  }
}

@media (max-width: 980px) {
  .subpage-hero {
    padding: 80px 0;
    min-height: auto;
  }

  .subpage-hero::before {
    background:
      linear-gradient(rgba(255,255,255,.92), rgba(255,255,255,.96)),
      var(--subpage-hero-image) center / cover no-repeat;
  }

  .training-program-wide {
    grid-template-columns: 1fr;
  }

  .training-image-box {
    width: 100%;
    min-height: 320px;
    margin-right: 0;
    border-radius: 24px;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }

  .contact-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-documents,
  .contact-cta {
    grid-template-columns: 1fr;
  }

  .contact-cta {
    align-items: start;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .faq-topics .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
