/* Questionnaire page (noindex). Reuses tokens.css and the wordmark from chrome.css.
   Controls are 46px tall; separation is spacing and type only. */

.q-page {
    --q-control: 46px;
    --q-red: #B3261E;
    --q-gap: 64px;
    --q-top: 24px;
    --q-bar: 53.6px;
    --q-hpad: clamp(12px, 1.6vw, 24px);
    --q-edge: var(--side-pad);
    /* Largest video side: viewport height minus header, gap under it and the 16px bottom margin */
    --q-h: calc(100vh - var(--q-hpad) - var(--q-bar) - var(--q-edge) - 16px);
    background: var(--canvas);
    color: var(--ink-900);
}
@supports (height: 100svh) { .q-page { --q-h: calc(100svh - var(--q-hpad) - var(--q-bar) - var(--q-edge) - 16px); } }
@supports (height: 100dvh) { .q-page { --q-h: calc(100dvh - var(--q-hpad) - var(--q-bar) - var(--q-edge) - 16px); } }
.q-page [hidden] { display: none !important; }
.q-page .sr {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.q-page :focus-visible { outline: 2px solid var(--brown-500); outline-offset: 2px; }

.q-layout {
    max-width: var(--content-max);
    margin: 0 auto;
    padding-left: var(--side-pad);
    padding-right: var(--side-pad);
    position: relative;
}
/* Header is the live site's header (same classes), minus the nav: not sticky, bar keeps the nav's height so the wordmark sits in the same place. */
.site-header.q-top { position: static; background: transparent; padding-left: 0; padding-right: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding-bottom: 0; margin-bottom: var(--q-edge); }
.q-top .site-header-bar { min-height: var(--q-bar); }

.q-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    padding-bottom: 16px;
}
/* two columns only when the right column ends up at least 480px wide (decided by the script in the page: html.q-two) */
html.q-two .q-layout { grid-template-columns: minmax(0, min(var(--q-h), 44.4%)) minmax(0, 1fr); column-gap: var(--q-gap); }

