/* ============================================================
   components.css — переиспользуемые компоненты:
   .btn, .site-header, .burger, .nav-overlay,
   .site-footer, .contact + .contact-form,
   .fade-in-up.
   Mobile-first; БЭМ.
   Размеры — по design/Desktop podrobno.png,
                   design/plansher podobno.png,
                   design/cmartfon podrobno.png.
   ============================================================ */

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;             /* mobile */
  border-radius: 8px;
  font-family: inherit;
  font-weight: var(--fw-semibold);
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.2s ease-out,
              color 0.2s ease-out,
              border-color 0.2s ease-out;
}

@media (min-width: 768px) {
  .btn {
    padding: 14px 45px;
  }
}

.btn--primary {
  background-color: var(--color-primary);
  color: #fff;
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--color-primary-hover);
  color: #fff;
}

.btn--white-on-blue {
  background-color: #fff;
  color: var(--color-primary);
}
.btn--white-on-blue:hover,
.btn--white-on-blue:focus-visible {
  background-color: var(--color-bg-elements);
  color: var(--color-primary-hover);
}

.btn--secondary {
  background-color: #fff;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--secondary:hover,
.btn--secondary:focus-visible {
  background-color: var(--color-primary);
  color: #fff;
}

.btn--ghost {
  background-color: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.btn--full {
  width: 100%;
}

/* ============================================================
   Site header (non-sticky)
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;                     /* ниже nav-overlay (100), но выше всего контента */
  background-color: var(--color-bg-site);
  color: var(--color-text-main);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;                /* mobile */
}

/* Лого */
.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;                       /* mobile */
  color: inherit;
}
.site-header__logo:hover,
.site-header__logo:focus-visible {
  color: inherit;
}
.site-header__logo-icon {
  display: inline-block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .site-header__logo-icon {
    width: 30px;
    height: 30px;
  }
}
@media (min-width: 1025px) {
  .site-header__logo-icon {
    width: 32px;
    height: 32px;
  }
}
.site-header__logo-text {
  color: var(--color-logo-text);
  font-weight: var(--fw-bold);
  font-size: 18px;                 /* mobile */
  line-height: 1;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .site-header__logo-text {
    font-size: 20px;
  }
}
@media (min-width: 1025px) {
  .site-header__logo-text {
    font-size: 22px;
  }
}

/* Десктопная навигация — скрыта на mobile/tablet */
.site-nav {
  display: none;
}
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav__link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  color: var(--color-text-main);
  font-size: 16px;
  font-weight: var(--fw-regular);
  transition: background-color 0.2s ease-out, color 0.2s ease-out;
}
.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--color-primary);
}
.site-nav__link--active,
.site-nav__link[aria-current="page"] {
  background: none;
  background-color: transparent;
  color: var(--color-primary);
  font-weight: var(--fw-semibold);
}
.site-nav__link--active:hover,
.site-nav__link--active:focus-visible,
.site-nav__link[aria-current="page"]:hover,
.site-nav__link[aria-current="page"]:focus-visible {
  background: none;
  background-color: transparent;
  color: var(--color-primary-hover);
}

/* CTA в шапке — скрыта на mobile/tablet */
.site-header__cta {
  display: none;
}

/* Бургер-иконка — видна на mobile/tablet */
.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 24px;                     /* mobile */
  height: 24px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.burger__line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text-main);
  border-radius: 2px;
  transition: background-color 0.2s ease-out;
}

/* Синяя версия шапки (используется только когда хедер расположен на цветном фоне) */
.site-header--blue {
  background-color: var(--color-primary);
  color: #fff;
}
.site-header--blue .site-header__logo-text {
  color: #fff;
}
.site-header--blue .site-nav__link {
  color: #fff;
}
.site-header--blue .site-nav__link--active {
  color: #fff;
  font-weight: var(--fw-semibold);
}
.site-header--blue .burger__line {
  background-color: #fff;
}

/* ---------- Tablet (≥768px): шапка чуть выше, бургер 22px ---------- */
@media (min-width: 768px) {
  .site-header__inner {
    min-height: 72px;
  }
  .site-header__logo {
    gap: 12px;
  }
  .burger {
    width: 22px;
    height: 22px;
  }
}

