body.is-modal-open {
  overflow: hidden;
}

.contact-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  z-index: 200;
}

.contact-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: rgba(6, 40, 61, 0.55);
  cursor: pointer;
}

.contact-modal-dialog {
  position: relative;
  width: min(100%, 570px);
  max-height: 100%;
  padding: 48px 50px 44px;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transform: translateY(18px);
  transition: transform 0.28s ease;
}

.contact-modal.is-open .contact-modal-dialog {
  transform: translateY(0);
}

.contact-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(65, 181, 230, 0.12);
  cursor: pointer;
  transition: background 0.2s ease;
}

.contact-modal-close:hover {
  background: rgba(65, 181, 230, 0.24);
}

.contact-modal-close::before,
.contact-modal-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.contact-modal-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.contact-modal-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.contact-modal .section-heading {
  gap: 18px;
  margin-bottom: 22px;
  padding-right: 40px;
}

.contact-modal .section-heading h2 {
  font-size: 32px;
}

.contact-modal .heading-line {
  width: 140px;
}

.contact-modal-text {
  margin: 0 0 26px;
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.55;
}

.contact-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-field span {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  min-height: 56px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  outline: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.contact-field textarea {
  min-height: 112px;
  resize: vertical;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: var(--text-soft);
  opacity: 0.6;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: var(--accent-strong);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--contacts-bg);
}

.contact-field input.is-invalid,
.contact-field textarea.is-invalid {
  border-color: #d9534f;
  box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.14);
}

.contact-field-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

.contact-form-status {
  display: none;
  margin: 0;
  color: #c9302c;
  font-size: 15px;
  line-height: 1.4;
}

.contact-form-status.is-visible {
  display: block;
}

.contact-form .btn,
.contact-modal-success .btn {
  width: 100%;
  margin-top: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.contact-form .btn:hover,
.contact-modal-success .btn:hover {
  background: var(--accent-strong);
}

.contact-form .btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.contact-form-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.contact-form-note a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-modal-success[hidden],
.contact-modal-body[hidden] {
  display: none;
}

.contact-modal-success .contact-modal-text {
  margin-bottom: 20px;
}

/* reCAPTCHA v3 badge is replaced by the notice under the form. */
.grecaptcha-badge {
  visibility: hidden;
}

@media (max-width: 1100px) {
  .contact-modal {
    padding: 16px;
  }

  .contact-modal-dialog {
    padding: 32px 20px 28px;
  }

  .contact-modal-close {
    top: 12px;
    right: 12px;
  }

  .contact-modal .section-heading {
    gap: 10px;
    margin-bottom: 16px;
  }

  .contact-modal .section-heading h2 {
    font-size: 22px;
  }

  .contact-modal .heading-line {
    width: 100px;
    height: 3px;
  }

  .contact-modal-text {
    margin-bottom: 18px;
    font-size: 14px;
  }

  .contact-form {
    gap: 12px;
  }

  .contact-field span {
    font-size: 13px;
  }

  .contact-field input,
  .contact-field textarea {
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 12px;
  }

  .contact-field textarea {
    min-height: 96px;
  }

  .contact-form .btn,
  .contact-modal-success .btn {
    min-height: 48px;
    font-size: 15px;
  }
}
