/*
 * Built By Tension -- qualifier popup styles.
 *
 * The main stylesheet has ZERO form styles: no input, textarea, button, label, :focus or
 * ::placeholder rule exists in its 853 lines. All of that is authored here rather than
 * bolted onto style.css, so the popup can be pulled out in one file if it ever needs to be.
 *
 * Everything below reuses the site's own custom properties (--bg, --accent, --border and
 * friends, defined at css/style.css:5-14) so it inherits the theme instead of guessing at it.
 * Card chrome deliberately matches .testimonial-card: bg-2, 1px border, 6px radius.
 *
 * The nav is position:fixed at z-index 100, so this sits at 200.
 */

body.qualifier-open { overflow: hidden; }

.q-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 6, 6, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem 1rem 4rem;
  animation: q-fade 0.18s ease-out;
}
@keyframes q-fade { from { opacity: 0; } to { opacity: 1; } }

.q-inner { width: 100%; max-width: 640px; margin: auto; }

.q-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: q-rise 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes q-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .q-overlay, .q-card { animation: none; }
  .q-btn, .q-opt, .q-input { transition: none; }
}

.q-close {
  position: absolute;
  top: 0.85rem; right: 0.95rem;
  background: none; border: none;
  color: var(--muted);
  font-size: 1.6rem; line-height: 1;
  cursor: pointer; padding: 0.25rem 0.5rem;
  transition: color 0.15s;
}
.q-close:hover { color: var(--text); }

.q-eyebrow {
  display: block;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}

.q-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  font-weight: 400;
}
.q-title em { color: var(--accent); font-style: normal; }

.q-intro { color: var(--muted); font-size: 1rem; line-height: 1.65; }
.q-body { display: flex; flex-direction: column; gap: 1.6rem; }

.q-field { display: flex; flex-direction: column; gap: 0.5rem; }
.q-label { font-weight: 600; font-size: 0.98rem; line-height: 1.45; }
.q-optional {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-left: 0.35rem;
}
.q-help { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }

.q-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.q-area { resize: vertical; min-height: 5.5rem; line-height: 1.6; }
.q-input::placeholder { color: #5f5a56; }
.q-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 133, 200, 0.18);
}

.q-opts { display: flex; flex-direction: column; gap: 0.6rem; }
.q-opt {
  text-align: left;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  line-height: 1.45;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.q-opt:hover { border-color: rgba(244, 240, 235, 0.22); }
.q-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.q-opt.is-on {
  border-color: var(--accent);
  background: rgba(61, 133, 200, 0.12);
  box-shadow: inset 3px 0 0 var(--accent);
}

.q-reveal { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.9rem; }
.q-hidden { display: none; }

.q-err { color: #e0736a; font-size: 0.82rem; line-height: 1.5; min-height: 0; }
.q-err:empty { display: none; }
.q-field.has-err .q-input,
.q-field.has-err .q-opt { border-color: #a2453c; }
.q-err-screen { margin-top: -0.4rem; }

.q-foot { color: var(--muted); font-size: 0.8rem; line-height: 1.6; }
.q-foot-last { text-align: center; }
.q-stretch {
  color: var(--text); font-size: 0.92rem; line-height: 1.65;
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}
.q-free { font-weight: 600; }
.q-price { color: var(--muted); font-size: 0.95rem; line-height: 1.65; }

.q-nav { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.4rem; }

/* Mirrors .btn-primary from the main sheet so the popup does not invent a second button. */
.q-btn {
  display: inline-block;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  padding: 1rem 2.5rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
}
.q-btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }
.q-btn-primary { background: var(--accent); color: #fff; margin-left: auto; }
.q-btn-primary:hover:not(:disabled) { background: var(--accent2); transform: translateY(-2px); }
.q-btn-primary:disabled { opacity: 0.65; cursor: default; }
.q-btn-ghost { background: none; color: var(--muted); border-color: var(--border); }
.q-btn-ghost:hover { color: var(--text); border-color: rgba(244, 240, 235, 0.22); }
.q-btn-wide { display: block; width: 100%; margin-left: 0; }

.q-end { text-align: left; }
.q-end .q-btn-wide + .q-foot { margin-top: -0.4rem; }

@media (max-width: 560px) {
  .q-overlay { padding: 0; }
  .q-inner { max-width: none; }
  .q-card { border-radius: 0; border-left: none; border-right: none; min-height: 100vh; padding: 3rem 1.4rem 2.5rem; }
  .q-btn { padding: 1rem 1.5rem; }
  .q-nav { flex-direction: column-reverse; align-items: stretch; }
  .q-btn-primary { margin-left: 0; }
}