/* ---------- Desktop (≥1025px): nav + CTA, бургер скрыт ---------- */
@media (min-width: 1025px) {
  .site-header__inner {
    min-height: 80px;
    gap: 40px;
  }
  .site-header__logo {
    gap: 14px;
  }
  .site-nav {
    display: block;
    margin-inline-start: auto;
  }
  .site-nav__list {
    gap: 40px;
  }
  .site-header__cta {
    display: inline-flex;
    padding: 14px 25px;            /* как просили: 25px по горизонтали */
  }
  .burger {
    display: none;
  }
}

/* ============================================================
   Nav overlay (mobile/tablet)
   ============================================================ */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: var(--color-primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 12px 24px;              /* mobile */
  overscroll-behavior: contain;
}
.nav-overlay[hidden] {
  display: none;
}

.nav-overlay__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.nav-overlay__logo-text {
  font-weight: var(--fw-semibold);
  font-size: 18px;
  color: #fff;
}
.nav-overlay__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nav-overlay__nav {
  flex: 1;
  display: flex;
  align-items: flex-start;
}
.nav-overlay__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
}
.nav-overlay__link {
  display: block;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: var(--fw-regular);
  transition: background-color 0.2s ease-out;
}
.nav-overlay__link:hover,
.nav-overlay__link:focus-visible {
  background-color: var(--color-primary-hover);
  color: #fff;
}
.nav-overlay__link--active {
  background-color: var(--color-primary-hover);
}

/* На tablet — больший padding и шире шаги между пунктами */
@media (min-width: 768px) {
  .nav-overlay {
    padding: 24px 50px;
  }
  .nav-overlay__list {
    gap: 16px;
    margin-top: 32px;
  }
  .nav-overlay__link {
    font-size: 20px;
    padding: 14px 20px;
  }
}

/* На desktop overlay не используется (бургер скрыт), но на всякий случай */
@media (min-width: 1025px) {
  .nav-overlay {
    display: none;
  }
}

/* Когда меню открыто — блокируем скролл страницы */
.is-menu-open {
  overflow: hidden;
}

/* ============================================================
   Site footer (двухуровневый, синий фон)
   ============================================================ */
.site-footer {
  background-color: var(--color-primary);
  color: #fff;
}
.site-footer a {
  color: #fff;
}
.site-footer a:hover,
.site-footer a:focus-visible {
  color: rgba(255, 255, 255, 0.85);
}

/* Верхний уровень */
.site-footer__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
  padding-block: 30px;             /* mobile */
}
.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Пара логотипов (УниДрайв + Фонд) в одну линию */
.site-footer__brands {
  display: flex;
  align-items: center;
  gap: 32px;
}
.site-footer__brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.site-footer__brand-logo {
  height: 56px;
  width: auto;
  display: block;
}
.site-footer__brand-logo--fund {
  height: 56px;
}

.site-footer__support-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* Контакты в правой колонке — со SVG-иконками */
.site-footer__contacts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.site-footer__contact {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
}
.site-footer__contact a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}
.site-footer__contact a:hover,
.site-footer__contact a:focus-visible {
  color: rgba(120, 200, 255, 1);
}
.site-footer__contact-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .site-footer__brands {
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .site-footer__brand-logo {
    height: 44px;
  }
}

/* Разделитель */
.site-footer__divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.15);
  border: 0;
  margin: 0;
}

/* Нижний уровень */
.site-footer__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-block: 20px;             /* mobile */
  text-align: center;
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 24px;
  font-size: 14px;
}
.site-footer__copy {
  font-size: 14px;
  opacity: 0.85;
}

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
  .site-footer__top {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    gap: 32px;
    padding-block: 50px 32px;
  }
  .site-footer__brand {
    align-items: flex-start;
  }
  .site-footer__contacts {
    align-items: flex-start;
  }
  .site-footer__contact {
    justify-content: flex-start;
  }
  .site-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding-block: 16px;
  }
  .site-footer__nav {
    justify-content: flex-start;
  }
}

/* ---------- Desktop ---------- */
@media (min-width: 1025px) {
  .site-footer__top {
    padding-block: 50px 56px;
  }
  .site-footer__bottom {
    padding-block: 16px;
  }
}

/* ============================================================
   Section .contact + .contact-form
   ============================================================ */
