/* Consult quiz overlay. Opens from every "Request your free prototype" button and runs
   three short steps before the Calendly picker. Tokens mirror the v2 public site
   (index.html); they are scoped to .cq so the overlay looks the same on every page. */

.cq {
  --cq-bg: #e2e2e2; --cq-surface: #ffffff; --cq-ink: #1f1e1d; --cq-muted: #5f5f5f; --cq-line: #cfcfcf;
  --cq-accent: #3b82f6; --cq-accent-dark: #2563eb; --cq-accent-deep: #1d4ed8; --cq-blue-soft: rgba(59,130,246,.12);
  --cq-green: #0b6b35; --cq-red: #b91c1c;
  --cq-font: 'Hanken Grotesk', system-ui, sans-serif; --cq-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(31,30,29,.35); font-family: var(--cq-font); color: var(--cq-ink); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.cq[hidden] { display: none; }
.cq *, .cq *::before, .cq *::after { box-sizing: border-box; }
.cq p, .cq h2 { margin: 0; }
.cq a { color: var(--cq-accent-deep); text-decoration: none; }
.cq a:hover { text-decoration: underline; }
body.cq-open { overflow: hidden; }

.cq-panel {
  position: relative; width: 1100px; max-width: 100%; height: 760px; max-height: 100%;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  background: var(--cq-surface); border: 1px solid var(--cq-line); border-radius: 14px;
  box-shadow: 0 16px 48px rgba(31,30,29,.18); overflow: hidden; outline: none;
}
.cq-close {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; padding: 0; border: 0; background: none;
  color: var(--cq-ink); cursor: pointer; display: grid; place-items: center; border-radius: 10px; z-index: 2;
}
.cq-close:hover { background: var(--cq-bg); }
.cq-close:focus-visible, .cq-back:focus-visible, .cq-cta:focus-visible, .cq-edit:focus-visible { outline: 2px solid var(--cq-accent); outline-offset: 2px; }

/* Rail */
.cq-rail {
  grid-column: 1; grid-row: 1 / span 2; display: flex; flex-direction: column; padding: 32px 28px 28px;
  background: var(--cq-bg); border-right: 1px solid var(--cq-line); min-height: 0; overflow: auto;
}
.cq-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--cq-ink); }
.cq-logo img { width: 36px; height: 36px; display: block; }
.cq-tag { font-family: var(--cq-mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--cq-muted); }
.cq-tag.blue { color: var(--cq-accent-deep); }
.cq-rail-head { display: flex; flex-direction: column; gap: 4px; margin: 36px 0 10px; }
.cq-rail-head span:last-child { font-size: 15px; color: var(--cq-muted); }
.cq-row { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--cq-line); }
.cq-row .dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--cq-line); }
.cq-row.done .dot { background: var(--cq-green); }
.cq-row.live .dot { background: var(--cq-accent-dark); }
.cq-row .rt { display: block; font-size: 14px; font-weight: 500; color: var(--cq-muted); line-height: 1.3; }
.cq-row.done .rt, .cq-row.live .rt { color: var(--cq-ink); font-weight: 600; }
.cq-row .rv { display: block; font-size: 14px; color: #8a8a8a; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.cq-row.done .rv { color: var(--cq-ink); }
.cq-row.live .rv { color: var(--cq-muted); }
.cq-edit { display: none; margin-top: 10px; font-size: 14px; font-weight: 600; background: none; border: 0; padding: 0; color: var(--cq-accent-deep); cursor: pointer; font-family: inherit; text-align: left; }
.cq-edit:hover { text-decoration: underline; }
.cq[data-screen="review"] .cq-edit { display: inline-block; }
.cq-progress { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 9px; }
.cq-track { height: 6px; border-radius: 100px; background: var(--cq-line); overflow: hidden; }
.cq-fill { height: 100%; width: 0; border-radius: 100px; background: var(--cq-accent-dark); transition: width .3s ease; }
.cq-progress-label { font-size: 13px; color: var(--cq-muted); }

/* Mobile top bar (hidden on desktop) */
.cq-top { display: none; }

/* Content */
.cq-content { grid-column: 2; grid-row: 1; min-height: 0; overflow: auto; padding: 48px 56px 24px; display: flex; flex-direction: column; justify-content: center; }
.cq-screen { display: none; flex-direction: column; gap: 26px; max-width: 620px; margin: auto 0; }
.cq-screen.on { display: flex; }
.cq-screen.wide { max-width: 680px; }
.cq-screen.full { max-width: none; }
.cq-head { display: flex; flex-direction: column; gap: 8px; }
.cq h2 { text-align: left; font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; color: var(--cq-ink); text-wrap: pretty; }
.cq h2.big { font-size: 40px; line-height: 1.12; }
.cq h2 .soft { color: var(--cq-muted); font-weight: 500; }
.cq-sub { font-size: 18px; color: var(--cq-muted); text-wrap: pretty; }
.cq-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cq-chip { display: inline-flex; align-items: center; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--cq-line); background: var(--cq-bg); font-size: 14px; color: var(--cq-muted); }

