/* Страница "Kontakt" — собрана из существующих компонентов
   (service-hero__title/underline, text-h1/text-pretitle/text-label-lg/
   text-label-md, hero__bg/hero__scrim, hero-footer include). НОВОЕ —
   секции contact-info и contact-form целиком (в проекте таких блоков не было). */

/* ============ Hero (Figma 156:1900) — НОВОЕ: высота и позиция
   центрированного двухстрочного заголовка + полоска под "Z NAMI".
   Хлебных крошек в макете нет, поэтому .service-hero__head не используется,
   заголовок центрирован как на onas.css (.hero-about__head). ============ */
.hero--kontakt {
  height: 880px;
}

.hero-kontakt__head {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 488px; /* 504 из ноды − 16, выровнено по заголовку Nasze Realizacje */
  transform: translateX(-50%);
  width: 421px;
  text-align: center;
}

/* Первая строка — обычным регистром (как в макете), а не капсом из .text-h1 */
.hero-kontakt__head .service-hero__title-thin {
  text-transform: none;
}

/* Полоска рисуется от самого слова (span), а не фиксированным left/width —
   так она всегда попадает под слово независимо от его реальной ширины на
   разных языках (тот же приём, что .contact-form__title-word::after) */
.hero-kontakt__head .service-hero__title-word {
  position: relative;
  z-index: 0;
  display: block;
  width: fit-content;
  margin: 0 auto;
}

.hero-kontakt__head .service-hero__title-word::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: -4px;
  right: -4px;
  top: 51.82px;
  height: 19.135px;
  background: var(--color-light-400);
}

/* ============ Block 2 — карточки реквизитов (Figma 176:728). НОВОЕ —
   контейнер и сетка карточек целиком, тот же приём наезда на хиро своим
   бордер-радиусом, что у .awards (margin -56px = border-radius). ============ */
.contact-info {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: -56px;
  padding: 88px;
  border-radius: 56px;
  background: var(--color-light-1000);
}

.contact-info__grid {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1264px;
  margin-inline: auto;
}

.contact-info__row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.contact-info__row + .contact-info__row {
  margin-top: -1px;
}

.contact-info__card {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
  border: 1px solid var(--color-dark-100);
  border-radius: 32px;
  margin-right: -1px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.contact-info__card:last-child {
  margin-right: 0;
}

.contact-info__card:hover {
  background: var(--color-dark-50);
  border-color: transparent;
}

.contact-info__card--address {
  justify-content: flex-start;
  gap: 24px;
}

.contact-info__label {
  margin: 0;
  color: var(--color-dark-700);
  text-transform: uppercase;
}

.contact-info__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 38px;
  letter-spacing: -0.04em;
  color: var(--color-dark-1000);
}

/* ============ Block 3 — форма обратной связи (Figma 176:739). НОВОЕ —
   тёмная секция целиком: заголовок + подзаголовок (типографика —
   text-label-lg), поля формы, кнопка отправки. ============ */
.contact-form {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: -48px;
  padding: 148px 0;
  background: var(--color-dark-1000);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-form__inner {
  width: 778px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.contact-form__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.contact-form__title {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  line-height: 56px;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-light-1000);
  white-space: nowrap;
}

.contact-form__title-muted {
  color: var(--color-light-700);
}

/* Полоска рисуется от самого слова (span), а не фиксированным left/width —
   так она всегда попадает под "Kontaktowy" независимо от реальной ширины
   текста в браузерном шрифте (тот же приём, что .hero-about__head
   .service-hero__title-word::after в onas.css) */
.contact-form__title-word {
  position: relative;
  display: inline-block;
  z-index: 0;
}

.contact-form__title-word::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: -4px;
  right: -4px;
  top: 33.12px;
  height: 19.135px;
  background: var(--color-light-100);
}

.contact-form__subtitle {
  margin: 0;
  text-align: center;
  color: var(--color-light-1000);
}

.contact-form__subtitle-muted {
  color: var(--color-light-700);
}