.contact {
  position: relative;
  padding-block: 40px;
  background-color: var(--color-bg-site);
  overflow: hidden;             /* декоративные орбы (на index.html) не вылазят */
}
/* Внутренние блоки гарантированно поверх .contact__decor */
.contact .container,
.contact__inner,
.contact__intro,
.contact-form-card {
  position: relative;
  z-index: 1;
}

.contact__inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.contact__intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact__title {
  color: var(--color-primary);
  font-size: 32px;
  font-weight: var(--fw-semibold);
  line-height: 1.15;
  margin: 0 0 16px;
}
.contact__text {
  color: var(--color-text-main);
  font-size: 18px;
  line-height: 1.5;
  margin: 0;
  max-width: 520px;
}
@media (min-width: 768px) {
  .contact__title { font-size: 36px; }
  .contact__text  { font-size: 20px; }
}
@media (min-width: 1025px) {
  .contact__title { font-size: 44px; }
  .contact__text  { font-size: 20px; }
}

/* Карточка-форма */
.contact-form-card {
  position: relative;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(2, 83, 145, 0.08);
  padding: 20px;                    /* mobile: spec говорит 20px */
  width: 100%;
  max-width: 312px;                 /* mobile */
  margin-inline: auto;
  animation: contactCardGlow 5s ease-in-out infinite;
}
/* Пульсирующее свечение вокруг карточки */
@keyframes contactCardGlow {
  0%, 100% {
    box-shadow:
      0 10px 40px rgba(2, 83, 145, 0.10),
      0 0 0 0 rgba(80, 150, 255, 0);
  }
  50% {
    box-shadow:
      0 15px 50px rgba(2, 83, 145, 0.18),
      0 0 60px 5px rgba(80, 150, 255, 0.15);
  }
}
/* Бегущая по периметру обводка через conic-gradient + mask-composite */
.contact-form-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(80, 150, 255, 0.6) 80deg,
    transparent 120deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: contactBorderRotate 6s linear infinite;
  pointer-events: none;
  z-index: -1;
}
@keyframes contactBorderRotate {
  to { transform: rotate(360deg); }
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-form__title {
  font-size: 20px;
  font-weight: var(--fw-semibold);
  color: var(--color-text-main);
  margin-bottom: 6px;
}
.contact-form__row {
  display: grid;
  grid-template-columns: 1fr;       /* mobile: в столбик */
  gap: 14px;
}
.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.contact-form__label {
  font-weight: var(--fw-regular);
}
.required-mark {
  color: var(--color-primary);
  font-weight: var(--fw-bold);
}
.contact-form__input {
  width: 100%;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--color-text-main);
  background-color: #fff;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background-image 0.2s ease;
}
.contact-form__input:hover {
  border-color: var(--color-text-secondary);
}
.contact-form__input:focus,
.contact-form__input:focus-visible {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(2, 83, 145, 0.12);
  transform: translateY(-1px);
}
.contact-form__field:focus-within .contact-form__label {
  color: var(--color-primary);
  transition: color 0.25s ease;
}
.contact-form__textarea {
  resize: vertical;
  min-height: 84px;
}
.contact-form__input.is-invalid,
.contact-form__textarea.is-invalid {
  border-color: #d32f2f;
}
.contact-form__input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
}
/* Успешная валидация поля — лёгкая зелёная подсветка + чек-иконка справа */
.contact-form__input.is-valid {
  border-color: rgba(34, 197, 94, 0.6);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2322c55e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 8 7 12 13 4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 40px;
}
.contact-form__textarea.is-valid {
  background-position: right 14px top 14px;
}

/* Honeypot — полностью скрыт от пользователей и скринридеров не блокирует фокус,
   но tabindex="-1" в HTML уберёт из tab-цепочки */
.contact-form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form__error {
  color: #d32f2f;
  font-size: 14px;
  line-height: 1.4;
}
.contact-form__submit {
  margin-top: 8px;
  position: relative;
  overflow: hidden;
  transition: background-color 0.25s ease, transform 0.15s ease,
              box-shadow 0.25s ease, opacity 0.2s ease;
}
/* Hover lift только на устройствах с указателем — иначе на тач залипает */
@media (hover: hover) and (pointer: fine) {
  .contact-form__submit:not(:disabled):hover {
    background-color: var(--color-primary-hover);
    box-shadow: 0 8px 24px rgba(2, 83, 145, 0.35);
    transform: translateY(-2px);
  }
}
.contact-form__submit:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(2, 83, 145, 0.3);
}
.contact-form__submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* ============================================================
   Чекбокс согласия
   ============================================================ */
