/* Popup contact form modal. Opens from any "Let's talk" / contact CTA on
   pages that don't show the inline form (i.e. everywhere except the homepage). */

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

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 19, 0.7);
  backdrop-filter: blur(4px);
}

.contact-modal-panel {
  position: relative;
  width: min(460px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.45);
}

.contact-modal-panel .eyebrow {
  margin: 0 0 0.3rem;
}

.contact-modal-panel h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  line-height: 1.15;
}

.contact-modal-panel > p {
  color: var(--muted, #5b6472);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.contact-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.06);
  color: var(--ink, #111827);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.contact-modal-close:hover {
  background: rgba(17, 24, 39, 0.12);
}

/* Shared contact form fields (used by the modal AND the homepage inline form) */
.contact-form {
  display: grid;
  gap: 0.85rem;
}

.contact-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink, #111827);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line, rgba(17, 24, 39, 0.18));
  border-radius: 12px;
  font: inherit;
  font-weight: 400;
  background: #fff;
  color: var(--ink, #111827);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--teal, #0f766e);
  outline-offset: 1px;
  border-color: transparent;
}

.contact-form textarea {
  resize: vertical;
  min-height: 96px;
}

.contact-form .field-heading {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
}

.contact-form .optional-label {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--muted, #5b6472);
}

.contact-form .field-hidden {
  position: absolute;
  left: -9999px;
}

.contact-form .button.full {
  width: 100%;
  margin-top: 0.25rem;
}

@media (prefers-reduced-motion: no-preference) {
  .contact-modal-panel {
    animation: contact-pop 0.18s ease-out;
  }
  @keyframes contact-pop {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
}
