.avaia-contact-modal[hidden] {
  display: none !important;
}

.avaia-contact-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  isolation: isolate;
  overflow-y: auto;
}

.avaia-contact-backdrop {
  position: fixed;
  inset: 0;
  background: #000;
}

.avaia-contact-viewport {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100%;
  align-items: flex-start;
  justify-content: center;
  padding: 0.75rem;
}

.avaia-contact-panel {
  position: relative;
  width: 100%;
  max-width: 28rem;
  margin-block: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.28);
}

.avaia-contact-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #1c2b3a;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.avaia-contact-close:hover {
  color: #6b1010;
  background: rgba(107, 16, 16, 0.06);
}

.avaia-contact-close:focus-visible,
.avaia-contact-modal :is(input, select, textarea, button, a):focus-visible {
  outline: 3px solid #e0a75e;
  outline-offset: 3px;
}

.avaia-contact-title {
  margin: 0 2.75rem 0.5rem;
  color: #111827;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.avaia-contact-intro {
  margin: 0 0 1.5rem;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

.services-modal-fields {
  display: grid;
  gap: 1rem;
}

.avaia-contact-field label {
  display: block;
  margin-bottom: 0.25rem;
  color: #374151;
}

.avaia-contact-field input,
.avaia-contact-field select,
.avaia-contact-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background: #fff;
  color: #1c2b3a;
}

.avaia-contact-field textarea {
  resize: vertical;
}

.avaia-contact-optional {
  color: #9ca3af;
  font-weight: 400;
}

.services-qualification-note {
  margin: 0;
  padding: 0.75rem 0.875rem;
  border: 1px solid rgba(28, 43, 58, 0.2);
  border-radius: 0.75rem;
  background: rgba(224, 167, 94, 0.1);
  color: #1c2b3a;
  font-size: 0.82rem;
  line-height: 1.45;
}

.services-qualification-note[data-tone="mismatch"],
.services-qualification-note[data-tone="scope"] {
  border-color: rgba(107, 16, 16, 0.28);
  background: rgba(107, 16, 16, 0.06);
  color: #5a0e0e;
}

.services-modal-submit {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  border: 0;
  border-radius: 0.375rem;
  background: #6b1010;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.services-modal-submit:hover {
  background: #5a0e0e;
}

.services-modal-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.avaia-contact-modal .avaia-contact-altpath {
  margin-top: 1rem;
}

.avaia-contact-toast-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30000;
  display: flex;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.5rem) 0.75rem 0;
  pointer-events: none;
}

.avaia-contact-toast-wrapper[hidden] {
  display: none !important;
}

.avaia-contact-toast-wrapper .toast {
  pointer-events: auto;
}

@media (min-width: 640px) {
  .avaia-contact-viewport {
    padding: 1.5rem;
  }

  .avaia-contact-panel {
    padding: 1.5rem;
  }
}

@media (min-width: 768px) {
  .avaia-contact-viewport {
    align-items: center;
  }

  .avaia-contact-panel {
    max-width: 42rem;
    margin-block: 1.5rem;
    padding: 2rem;
  }

  .avaia-contact-title {
    font-size: 1.875rem;
  }
}

@media (max-width: 760px) {
  .avaia-contact-viewport {
    padding: 0.5rem;
  }

  .avaia-contact-panel {
    margin-block: 0.5rem;
    padding-top: 3.25rem;
  }
}

@media (min-width: 761px) and (max-height: 900px) {
  .avaia-contact-panel {
    display: flex;
    max-height: calc(100vh - 3rem);
    flex-direction: column;
    overflow: hidden;
    margin-block: 0;
  }

  .avaia-contact-modal .services-modal-form {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
  }

  .avaia-contact-modal .services-modal-fields {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.15rem 0.3rem 0.4rem 0.1rem;
  }

  .avaia-contact-modal .services-modal-submit {
    flex: 0 0 auto;
    margin-top: 0.75rem;
  }

  .avaia-contact-modal .avaia-contact-altpath {
    flex: 0 0 auto;
    margin-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avaia-contact-toast-wrapper .toast {
    transition: opacity 0.01ms linear;
    transform: none;
  }
}