.contact-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-top: 4px;
}
/* Скрываем системный чекбокс ВИЗУАЛЬНО, но оставляем для доступности */
.contact-form__consent-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.contact-form__consent-box {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid #C9CFD6;
  border-radius: 4px;
  background-color: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.contact-form__consent-box svg {
  width: 14px;
  height: 14px;
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}
.contact-form__consent-input:checked + .contact-form__consent-box {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}
.contact-form__consent-input:checked + .contact-form__consent-box svg {
  opacity: 1;
  transform: scale(1);
}
.contact-form__consent-input:focus-visible + .contact-form__consent-box {
  box-shadow: 0 0 0 3px rgba(2, 83, 145, 0.18);
}
.contact-form__consent-text a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}
.contact-form__consent-text a:hover,
.contact-form__consent-text a:focus-visible {
  color: var(--color-primary-hover);
}

/* Loading-состояние кнопки submit */
.contact-form__submit.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.contact-form__submit.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: form-spinner 0.8s linear infinite;
}
@keyframes form-spinner {
  to { transform: rotate(360deg); }
}

/* Success-блок — занимает место формы */
.form-success {
  text-align: center;
  padding: 32px 12px;
  font-size: 16px;
  color: var(--color-text-main);
  line-height: 1.5;
  animation: contactSuccess 0.5s ease-out;
}
@keyframes contactSuccess {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ============================================================
   Усиленное появление при скролле (overshoot easing) +
   стэгер полей формы.
   Срабатывает через существующий IntersectionObserver
   (.fade-in-up → .is-visible) из animations.js.
   ============================================================ */

/* Интро-блок: scale + translateY с overshoot-easing */
.contact__intro.fade-in-up {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition:
    opacity   0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.contact__intro.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Карточка-форма: то же + задержка 0.2s после интро */
.contact-form-card.fade-in-up {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition:
    opacity   0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0.2s;
}
.contact-form-card.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Стэгер полей: каждое появляется со сдвигом 100ms.
   :nth-child работает per parent — для row сработает на 2 полях внутри row,
   для прямых детей формы — на email/company/message-полях по их индексу. */
.contact-form__field {
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.contact-form-card.is-visible .contact-form__field {
  opacity: 1;
  transform: translateX(0);
}
.contact-form-card.is-visible .contact-form__field:nth-child(1) { transition-delay: 0.35s; }
.contact-form-card.is-visible .contact-form__field:nth-child(2) { transition-delay: 0.45s; }
.contact-form-card.is-visible .contact-form__field:nth-child(3) { transition-delay: 0.55s; }
.contact-form-card.is-visible .contact-form__field:nth-child(4) { transition-delay: 0.65s; }
.contact-form-card.is-visible .contact-form__field:nth-child(5) { transition-delay: 0.75s; }

/* Focus-dim: соседние поля слегка тускнеют, текущее немного крупнеет */
.contact-form-card:focus-within .contact-form__field:not(:focus-within) {
  opacity: 0.6;
  transition: opacity 0.3s ease;
}
.contact-form__field:focus-within {
  opacity: 1;
  transform: scale(1.02);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ============================================================
   Прогресс-бар заполнения формы
   ============================================================ */
.contact-form__progress {
  width: 100%;
  height: 3px;
  background: rgba(2, 83, 145, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.contact-form__progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), rgba(80, 180, 255, 1));
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 8px rgba(80, 150, 255, 0.6);
  will-change: width;
}

/* Reduced motion для формы — отключаем все доп. анимации формы */
@media (prefers-reduced-motion: reduce) {
  .contact-form__input,
  .contact-form__submit,
  .contact-form-card,
  .contact-form-card::before,
  .contact-form__progress-bar,
  .contact-form__field {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  .contact__intro.fade-in-up,
  .contact__intro.fade-in-up.is-visible,
  .contact-form-card.fade-in-up,
  .contact-form-card.fade-in-up.is-visible,
  .contact-form__field {
    opacity: 1 !important;
    transform: none !important;
  }
  .form-success {
    animation: none !important;
  }
  .contact-form__consent-input:checked + .contact-form__consent-box svg {
    transition: none !important;
  }
}

/* Mobile: убираем бегущую обводку (тяжёлая) */
@media (max-width: 767px) {
  .contact-form-card::before {
    display: none;
  }
}

/* ---------- Tablet ---------- */
@media (min-width: 768px) {
  .contact {
    padding-block: 60px;
  }
  .contact__inner {
    flex-direction: row;
    align-items: stretch;
    gap: 40px;
  }
  .contact__intro {
    flex: 1;
    justify-content: center;
  }
  .contact-form-card {
    flex: 0 0 auto;
    width: 320px;
    max-width: none;
    padding: 19px 18px;
    margin-inline: 0;
  }
  .contact-form__row {
    grid-template-columns: 1fr 1fr;  /* tablet+desktop: Имя+Телефон в одну строку */
    gap: 14px;
  }
}

/* ---------- Desktop ---------- */
@media (min-width: 1025px) {
  .contact {
    padding-block: 80px;
  }
  .contact__inner {
    gap: 64px;
    align-items: center;
  }
  .contact-form-card {
    width: 487px;
    padding: 30px 32px;
  }
  .contact-form {
    gap: 18px;
  }
  .contact-form__title {
    font-size: 24px;
    margin-bottom: 4px;
  }
  .contact-form__row {
    gap: 22px;
  }
  .contact-form__submit {
    margin-top: 33px;                /* итого ~51px от полей с учётом form gap */
  }
}

/* ============================================================
   Fade-In-Up animation
   ============================================================ */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
}
.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fade-in-up,
  .fade-in-up.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   Якоря (запас под фиксированную геометрию хедера)
   ============================================================ */
#contact-form {
  scroll-margin-top: 80px;
}

/* ============================================================
   Placeholder — заглушка для будущих изображений.
   Заменится на <img> или <picture>, когда поступят ассеты.
   ============================================================ */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: linear-gradient(135deg, #D5E5F2, #B8D2E8);
  color: var(--color-primary);
  font-weight: var(--fw-semibold);
  border-radius: 10px;
  text-align: center;
  padding: 16px;
  box-sizing: border-box;
}
.placeholder--ratio-1-1   { aspect-ratio: 1 / 1; }
.placeholder--ratio-4-3   { aspect-ratio: 4 / 3; }
.placeholder--ratio-16-9  { aspect-ratio: 16 / 9; }

/* ============================================================
   Глобальные анимационные расширения
   ============================================================ */

/* Шапка: появление сверху при загрузке */
.site-header {
  animation: headerEnter 0.5s ease-out;
}
@keyframes headerEnter {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Подчёркивание nav-ссылок (только на устройствах с указателем) */
.site-nav__link {
  position: relative;
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (hover: hover) and (pointer: fine) {
  .site-nav__link:hover::after,
  .site-nav__link:focus-visible::after {
    transform: scaleX(1);
  }
}
.site-nav__link--active::after {
  transform: scaleX(1);
}

/* Футер — fade-in-up при попадании в viewport (через fade-in-up класс).
   Не добавляем класс fade-in-up в HTML — добавим в footer-стилях прямую анимацию
   по window-load для надёжности. */
.site-footer {
  animation: footerEnter 0.7s ease-out;
}
@keyframes footerEnter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Иконки контактов: wobble при hover */
@media (hover: hover) and (pointer: fine) {
  .site-footer__contact a:hover .site-footer__contact-icon {
    animation: footerIconWobble 0.4s ease-in-out;
  }
}
@keyframes footerIconWobble {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-8deg); }
  75%      { transform: rotate(8deg); }
}

/* Логотипы — лёгкий tilt при hover */
@media (hover: hover) and (pointer: fine) {
  .site-footer__brand-link:hover .site-footer__brand-logo,
  .site-footer__brand-logo--fund {
    transition: transform 0.3s ease-out;
  }
  .site-footer__brand-link:hover .site-footer__brand-logo {
    transform: rotate(2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-footer {
    animation: none !important;
  }
  .site-nav__link::after {
    transition: none !important;
  }
  .site-footer__contact a:hover .site-footer__contact-icon,
  .site-footer__brand-link:hover .site-footer__brand-logo {
    animation: none !important;
    transform: none !important;
  }
}