.contact-form__fields {
  width: 600px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form__row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.contact-form__field {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-form__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.56px;
  text-transform: uppercase;
  color: var(--color-light-700);
}

.contact-form__label-muted {
  color: var(--color-light-400);
  text-transform: none;
}

.contact-form__input {
  width: 100%;
  height: 56px;
  padding: 10px 16px;
  border: none;
  border-radius: 16px;
  background: var(--color-light-50);
  backdrop-filter: blur(7px);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.56px;
  color: var(--color-light-1000);
}

.contact-form__input::placeholder {
  color: var(--color-light-500);
}

.contact-form__input--textarea {
  height: 124px;
  padding-top: 10px;
  resize: none;
  font-family: inherit;
}

.contact-form__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin-top: 32px;
  padding: 16px 32px;
  border: none;
  border-radius: 0;
  background: var(--color-primary);
  cursor: pointer;
  transition: border-radius 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.contact-form__submit:hover,
.contact-form__submit:focus-visible {
  border-radius: 16px;
  transform: scale(1.04);
}

.contact-form__submit-text {
  text-transform: uppercase;
  color: var(--color-light-1000);
}

.contact-form__submit-icon {
  width: 32px;
  height: 32px;
  display: block;
  transform: rotate(90deg);
  transition: transform 0.3s ease;
}

/* Та же "dart"-анимация стрелки, что у .article-cta__button — локальная
   копия кейфрейма, т.к. artykul.css на этой странице не подключён. */
@keyframes cta-arrow-dart {
  0%, 100% { transform: rotate(90deg) translate(0, 0); }
  50% { transform: rotate(90deg) translate(-4px, -4px); }
}

.contact-form__submit:hover .contact-form__submit-icon,
.contact-form__submit:focus-visible .contact-form__submit-icon {
  animation: cta-arrow-dart 0.6s ease-in-out 1;
}

.contact-form__error {
  margin-top: 16px;
  text-align: center;
  color: var(--color-danger);
}

.contact-form__error[hidden] {
  display: none;
}

/* ============ Success modal (Figma 333:5312). НОВОЕ — в проекте такого
   компонента не было. Типографика переиспользована (text-h2, text-label-xl/
   md/sm), кнопка — тот же ховер-приём, что у .contact-form__submit/.news__cta,
   полоска под словом — тот же ::after-приём, что у .contact-form__title-word. ============ */
.success-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--color-dark-800);
}

.success-modal.is-open {
  display: flex;
}

.success-modal__card {
  position: relative;
  width: 681px;
  max-width: 100%;
  padding: 72px 32px 32px;
  border-radius: 48px;
  background: var(--color-light-1000);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.success-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 40px;
  border: none;
  border-radius: 20px;
  background: var(--color-dark-50);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.success-modal__close-line {
  position: absolute;
  width: 16px;
  height: 2px;
  background: var(--color-dark-700);
}

.success-modal__close-line--1 {
  transform: rotate(45deg);
}

.success-modal__close-line--2 {
  transform: rotate(-45deg);
}

.success-modal__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
}

.success-modal__message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 553px;
  text-align: center;
}

.success-modal__title {
  margin: 0;
}

.success-modal__title-muted {
  color: var(--color-dark-700);
  font-weight: 400;
}

/* Полоска рисуется от самого слова (span), тот же приём, что
   .contact-form__title-word::after */
.success-modal__title-word {
  position: relative;
  z-index: 0;
  display: inline-block;
  text-transform: uppercase;
}

.success-modal__title-word::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: -4px;
  right: -4px;
  top: 27.86px;
  height: 19.135px;
  background: var(--color-dark-100);
}

.success-modal__desc {
  margin: 0;
  max-width: 513px;
}

.success-modal__desc-muted {
  color: var(--color-dark-500);
}

.success-modal__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 32px;
  border: none;
  border-radius: 0;
  background: var(--color-primary);
  color: var(--color-light-1000);
  text-transform: uppercase;
  cursor: pointer;
  transition: border-radius 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.success-modal__button:hover,
