.contact-modal {
  width: min(100%, 760px);
  max-width: calc(100% - 32px);
  max-height: min(92vh, 920px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: visible;
  z-index: 1200;
  opacity: 0;
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-modal::backdrop {
  background:
    radial-gradient(circle at top, rgba(99, 102, 241, 0.24), transparent 34%),
    rgba(3, 6, 15, 0.82);
  backdrop-filter: blur(22px);
  opacity: 0;
  transition:
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    backdrop-filter 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-modal[open][data-state="opening"],
.contact-modal[open][data-state="open"],
.contact-modal[open][data-state="closing"] {
  opacity: 1;
}

.contact-modal[open][data-state="opening"]::backdrop,
.contact-modal[open][data-state="open"]::backdrop {
  opacity: 1;
}

.contact-modal[open][data-state="closing"] {
  opacity: 0;
}

.contact-modal[open][data-state="closing"]::backdrop {
  opacity: 0;
}

.contact-modal__dialog {
  position: relative;
  width: 100%;
  max-height: min(92vh, 920px);
  overflow: hidden;
  border-radius: 32px;
  border: 1px solid rgba(129, 140, 248, 0.2);
  background:
    radial-gradient(circle at 18% 16%, rgba(99, 102, 241, 0.16), transparent 26%),
    radial-gradient(circle at 84% 12%, rgba(34, 211, 238, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(16, 21, 40, 0.96), rgba(9, 14, 28, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 36px 90px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(56px) scale(0.92) rotateX(10deg);
  transform-origin: center top;
  transition:
    opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.42s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-modal[open][data-state="opening"] .contact-modal__dialog,
.contact-modal[open][data-state="open"] .contact-modal__dialog {
  opacity: 1;
  transform: translateY(0) scale(1) rotateX(0deg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 46px 110px rgba(0, 0, 0, 0.56);
}

.contact-modal[open][data-state="closing"] .contact-modal__dialog {
  opacity: 0;
  transform: translateY(38px) scale(0.95) rotateX(6deg);
}

.contact-modal__scroll {
  max-height: min(92vh, 920px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 34px;
  scrollbar-gutter: stable;
}

.contact-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(129, 140, 248, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #eef2ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.contact-modal__close:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.32);
  background: rgba(99, 102, 241, 0.12);
}

.contact-modal__header {
  margin-bottom: 28px;
  padding-right: 44px;
  color: #fff;
}

.contact-modal__header h3 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 40px;
  line-height: 1.02;
  letter-spacing: -1.4px;
}

.contact-modal__header p {
  max-width: 42ch;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.7;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-form__field--full {
  grid-column: 1 / -1;
}

.contact-form__field span {
  color: #eef2ff;
  font-size: 14px;
  font-weight: 600;
}

.contact-form__field input,
.contact-form__field textarea {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(129, 140, 248, 0.18);
  border-radius: 18px;
  background: rgba(6, 10, 22, 0.76);
  color: #fff;
  font: inherit;
  outline: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.contact-form__field textarea {
  resize: vertical;
  min-height: 132px;
}

.contact-form__field input::placeholder,
.contact-form__field textarea::placeholder {
  color: rgba(148, 163, 184, 0.88);
}

.contact-form__field input:focus,
.contact-form__field textarea:focus {
  border-color: rgba(129, 140, 248, 0.56);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  background: rgba(10, 15, 28, 0.92);
}

.contact-form__field input[aria-invalid="true"],
.contact-form__field textarea[aria-invalid="true"] {
  border-color: rgba(248, 113, 113, 0.74);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.1);
}

.contact-form__error {
  min-height: 18px;
  color: #fda4af;
  font-size: 13px;
  line-height: 1.35;
}

.contact-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.contact-form__status {
  min-height: 24px;
  color: #cbd5f5;
  font-size: 14px;
}

.contact-form__status.is-success {
  color: #86efac;
}

.contact-form__status.is-error {
  color: #fda4af;
}

.contact-form__submit {
  border: 0;
  cursor: pointer;
}

.contact-form__submit[disabled] {
  opacity: 0.72;
  cursor: wait;
  transform: none;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.24);
}

@media (max-width: 768px) {
  .contact-modal {
    max-width: calc(100% - 20px);
  }

  .contact-modal__dialog {
    border-radius: 24px;
  }

  .contact-modal__scroll {
    padding: 24px 20px 22px;
  }

  .contact-modal__header {
    padding-right: 36px;
  }

  .contact-modal__header h3 {
    font-size: 32px;
  }

  .contact-form__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .contact-form__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .contact-form__submit {
    width: 100%;
  }
}
