/* ================================================================
   CONTACT FORM: CYBER COMMAND CENTER (MODERN RESPONSIVE)
   ================================================================ */

.contact-form {
  width: 100%;
  /* Убираем жесткие паддинги, контейнер сам справится */
  padding: 0;
  margin-top: var(--cf-spacing-y);
  margin-bottom: clamp(2rem, 5vh, 4rem);
  position: relative;
  z-index: 5;
  overflow: hidden;
  isolation: isolate;
  /* Создает новый контекст стекирования */
}

/* --- BACKGROUND FX --- */

/* Фоновое свечение (Фиолетово-синее) */

.contact__glow {
  position: absolute;
  bottom: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(300px, 80%, 1000px);
  /* Ограничиваем ширину пятна */
  height: 80%;
  background: radial-gradient(
    ellipse at center,
    rgba(59, 130, 246, 0.15) 0%,
    transparent 70%
  );
  filter: blur(80px);
  /* Чуть меньше блюра для производительности */
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}

/* Сетка на фоне */

.contact__grid-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: clamp(30px, 4vw, 50px) clamp(30px, 4vw, 50px);
  /* Адаптивная клетка */
  mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(
    circle at center,
    black 40%,
    transparent 85%
  );
  z-index: -1;
  pointer-events: none;
}

/* --- MAIN CONTAINER --- */

.contact-form__container {
  /* Современная центровка с безопасными отступами */
  width: min(100% - 3rem, 1440px);
  margin-inline: auto;
  display: flex;
  gap: var(--cf-gap);
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

/* =========================
   LEFT SIDE: INFO
   ========================= */

.contact-form__info {
  flex: 1;
  /* На десктопе ширина ограничена, на мобильном растянется */
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vh, 3rem);
}

.contact-form__header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form__title {
  color: #fff;
  font-family: var(--font-display, sans-serif);
  font-size: var(--fs-title-section);
  line-height: 1.1;
  /* Балансировка текста, чтобы не висело одно слово */
  text-wrap: balance;
}

.text-highlight {
  color: var(--c-accent, #3b82f6);
  text-shadow: 0 0 20px var(--c-accent-glow, rgba(59, 130, 246, 0.5));
  white-space: nowrap;
  /* Не разрывать ключевые фразы */
}

.contact-form__text {
  color: var(--c-text-muted, #94a3b8);
  font-family: var(--font-main, sans-serif);
  font-size: clamp(1rem, 1.1vw, 1.15rem);
  line-height: 1.6;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding-left: 1.5rem;
  /* Умный перенос */
  text-wrap: pretty;
}

/* Контакты */

.contact-form__contact {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 0.5rem;
}

.icon-box {
  width: clamp(3rem, 5vw, 3.5rem);
  height: clamp(3rem, 5vw, 3.5rem);
  flex-shrink: 0;
  /* Чтобы круг не сжимался */
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-accent, #3b82f6);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
  font-size: 1.2rem;
}

.contact-form__email {
  color: #fff;
  font-family: var(--font-display, sans-serif);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.contact-form__email:hover {
  color: var(--c-accent, #3b82f6);
  text-shadow: 0 0 15px var(--c-accent-glow, rgba(59, 130, 246, 0.5));
}

/* =========================
   RIGHT SIDE: FORM (GLASS)
   ========================= */

.contact-form__wrapper {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  /* Прижимаем вправо на десктопе */
  width: 100%;
}

.contact-form__form {
  position: relative;
  width: 100%;
  max-width: 34rem;
  /* Чуть шире стандартных 512px */
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vh, 1.5rem);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  /* Важно для мобильных, чтобы не вылезало */
  box-sizing: border-box;
}

/* Стеклянный фон формы */

.form-glass-bg {
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  background: linear-gradient(
    180deg,
    rgba(20, 20, 25, 0.8) 0%,
    rgba(10, 10, 15, 0.95) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  /* Safari fix */
  z-index: -1;
}

/* Поля ввода */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.form-field__label {
  color: #fff;
  font-family: var(--font-main, sans-serif);
  font-size: 0.9rem;
  font-weight: 600;
  margin-left: 0.5rem;
  letter-spacing: 0.02em;
}

.form-field__input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0 1.2rem;
  height: var(--cf-input-height);
  color: #fff;
  font-family: var(--font-main, sans-serif);
  font-size: 1rem;
  transition: all 0.3s ease;
  width: 100%;
  /* Убирает дефолтные стили iOS */
  appearance: none;
  -webkit-appearance: none;
}

.form-field__input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-field__input:focus {
  outline: none;
  border-color: var(--c-accent, #3b82f6);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

/* CUSTOM SELECT */

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select__trigger {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0 1.2rem;
  height: var(--cf-input-height);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-main, sans-serif);
  font-size: 1rem;
  transition: all 0.3s ease;
  user-select: none;
}

/* Эффект нажатия на мобильных */

.custom-select__trigger:active {
  background: rgba(255, 255, 255, 0.08);
}

.custom-select.active .custom-select__trigger {
  border-color: var(--c-accent, #3b82f6);
  background: rgba(59, 130, 246, 0.05);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.custom-select__value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

.custom-select__arrow {
  transition: transform 0.3s ease;
  opacity: 0.7;
  flex-shrink: 0;
}

.custom-select.active .custom-select__arrow {
  transform: rotate(180deg);
  color: var(--c-accent, #3b82f6);
  opacity: 1;
}

/* Dropdown Menu */

.custom-select__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1a1f;
  /* Сплошной цвет для читаемости */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-bottom-left-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  /* Плавная анимация */
  z-index: 100;
}

.custom-select.active .custom-select__dropdown {
  max-height: 300px;
  /* Достаточно места для скролла */
  opacity: 1;
  overflow-y: auto;
}

/* Scrollbar styling for dropdown */

.custom-select__dropdown::-webkit-scrollbar {
  width: 6px;
}

.custom-select__dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.custom-select__option {
  padding: 0.9rem 1.2rem;
  /* Чуть больше паддинг для пальцев */
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.custom-select__option:first-child {
  border-top: none;
}

.custom-select__option:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.custom-select__option.selected {
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
  font-weight: 500;
}