.success-modal__button:focus-visible {
  border-radius: 16px;
  transform: scale(1.04);
}

.success-modal__disclaimer {
  margin: 0;
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--color-dark-200);
  border-radius: 12px;
  background: var(--color-dark-50);
  color: var(--color-dark-500);
  text-align: center;
}

/* ============ Mobile ≤767px ============ */
@media (max-width: 767px) {
  /* ---- Hero (Figma 327:3708) ---- */
  .hero--kontakt {
    height: 796px;
  }

  .hero-kontakt__head {
    left: 16px;
    right: 16px;
    top: 590px;
    width: auto;
    transform: none;
  }

  .hero-kontakt__head .service-hero__title {
    font-size: 32px;
    line-height: 32px;
    letter-spacing: -2.24px;
  }

  .hero-kontakt__head .service-hero__title-word::after {
    top: 51.01px;
    height: 13.973px;
    background: var(--color-light-200);
  }

  /* ---- Block 2 — контакты (Figma 327:3762) ---- */
  .contact-info {
    margin-top: -40px;
    padding: 16px;
    border-radius: 40px;
    overflow: hidden;
  }

  .contact-info__row {
    flex-direction: column;
  }

  .contact-info__row + .contact-info__row {
    margin-top: 0;
  }

  .contact-info__card,
  .contact-info__card--address {
    flex: none;
    justify-content: flex-start;
    gap: 16px;
    padding: 20px 24px;
    margin-right: 0;
    margin-bottom: -1px;
  }

  .contact-info__row:last-child .contact-info__card:last-child {
    margin-bottom: 0;
  }

  .contact-info__value {
    font-size: 20px;
    line-height: 30px;
    letter-spacing: -0.8px;
  }

  /* ---- Block 3 — форма (Figma 333:4181) ---- */
  .contact-form {
    margin: -48px auto 0;
    padding: 96px 0 101px;
  }

  .contact-form__inner {
    width: 100%;
    gap: 19px;
  }

  .contact-form__title {
    font-size: 32px;
    line-height: 40px;
    letter-spacing: -2.24px;
  }

  /* "FORMULARZ" переносится на свою строку — тем же приёмом display:block
     на существующем span, что и .hero-kontakt__head .service-hero__title-thin */
  .contact-form__title-muted {
    display: block;
  }

  .contact-form__title-word::after {
    top: 25.01px;
    height: 13.973px;
  }

  .contact-form__subtitle {
    font-size: 16px;
    line-height: 24px;
    letter-spacing: -0.64px;
  }

  .contact-form__fields {
    width: 100%;
    padding: 0 16px;
    gap: 12px;
  }

  .contact-form__row {
    flex-direction: column;
    gap: 12px;
  }

  .contact-form__input {
    height: 48px;
  }

  .contact-form__input--textarea {
    height: 104px;
  }

  .contact-form__submit {
    margin-top: 12px;
    padding: 0 16px 0 32px;
  }

  /* ---- Success modal (Figma 333:5388) ---- */
  .success-modal {
    padding: 10px 16px;
  }

  .success-modal__card {
    padding: 72px 24px 24px;
    border-radius: 40px;
    gap: 24px;
  }

  .success-modal__content {
    gap: 24px;
  }

  .success-modal__message {
    gap: 20px;
  }

  .success-modal__title {
    font-size: 32px;
    line-height: 40px;
    letter-spacing: -1.92px;
  }

  /* "Dziękujemy za" переносится на свою строку — тот же приём display:block,
     что у .contact-form__title-muted */
  .success-modal__title-muted {
    display: block;
  }

  .success-modal__title-word::after {
    top: 23.06px;
    height: 11.94px;
  }

  .success-modal__desc {
    font-size: 18px;
    line-height: 28px;
    letter-spacing: -0.72px;
    max-width: none;
  }
}