/* Fields */
.cq-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.cq-grid > .cq-field { flex: 1 1 240px; }
.cq-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.cq-field > label, .cq-field > .cq-label { font-size: 14px; font-weight: 600; color: var(--cq-ink); }
.cq-field .req { color: var(--cq-accent-deep); }
.cq-field input, .cq-field select, .cq-field textarea {
  width: 100%; font-family: inherit; font-size: 16px; line-height: 1.4; color: var(--cq-ink);
  background: var(--cq-bg); border: 1px solid var(--cq-line); border-radius: 12px; padding: 12px 14px; min-height: 48px;
  transition: border-color .2s ease, box-shadow .2s ease; appearance: none; margin: 0;
}
.cq-field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.cq-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f6672' stroke-width='2.4' 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 14px center; padding-right: 40px; cursor: pointer;
}
.cq-field select:invalid, .cq-field select.empty { color: var(--cq-muted); }
.cq-field input::placeholder, .cq-field textarea::placeholder { color: var(--cq-muted); }
.cq-field input:focus, .cq-field select:focus, .cq-field textarea:focus { outline: none; border-color: var(--cq-accent-dark); box-shadow: 0 0 0 3px var(--cq-blue-soft); }
.cq-field.bad input, .cq-field.bad select, .cq-field.bad textarea { border-color: var(--cq-red); }
.cq-field.bad > label, .cq-field.bad > .cq-label { color: var(--cq-red); }

/* Pills (radio) */
.cq-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cq-pill { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 12px; background: var(--cq-bg); border: 1px solid var(--cq-line); font-size: 16px; font-weight: 500; color: var(--cq-ink); cursor: pointer; white-space: nowrap; transition: border-color .18s ease, background .18s ease; }
.cq-pill:hover { border-color: var(--cq-muted); }
.cq-pill input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.cq-pill:has(input:checked) { border-color: var(--cq-accent-dark); background: var(--cq-blue-soft); color: var(--cq-accent-deep); }
.cq-pill:has(input:focus-visible) { outline: 2px solid var(--cq-accent); outline-offset: 2px; }