/* ---- video column ---- */
.q-left { position: static; min-width: 0; }
html.q-two .q-left { position: sticky; top: 0; align-self: start; }
.q-media { margin-bottom: 48px; }
html.q-two .q-media { margin-bottom: 0; }
.q-right { min-width: 0; }
/* top row of the right column: same height as the header, holds Back; scrolls with the content */
.q-toprow { display: flex; align-items: center; padding-top: var(--q-hpad); min-height: calc(var(--q-hpad) + var(--q-bar)); position: absolute; top: 0; right: var(--q-edge); margin: 0; z-index: 5; }
html.q-two .q-toprow { position: static; margin-bottom: var(--q-edge); z-index: auto; }
.q-toprow:has([data-back][hidden]) { visibility: hidden; }
.video-slot {
    --R: 1.5;   /* slot shape: landscape 3:2 in one column, square in two */
    --bars: max(0%, calc((1 - var(--R) / var(--ar, 1.5)) * 50%));   /* letterbox height above and below the recording */
    width: 100%;
    aspect-ratio: 3 / 2;
    max-height: 60vh; max-height: 60svh;
    background: var(--panel);
    border-radius: var(--r-media);
    overflow: hidden;
}
.video-slot { position: relative; }
html.q-two .video-slot { --R: 1; aspect-ratio: 1 / 1; max-height: none; }
.video-slot iframe, .video-slot video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: transparent; object-fit: cover; object-position: 50% 30%; }
/* wide screen recordings keep their whole frame; the bars match the recording's orange (the bottom bar eases from the recording's shadow) */
.video-slot[data-fit="contain"] { background: linear-gradient(to bottom, #A34821, #C65727) bottom / 100% var(--bars) no-repeat, #C65727; }
.video-slot[data-fit="contain"] video { object-fit: contain; object-position: 50% 50%; }

/* ---- main column ---- */
.q-main { min-width: 0; }
.view { padding-bottom: 80px; }

.q-main h1 {
    font-size: var(--fs-section);
    line-height: 1.05;
    color: var(--ink-950);
    text-wrap: wrap;
    text-box: trim-both cap alphabetic;
    margin: 0 0 48px;
}
.q-main h1:focus { outline: none; }

.q-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.q-links li { min-width: 0; }

/* Section rows */
.row {
    display: flex; align-items: center; gap: 16px;
    height: 100%; min-height: 72px; padding: 12px 20px;
    background: var(--panel); color: var(--ink-950);
    border-radius: var(--r-btn); text-decoration: none;
}
.row:hover { background: var(--panel-strong); }
.row-name { min-width: 0; font-size: var(--fs-lead); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.circle {
    flex: none; width: 46px; height: 46px; border-radius: 50%;
    border: 2px solid var(--ink-900); display: grid; place-items: center; color: #FFFFFF;
}
.circle svg { width: 22px; height: 22px; }
.row.is-done .circle { background: var(--brown-600); border-color: var(--brown-600); }
.row-end { flex: none; width: 24px; height: 24px; display: grid; place-items: center; color: var(--ink-950); }
.row-end svg { width: 24px; height: 24px; }
.row .lock { display: none; }
.row.is-locked .lock { display: grid; }
.row.is-locked .arrow { display: none; }
.row.is-locked { cursor: default; }
.row.is-locked:hover { background: var(--panel); }
/* the four rows share one grid so they are always the same height; the spacer is the gap between About you and the optional three */
.q-links { grid-template-rows: minmax(72px, 1fr) 32px repeat(3, minmax(72px, 1fr)); }
.q-links .spacer { min-height: 0; }
.row-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.row-sub { font-size: var(--fs-text); line-height: 1.35; color: var(--ink-950); overflow-wrap: anywhere; }
.q-back {
    display: inline-flex; align-items: center; gap: 8px; height: var(--q-control);
    color: var(--ink-950); font-weight: 600; text-decoration: none; justify-self: start;
}
.q-back svg { width: 20px; height: 20px; flex: none; }

/* price groups */
.sub { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
.sub:last-child { margin-bottom: 0; }
.sub legend { margin: 0 0 8px; font-size: var(--fs-text); font-weight: 700; line-height: 1.3; }

/* ---- option buttons ---- */
.opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--q-control);
    padding: 0 16px;
    background: var(--panel);
    color: var(--ink-950);
    border-radius: var(--r-btn);
    font-size: var(--fs-text);
    line-height: 1.15;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    min-width: 0;
}
.opt:hover { background: var(--panel-strong); }
.opt input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    margin: 0; opacity: 0; cursor: pointer;
}
.opt .txt { min-width: 0; overflow-wrap: anywhere; flex: 1 1 auto; }
.opt:has(input:focus-visible) { outline: 2px solid var(--brown-500); outline-offset: 2px; }
.opt:has(input:checked) { background: var(--terracotta-100); color: var(--ink-950); }

.mark {
    flex: none;
    width: 20px; height: 20px;
    border: 2px solid var(--ink-900);
    background: transparent;
    position: relative;
}
.mark-radio { border-radius: 50%; }
.mark-checkbox { border-radius: 6px; }
.opt:has(input:checked) .mark { border-color: var(--brown-600); }
.opt:has(input:checked) .mark-radio { background: radial-gradient(circle, var(--brown-600) 0 4.5px, transparent 5px); }
.opt:has(input:checked) .mark-checkbox { background: var(--brown-600); }
.opt:has(input:checked) .mark-checkbox::after {
    content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
    border: solid #FFFFFF; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* ---- questions ---- */
.questions { display: grid; gap: 48px; }
.q { border: 0; margin: 0; padding: 0; min-width: 0; }
.q legend {
    padding: 0; margin: 0 0 16px;
    font-size: var(--fs-lead);
    line-height: 1.3;
    font-weight: 600;
    color: var(--ink-950);
    width: 100%;
}
.q-body { container-type: inline-size; }
.opts { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 520px) {
    .opts-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.other { margin-top: 8px; }

/* text fields */
.field {
    display: block; width: 100%; height: var(--q-control);
    padding: 0 16px;
    background: var(--panel); color: var(--ink-950);
    font: inherit; font-size: var(--fs-text); font-weight: 500;
    border: 0; border-radius: var(--r-btn);
}
.field:focus-visible { outline: 2px solid var(--brown-500); outline-offset: 2px; }
.field[aria-invalid="true"], .opt:has(input[aria-invalid="true"]) { box-shadow: 0 0 0 2px var(--q-red); }
.claim .q-body { display: grid; gap: 16px; }
.field-row label:not(.opt) { display: block; margin-bottom: 8px; font-weight: 600; color: var(--ink-950); }
.err { margin: 8px 0 0; color: var(--q-red); font-weight: 600; }
.privacy { margin-top: 8px; }
.privacy a { color: var(--ink-950); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---- action buttons ---- */
.actions { margin-top: 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.view[data-view="sections"] { padding-bottom: 0; }
.btn {
    display: flex; align-items: center; justify-content: center;
    height: var(--q-control); padding: 0 16px; min-width: 0;
    border: 0; border-radius: var(--r-btn);
    font: inherit; font-size: var(--fs-text); font-weight: 700; line-height: 1.15;
    text-align: center; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--brown-500); color: #FFFFFF; }
.btn-primary:hover { background: var(--brown-600); }
.btn-secondary { background: var(--panel); color: var(--ink-950); }
.btn-secondary:hover { background: var(--panel-strong); }

/* ---- header: Back sits in the right column's x, in the wordmark row ---- */
@media (min-width: 640px) { .q-page { --q-gap: 32px; } }
@media (min-width: 1024px) { .q-page { --q-gap: 64px; } }
@media (max-width: 1023px) {
    .q-page { --q-edge: var(--side-pad-mobile); --q-bar: 46px; --q-hpad: 10px; }
    .q-top .site-header-bar { min-height: 46px; }
    .q-layout { padding-left: var(--side-pad-mobile); padding-right: var(--side-pad-mobile); }
}

/* ---- one column (phones and narrow windows): video on top, everything spans margin to margin ---- */
.q-main h1 { margin-bottom: 32px; }
.q-main h1.has-intro { margin-bottom: 16px; }
html.q-two .q-main h1 { margin-bottom: 48px; }
html.q-two .q-main h1.has-intro { margin-bottom: 16px; }

.circle .done-mark { display: grid; place-items: center; width: 100%; height: 100%; }
.circle .done-mark[hidden] { display: none !important; }

/* Locked rows: name, subheading, circle and lock icon share one muted grey (6.65:1 on the beige) */
.row.is-locked .row-name, .row.is-locked .row-sub, .row.is-locked .row-end { color: var(--ink-700); }
.row.is-locked .circle { border-color: var(--ink-700); }

/* Send my answers: greyed until About you and one more section are done */
.btn[data-send][aria-disabled="true"] { background: var(--panel-strong); color: var(--ink-700); cursor: default; }
.btn[data-send][aria-disabled="true"]:hover { background: var(--panel-strong); }

.q legend .req { font-weight: 400; }
[data-required] .err { margin-top: 12px; }
html { scroll-padding-top: 0; }
.q { scroll-margin-top: 24px; }

.q-main h1.has-intro { margin-bottom: 16px; }
.intro { margin: 0 0 48px; color: var(--ink-900); }
.intro a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* start screen: Send sits at the bottom of the right column, level with the video's bottom edge; when the rows are taller it follows them 48px below */
.q-right { align-self: stretch; display: flex; flex-direction: column; }
.q-right .q-main { flex: 1 1 auto; display: flex; flex-direction: column; }
.q-right #q-form { flex: 1 1 auto; display: flex; flex-direction: column; }
.q-right .view:not([hidden]) { flex: 1 1 auto; display: flex; flex-direction: column; }
.view[data-view="sections"] .actions { margin-top: auto; padding-top: 48px; }

/* info buttons: a fixed 46px column to the right of the options; the ? never selects the option */
.opt-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--q-control); gap: 8px; }
.opt-row:has(.popover:not([hidden])) { z-index: 10; }
.info-btn, .info-slot { width: var(--q-control); height: var(--q-control); }
.info-btn {
    border: 0; padding: 0; border-radius: 50%; cursor: pointer;
    background: var(--panel); color: var(--ink-950);
    font: inherit; font-size: var(--fs-text); font-weight: 700; line-height: 1;
    display: grid; place-items: center;
}
.info-btn:hover { background: var(--panel-strong); }
.info-btn[aria-expanded="true"] { background: var(--terracotta-100); }
.popover {
    position: absolute; right: calc(var(--q-control) + 8px); top: 0;
    width: min(380px, calc(100% - var(--q-control) - 8px)); padding: 20px;
    background: #FFFFFF; color: var(--ink-950);
    border-radius: var(--r-card); box-shadow: var(--shadow-md);
}
.popover p { margin: 0; line-height: 1.5; }

/* phones and touch screens: the popover opens in the flow under its row, so it never covers the other ? button */
@media (max-width: 639px), (hover: none) {
    .popover { position: static; grid-column: 1 / -1; width: auto; }
}

/* main buttons: the site's call-to-action button (brown, 16px 700, 16px radius, 26px side padding), sized to its label and left-aligned */
.actions { grid-template-columns: max-content; justify-content: start; }
.btn { width: auto; padding: 0 26px; white-space: nowrap; }


/* tooltips for locked rows and the greyed Send button: the popover's white card, no animation */
.q-links li { position: relative; }
.send-wrap { position: relative; display: block; width: max-content; }
.tip {
    position: absolute; z-index: 20; bottom: calc(100% + 8px);
    width: max-content; padding: 12px 16px;
    background: #FFFFFF; color: var(--ink-950);
    border-radius: var(--r-btn); box-shadow: var(--shadow-md);
    font-size: var(--fs-text); line-height: 1.4; font-weight: 500;
}
.q-links .tip { right: 0; max-width: min(320px, 100%); }
.send-wrap .tip { left: 0; max-width: min(360px, calc(100vw - 2 * var(--side-pad-mobile))); }
.tip.below { bottom: auto; top: calc(100% + 8px); }

/* main buttons share one box (Next, Done, Send my answers); the page's bottom gap is set by JS so a section's button ends level with the video's bottom edge */
.btn { width: 178px; }
.q-layout { padding-bottom: var(--q-bottom-gap, 16px); }
.view, .view[data-view="sections"] { padding-bottom: 0; }
.view:not([data-view="sections"]) .actions { margin-top: 48px; }


/* mouse and touch: no ring on options, buttons, rows or links; text fields keep their focus style */
html[data-input="mouse"] .q-page :focus-visible:not(input[type="text"]):not(input[type="email"]):not(textarea) { outline: none !important; }
html[data-input="mouse"] .opt:has(input:focus-visible) { outline: none; }
