/* Booking/contact qualifier modal — shared by every marketing page that carries a
   "Book a walkthrough" (Calendly) or "Contact" CTA. Brand colors are hardcoded (the
   LOCKED tokens) so it renders identically regardless of each page's own stylesheet,
   exactly like email-capture.css. Mobile-first: full-width sheet on phones, centered
   card on desktop. */

.qm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;            /* bottom sheet on mobile */
  justify-content: center;
  padding: 0;
  background: rgba(10, 22, 64, 0.55); /* --primary-dark @ 55% */
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.qm-overlay[hidden] { display: none; }
.qm-overlay.qm-open { opacity: 1; }

.qm-dialog {
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #FFFFFF;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 40px rgba(10, 22, 64, 0.28);
  transform: translateY(16px);
  transition: transform 0.2s ease;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #0F172A;
}
.qm-overlay.qm-open .qm-dialog { transform: translateY(0); }

@media (min-width: 560px) {
  .qm-overlay { align-items: center; padding: 24px; }
  .qm-dialog { border-radius: 18px; }
}

.qm-head {
  position: relative;
  padding: 24px 24px 4px;
}
.qm-title {
  font-family: "Sora", "Inter", system-ui, sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
  color: #0F172A;
}
.qm-sub {
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
  margin: 0;
}
.qm-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9px;
  background: #F1F5F9;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s;
}
.qm-close:hover { background: #E2E8F0; }
.qm-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.35);
}

.qm-form { padding: 14px 24px 24px; }
.qm-field { margin-bottom: 14px; }
.qm-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #0F172A;
  margin-bottom: 6px;
}
.qm-field .qm-req { color: #3B5BDB; font-weight: 700; }

.qm-field input,
.qm-field textarea,
.qm-field select {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 16px;            /* 16px = no iOS zoom-on-focus */
  color: #0F172A;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 10px;
  padding: 11px 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.qm-field textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.qm-field select { appearance: none; -webkit-appearance: none; background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.qm-field input:focus,
.qm-field textarea:focus,
.qm-field select:focus {
  outline: none;
  border-color: #3B5BDB;
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.15);
}
.qm-field input[aria-invalid="true"],
.qm-field textarea[aria-invalid="true"],
.qm-field select[aria-invalid="true"] {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.qm-err {
  display: none;
  font-size: 12.5px;
  color: #DC2626;
  margin-top: 5px;
  font-weight: 500;
}
.qm-field.qm-has-error .qm-err { display: block; }

.qm-consent {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.5;
  color: #64748B;
  margin: 4px 0 16px;
}
.qm-consent.qm-has-error { color: #B91C1C; }
.qm-consent.qm-has-error input { outline: 2px solid #DC2626; outline-offset: 2px; }
.qm-consent.qm-has-error .qm-err { display: block; flex-basis: 100%; margin-top: 0; }
.qm-consent input {
  margin-top: 2px;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: #3B5BDB;
}

.qm-submit {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 11px;
  background: #3B5BDB;
  color: #fff;
  font-family: "Sora", "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.qm-submit:hover { background: #0A1640; }
.qm-submit:disabled { opacity: 0.65; cursor: progress; }
.qm-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 91, 219, 0.35);
}

.qm-formerr {
  font-size: 13px;
  color: #DC2626;
  margin: 0 0 12px;
  font-weight: 500;
  min-height: 0;
}

/* Success state (used for the "Contact" path, which has no Calendly redirect) */
.qm-done { padding: 28px 24px 30px; text-align: center; }
.qm-done .qm-check {
  width: 52px; height: 52px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(5, 150, 105, 0.12); color: #059669;
}
.qm-done h3 {
  font-family: "Sora", "Inter", system-ui, sans-serif;
  font-size: 19px; font-weight: 800; margin: 0 0 8px; color: #0F172A;
}
.qm-done p { font-size: 14.5px; line-height: 1.6; color: #475569; margin: 0 0 18px; }

@media (prefers-reduced-motion: reduce) {
  .qm-overlay, .qm-dialog { transition: none; }
}
