/* Quote Modal — shared on all pages
   Relies on tokens from index.css:
   --panel, --dark, --white, --text-light, --text-gray, --primary, --primary-rgb
*/

/* Backdrop */
.q-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(1px);
}

/* Dialog wrapper */
.q-modal {
  border: 0; 
  padding: 0; 
  background: transparent; 
  inset: 0; 
  z-index: 9999;
}

/* Card */
.q-card {
  width: min(720px, 92vw);
  max-height: 85vh;
  overflow: auto;
  background: var(--panel, #121C31);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.35rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: q-fade-in 180ms ease-out both;
}

/* Close button */
.q-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-light, #E2E8F0);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

/* Headings */
.q-title {
  color: var(--white, #fff);
  margin: 0.25rem 0 0.25rem;
  font-size: 1.4rem;
  font-weight: 700;
}
.q-sub {
  color: var(--text-gray, #94A3B8);
  margin: 0 0 1rem;
  font-size: 0.975rem;
}

/* Labels & inputs */
.q-label {
  display: block;
  color: var(--text-light, #E2E8F0);
  font-size: 0.95rem;
  margin: 0.6rem 0 0.35rem;
  font-weight: 500;
}
.q-input {
  width: 100%;
  background: var(--dark, #0F172A);
  color: var(--white, #fff);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.q-input::placeholder { color: rgba(226, 232, 240, 0.6); }
.q-input:focus {
  outline: none;
  border-color: var(--primary, #4F46E5);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 79,70,229), 0.15);
}
.q-input[aria-invalid="true"] { border-color: #ef4444; }

/* Actions */
.q-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* Small screen tweaks */
@media (max-width: 520px) {
  .q-card {
    width: 94vw;
    border-radius: 12px;
    padding: 1rem;
  }
  .q-title { font-size: 1.25rem; }
}

/* Nice fade/scale intro */
@keyframes q-fade-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Prevent background scroll when modal is open (modern browsers) */
html:has(.q-modal[open]) { overflow: hidden; }

/* ---- Button polish for the navbar CTA (fix faint gray edge) ---- */
.cta-nav {
  border: 0;
  outline: none;
  background-clip: padding-box; /* avoid subtle anti-aliasing seam */
  box-shadow: none;
}
.cta-nav:focus { outline: none; }

.q-modal:not([open]) { display: none; }      /* hidden by default */
.q-modal[open] {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;        /* centers .modal-inner */
  background: transparent;
}

/* The actual popup card */
.q-modal .modal-inner {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  width: min(640px, 92vw);   /* control width here */
  max-height: 85vh;          /* keep it compact */
  overflow: auto;
  padding: 1rem 1rem 1.25rem;
  box-sizing: border-box;
  margin: 0;                 /* no stray margins */
}

/* ---- Quote modal hardening ---- */
.q-modal {
  /* ensure it sits above everything and fills the viewport */
  position: fixed;
  inset: 0;
  border: 0;
  padding: 0;
  background: transparent;
  width: 100vw;
  height: 100dvh;
  z-index: 10000;                     /* above header/nav */
}

/* when open, center the card */
.q-modal[open] {
  display: grid;
  place-items: center;
  opacity: 1 !important;
  visibility: visible !important;
}

/* backdrop blur/tint */
.q-modal::backdrop {
  backdrop-filter: blur(8px);
  background: rgba(10,14,24,.55);
}

/* the card itself */
.q-modal .q-card {
  width: min(720px, calc(100vw - 32px));
  margin: 0;
  background: var(--panel, #0f172a);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  opacity: 1 !important;              /* override any fade-in that got stuck */
  transform: none !important;         /* override any off-screen transforms */
}

/* optional: a tiny pop animation */
.q-modal[open] .q-card { animation: qpop .14s ease-out; }
@keyframes qpop {
  from { transform: scale(.98); opacity: .0; }
  to   { transform: scale(1);   opacity: 1;  }
}