/* Cards (checkbox) */
.cq-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cq-card { position: relative; display: flex; align-items: flex-start; gap: 13px; background: var(--cq-bg); border: 1px solid var(--cq-line); border-radius: 12px; padding: 12px 14px; min-height: 44px; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.cq-card:hover { border-color: var(--cq-muted); }
.cq-card input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.cq-card .mark { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px; border-radius: 7px; border: 1.5px solid var(--cq-line); background: var(--cq-surface); display: grid; place-items: center; transition: background .15s ease, border-color .15s ease; }
.cq-card .mark svg { width: 13px; height: 13px; opacity: 0; transform: scale(.6); transition: opacity .15s ease, transform .15s ease; }
.cq-card:has(input:checked) { border-color: var(--cq-accent-dark); background: var(--cq-blue-soft); }
.cq-card:has(input:checked) .mark { border-color: var(--cq-accent-dark); background: var(--cq-accent-dark); }
.cq-card:has(input:checked) .mark svg { opacity: 1; transform: scale(1); }
.cq-card:has(input:focus-visible) { outline: 2px solid var(--cq-accent); outline-offset: 2px; }
.cq-card .t { display: block; font-size: 16px; font-weight: 600; color: var(--cq-ink); line-height: 1.3; }
.cq-card .d { display: block; font-size: 14px; color: var(--cq-muted); line-height: 1.4; margin-top: 3px; }

/* Review + calendar */
.cq-summary { display: none; }
.cq-cal { border: 1px solid var(--cq-line); border-radius: 14px; overflow: hidden; background: var(--cq-surface); min-height: 420px; }
.cq-cal .calendly-inline-widget { min-width: 280px; height: 460px; }
.cq-cal-fallback { padding: 22px; }

/* Booked */
.cq-check { width: 44px; height: 44px; border-radius: 50%; background: var(--cq-green); display: grid; place-items: center; }
.cq-next { display: flex; flex-direction: column; border-top: 1px solid var(--cq-line); }
.cq-next .cq-row .rv { color: var(--cq-muted); }

/* Footer */
.cq-foot { grid-column: 2; grid-row: 2; display: flex; align-items: center; gap: 12px; padding: 18px 56px 32px; border-top: 1px solid var(--cq-line); }
.cq-foot[hidden] { display: none; }
.cq-cta, .cq-back { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; padding: 13px 22px; border-radius: 10px; font-family: inherit; font-weight: 600; font-size: 16px; line-height: 1.2; cursor: pointer; }
.cq-cta { min-width: 150px; background: var(--cq-accent-dark); color: #fff; border: 1px solid var(--cq-accent-dark); }
.cq-cta:hover { background: var(--cq-accent-deep); border-color: var(--cq-accent-deep); }
.cq-cta[disabled] { opacity: .5; cursor: wait; }
.cq-back { background: transparent; color: var(--cq-ink); border: 1px solid var(--cq-line); }
.cq-back:hover { border-color: var(--cq-muted); }
.cq-back[hidden] { display: none; }
.cq-hint { font-size: 13px; color: var(--cq-muted); margin-left: 4px; }
.cq-hint.err { color: var(--cq-red); font-weight: 500; }
.cq-honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .cq-fill, .cq-pill, .cq-card, .cq-card .mark, .cq-card .mark svg { transition: none; }
}

/* Mobile: full screen, rail replaced by a top bar */
@media (max-width: 800px) {
  .cq { padding: 0; background: var(--cq-surface); }
  .cq-panel { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
  .cq-rail { display: none; }
  .cq-close-desk { display: none; }
  .cq-close { position: static; }
  .cq-top { display: flex; flex-direction: column; flex: none; border-bottom: 1px solid var(--cq-line); background: var(--cq-surface); }
  .cq-top-bar { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 8px 0 20px; }
  .cq-top .cq-logo { font-size: 18px; gap: 8px; }
  .cq-top .cq-logo img { width: 28px; height: 28px; }
  .cq-top-right { display: flex; align-items: center; gap: 4px; }
  .cq-top-step { font-size: 13px; color: var(--cq-muted); }
  .cq-top .cq-track { height: 4px; border-radius: 0; }
  .cq-top .cq-fill { border-radius: 0; }
  .cq-content { flex: 1; min-height: 0; padding: 28px 20px 24px; justify-content: flex-start; }
  .cq-screen { margin: 0; max-width: none; }
  .cq h2 { font-size: 28px; }
  .cq h2.big { font-size: 30px; }
  .cq-sub { font-size: 16px; }
  .cq-grid { flex-direction: column; }
  .cq-grid > .cq-field { flex: none; }
  .cq-screen { flex: none; }
  .cq-cards { grid-template-columns: 1fr; }
  .cq-summary { display: flex; flex-direction: column; background: var(--cq-bg); border: 1px solid var(--cq-line); border-radius: 14px; padding: 4px 16px 12px; }
  .cq-summary-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 4px; }
  .cq-summary .cq-edit { display: inline-block; margin: 0; }
  .cq-summary .cq-row .rv { color: var(--cq-ink); }
  .cq-cal .calendly-inline-widget { height: 640px; }
  .cq-foot { flex: none; padding: 14px 20px 26px; background: var(--cq-surface); }
  .cq-cta { flex: 1; min-width: 0; }
  .cq-hint { display: none; }
  .cq-hint.err { display: block; position: absolute; left: 20px; right: 20px; bottom: 88px; background: var(--cq-surface); padding: 4px 0; }
}
