/* ── Модальне вікно: заявка на замірника ─────────────────────── */

.surveyor-modal {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 28px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.surveyor-modal.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.surveyor-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 22, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.surveyor-modal__dialog {
  position: relative;
  width: min(100%, 440px);
  max-height: min(92vh, 640px);
  overflow-y: auto;
  margin: auto;
  background: #fff;
  border-radius: clamp(12px, 2.5vw, 16px);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.surveyor-modal.is-open .surveyor-modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.surveyor-modal__close {
  position: absolute;
  top: clamp(10px, 2vw, 14px);
  right: clamp(10px, 2vw, 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #f3f4f6;
  color: #374151;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  z-index: 2;
}

.surveyor-modal__close:hover {
  background: #e5e7eb;
  color: #111;
}

.surveyor-modal__header {
  padding: clamp(20px, 4vw, 28px) clamp(20px, 4vw, 28px) clamp(8px, 2vw, 12px);
  padding-right: 52px;
}

.surveyor-modal__title {
  margin: 0 0 8px;
  font-size: clamp(1.15rem, 3.8vw, 1.35rem);
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.surveyor-modal__lead {
  margin: 0;
  font-size: clamp(0.875rem, 2.6vw, 0.95rem);
  color: #6b7280;
  line-height: 1.5;
}

.surveyor-modal__form {
  padding: clamp(8px, 2vw, 12px) clamp(20px, 4vw, 28px) clamp(22px, 4vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3vw, 18px);
}

.surveyor-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.surveyor-modal__label {
  font-size: clamp(0.8rem, 2.2vw, 0.875rem);
  font-weight: 600;
  color: #374151;
}

.surveyor-modal__input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.45;
  color: #111827;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.surveyor-modal__input::placeholder {
  color: #9ca3af;
}

.surveyor-modal__input:hover {
  border-color: #d1d5db;
}

.surveyor-modal__input:focus {
  outline: none;
  background: #fff;
  border-color: #21562e;
  box-shadow: 0 0 0 3px rgba(33, 86, 46, 0.18);
}

.surveyor-modal__input--textarea {
  min-height: 88px;
  resize: vertical;
}

.surveyor-modal__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.surveyor-modal__msg {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.surveyor-modal__msg--ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.surveyor-modal__msg--err {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.surveyor-modal__actions {
  margin-top: 4px;
}

.surveyor-modal__submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: #db2b2f;
  border: 1px solid #db2b2f;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}

.surveyor-modal__submit:hover:not(:disabled) {
  background: #c41e22;
  border-color: #c41e22;
}

.surveyor-modal__submit:active:not(:disabled) {
  transform: scale(0.99);
}

.surveyor-modal__submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.surveyor-modal__extra {
  margin: 4px 0 0;
  text-align: center;
}

.surveyor-modal__extra-link {
  font-size: 0.875rem;
  color: #21562e;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.surveyor-modal__extra-link:hover {
  color: #163a1f;
}

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

@media (max-width: 380px) {
  .surveyor-modal__dialog {
    width: 100%;
  }
}
