/* ==========================================================================
   "SEND A QUERY" POP-UP FORM
   Markup is created by assets/js/components/query-form.js, so any page that
   loads that script gets the same form.
   ========================================================================== */

dialog.q {
  margin: auto; border: 0; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
  background: var(--paper); color: var(--ink); border-radius: 14px; box-shadow: 0 40px 100px -30px rgba(15, 39, 66, .6);
}
dialog.q::backdrop { background: rgba(15, 39, 66, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.q[open] { animation: dlg .45s var(--ease); }
@keyframes dlg { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.q-in { padding: clamp(24px, 4vw, 44px); }
.q-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 26px; }
.q-top h2 { font-family: var(--serif); font-weight: 350; font-size: clamp(28px, 3.4vw, 38px); letter-spacing: -.02em; line-height: 1.1; }
.q-top p { color: var(--muted); font-size: 15px; margin-top: 8px; }
.q-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); flex: none; font-size: 20px; line-height: 1; }
.q-x:hover { border-color: var(--ink); }

/* Fields */
.q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.f { display: flex; flex-direction: column; gap: 6px; }
.f.full { grid-column: 1 / -1; }
.f label { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.f input, .f select, .f textarea {
  font: inherit; font-size: 15.5px; color: var(--ink); background: var(--white); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; outline: none; transition: border-color .2s, box-shadow .2s; width: 100%;
}
.f textarea { min-height: 110px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28, 127, 224, .14); }
.f [aria-invalid="true"] { border-color: var(--error); }

/* Consent checkbox */
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.q-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.q-actions small { color: var(--muted); font-size: 12.5px; }
.q-status { margin-top: 14px; font-size: 14px; min-height: 20px; }
.q-status.err { color: var(--error); }
.q-status a { text-decoration: underline; }

/* Success state */
.q-done { display: none; text-align: center; padding: 30px 10px 10px; }
.q-done svg { width: 64px; margin: 0 auto 18px; }
.q-done h3 { font-family: var(--serif); font-weight: 350; font-size: 32px; margin-bottom: 8px; }
.q-done p { color: var(--muted); }
.q.sent form { display: none; }
.q.sent .q-done { display: block; }
.q.sent .q-top p { display: none; }

@media (max-width: 860px) {
  .q-grid { grid-template-columns: 1fr; }
}
