/* Concept A quote form */
.q-hero { padding: clamp(28px, 5vw, 56px) 0 clamp(20px, 3vw, 32px); }
.q-hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
.q-hero .lede { margin: 0; }

/* progress */
.q-progress { margin-bottom: 22px; }
.q-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; list-style: none; padding: 0; margin: 0 0 8px; font-size: .82rem; font-weight: 800; color: var(--muted); }
.q-labels li.on { color: var(--accent-strong); }
.q-labels li.done { color: var(--deep); }
.q-bar { height: 10px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.q-bar span { display: block; height: 100%; width: 25%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--field))); transition: width .35s ease; }
.q-count { margin: 8px 0 0; font-size: .88rem; font-weight: 700; color: var(--ink-soft); }
@media (max-width: 520px) { .q-labels { display: none; } }

.q-step h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 4px; }
.q-step h2:focus { outline: none; }
.q-help { color: var(--ink-soft); margin-bottom: 18px; }
.q-field { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.q-field legend, .q-label { display: block; font-weight: 800; color: var(--deep); margin-bottom: 10px; padding: 0; font-size: 1rem; }
.q-sublabel { font-weight: 700; color: var(--deep); margin: 14px 0 8px; font-size: .95rem; }
.opt { font-weight: 600; color: var(--muted); font-size: .88rem; }
.q-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 700px) { .q-two { grid-template-columns: 1fr; } }

/* tap cards */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tgrid-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tcard { position: relative; display: block; cursor: pointer; }
.tcard input, .pill input, .check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.tc-body {
  display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 64px; padding: 16px; border-radius: 18px;
  background: var(--field); border: 2px solid var(--line); transition: border-color .15s, background-color .15s, transform .15s;
  position: relative;
}
.tc-body::after { content: ""; position: absolute; right: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--field); }
.tgrid-sm .tc-body { justify-content: center; padding-right: 40px; }
.tc-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; margin-bottom: 6px; }
.tc-ic .icon { width: 24px; height: 24px; }
.tc-t { font-weight: 800; color: var(--deep); line-height: 1.25; padding-right: 26px; }
.tc-d { font-size: .88rem; color: var(--muted); }
.tcard:hover .tc-body { border-color: var(--line-hover); transform: translateY(-1px); }
.tcard input:checked ~ .tc-body { border-color: var(--accent); background: var(--selected); }
.tcard input:checked ~ .tc-body::after { background: var(--accent); content: "\2713"; color: var(--on-accent); display: grid; place-items: center; font: 900 13px/1 var(--body); border-color: var(--accent); }
.tcard input:focus-visible ~ .tc-body, .pill input:focus-visible + span, .check input:focus-visible + span::before { outline: 3px solid var(--deep); outline-offset: 2px; }
.tcard-wide { grid-column: 1 / -1; }
.tcard-wide .tc-body { flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
.tcard-wide .tc-ic { margin: 0; }
.tcard-wide .tc-t { padding-right: 0; }
.tcard-wide .tc-d { flex-basis: 100%; margin-left: 56px; margin-top: -8px; }

/* pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: var(--field); border: 2px solid var(--line); font-weight: 700; color: var(--deep); font-size: .95rem; transition: border-color .15s, background-color .15s; }
.pill:hover span { border-color: var(--line-hover); }
.pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pills-city .pill span { font-size: .92rem; }
.q-sub { margin-top: 12px; }

/* text inputs */
.q-input { width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--field); font: 400 1rem/1.4 var(--body); color: var(--ink); }
textarea.q-input { min-height: 96px; resize: vertical; }
.q-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.q-input[aria-invalid="true"] { border-color: var(--brand); }
.q-hint { font-size: .87rem; color: var(--muted); margin: 6px 0 0; }
.q-err { display: flex; gap: 6px; align-items: center; color: var(--error); font-weight: 700; font-size: .92rem; margin: 8px 0 0; }
.q-err::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--error); color: var(--on-error); display: grid; place-items: center; font-size: .75rem; }
.q-err[hidden] { display: none; }
fieldset.has-error .tc-body, fieldset.has-error .pill span { border-color: var(--error-line); }

/* upload */
.upload { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; border: 2px dashed var(--line-2); background: var(--bg); cursor: pointer; color: var(--ink-soft); position: relative; }
.upload:hover { border-color: var(--accent); }
.upload .icon { width: 28px; height: 28px; color: var(--accent-strong); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload:focus-within { outline: 3px solid var(--deep); outline-offset: 2px; }
.thumbs { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs li { position: relative; width: 84px; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.thumbs span { display: block; font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.thumbs button { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--deep); color: var(--on-deep); cursor: pointer; font-weight: 800; line-height: 1; }

/* consent */
.check { display: block; position: relative; cursor: pointer; }
.check span { display: block; padding-left: 36px; color: var(--ink-soft); font-size: .93rem; line-height: 1.5; position: relative; }
.check span::before { content: ""; position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line-2); background: var(--field); }
.check input:checked + span::before { background: var(--accent); content: "\2713"; color: var(--on-accent); display: grid; place-items: center; font: 900 14px/1 var(--body); border-color: var(--accent); }
.consent { background: var(--bg); border-radius: 16px; padding: 14px 16px; border: 1px solid var(--line); }

/* nav */
.q-nav { display: flex; justify-content: space-between; gap: 12px; }
.q-nav #q-next { margin-left: auto; }
@media (max-width: 420px) { .q-nav .btn-lg { padding: .8em 1.1em; } }

/* review */
.review { display: grid; gap: 12px; }
.rv { background: var(--field); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }
.rv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.rv-head h3 { margin: 0; font-size: 1.1rem; }
.rv-edit { background: none; border: 0; color: var(--accent-strong); font: 800 .93rem var(--body); cursor: pointer; padding: 6px 8px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px; }
.rv dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .95rem; }
.rv dt { color: var(--muted); font-weight: 700; }
.rv dd { margin: 0; color: var(--deep); font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 480px) { .rv dl { grid-template-columns: 1fr; gap: 0; } .rv dd { margin-bottom: 8px; } }

/* done */
.q-done { text-align: center; padding: 10px 0; }
.done-ic { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.done-ic .icon { width: 44px; height: 44px; }
.ref { font-size: 1.05rem; color: var(--ink-soft); }
.ref strong { display: inline-block; font: 700 1.15rem/1 ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--bg-alt); color: var(--deep); padding: 8px 12px; border-radius: 10px; letter-spacing: .04em; margin-left: 4px; }
.q-done .lede { margin: 0 auto 22px; }
.done-ctas { justify-content: center; }
.demo-banner { display: inline-block; margin: 22px 0 0; background: var(--accent-soft); color: var(--accent-strong); border-radius: 12px; padding: 10px 14px; font-size: .92rem; }
.done-summary { text-align: left; margin-top: 22px; }

/* ===== quote widget: shared by quote.html (inline) and the pop-up ===== */
.qw-wrap { container-type: inline-size; min-width: 0; }
.qw {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "main side" "foot side";
  column-gap: 28px; align-items: start;
}
.qw-main { grid-area: main; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; padding: clamp(18px, 3.4vw, 36px) clamp(18px, 3.4vw, 36px) 8px; }
.qw-foot { grid-area: foot; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 28px 28px; padding: 0 clamp(18px, 3.4vw, 36px) clamp(18px, 3vw, 28px); box-shadow: var(--shadow); }
.qw-foot .q-nav { border-top: 1px solid var(--line); padding-top: 18px; }
.qw[data-state="done"] .qw-main { border-bottom: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.q-inline { padding-bottom: clamp(48px, 7vw, 88px); }

.q-step.q-enter { animation: qIn .18s ease-out; }
@keyframes qIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* error summary (top of the step) */
.q-errsum { border: 2px solid var(--error); border-left-width: 8px; background: var(--error-soft); border-radius: 14px; padding: 12px 16px; margin: 0 0 16px; }
.q-errsum:focus { outline: 3px solid var(--deep); outline-offset: 2px; }
.q-errsum h3 { font: 800 1rem/1.3 var(--body); color: var(--error); margin: 0 0 6px; }
.q-errsum ul { margin: 0; padding-left: 1.1em; }
.q-errsum a { color: var(--error); font-weight: 700; }

/* summary (side) */
.q-summary { grid-area: side; position: sticky; top: 100px; display: grid; gap: 12px; min-width: 0; }
.sum-box { background: var(--deep); color: var(--on-deep-soft); border-radius: 24px; padding: 20px 22px; }
.sum-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sum-head h2 { color: var(--on-deep); font-size: 1.35rem; margin: 0; }
.sum-count { font-size: .8rem; font-weight: 800; background: color-mix(in srgb, var(--on-deep) 12%, transparent); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.sum-sec { border-top: 1px solid color-mix(in srgb, var(--on-deep) 12%, transparent); padding-top: 12px; margin-top: 12px; }
.sum-sec h3 { font: 800 .75rem/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--on-deep-accent); margin: 0 0 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sum-sec p { margin: 0; font-size: .94rem; overflow-wrap: anywhere; }
.sum-sec .empty { color: var(--on-deep-faint); font-style: italic; }
.sum-change { background: none; border: 0; color: var(--on-deep); font: 700 .82rem var(--body); letter-spacing: 0; text-transform: none; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 2px 4px; }
.sum-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sum-tags span { background: color-mix(in srgb, var(--on-deep) 12%, transparent); border-radius: 999px; padding: 4px 10px; font-size: .85rem; font-weight: 700; color: var(--on-deep); }
.sum-reassure { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; font-size: .92rem; font-weight: 700; color: var(--deep); }
.sum-reassure p { margin: 0; display: flex; gap: 8px; align-items: center; }
.sum-reassure p + p { margin-top: 6px; }
.sum-reassure .icon { color: var(--accent-strong); }
.q-summary .mini-review { margin: 0; }
.q-summary .mini-review blockquote { margin: 0; }

/* summary bar above the buttons (narrow) */
.qw-sumbar { display: none; margin: 0 0 12px; background: var(--deep); color: var(--on-deep-soft); border-radius: 14px; }
.qw-sumbar summary { list-style: none; cursor: pointer; padding: 10px 40px 10px 14px; font-size: .9rem; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-sumbar summary::-webkit-details-marker { display: none; }
.qw-sumbar summary::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border: solid var(--on-deep-accent); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); }
.qw-sumbar[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.qw-sumbar b { color: var(--on-deep); }
.sum-mini { padding: 0 14px 12px; max-height: 40vh; overflow-y: auto; }
.sum-mini .sum-sec:first-child { margin-top: 0; }

@container (max-width: 879px) {
  .qw { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "foot"; }
  .q-summary { display: none; }
  .qw-sumbar { display: block; }
  .qw-foot .q-nav { border-top: 0; padding-top: 0; }
  .qw-foot { padding-top: 12px; }
}
@media (max-width: 520px) { .qw-main { padding: 18px 16px 8px; } .qw-foot { padding: 12px 16px 16px; } }

.done-call { color: var(--ink-soft); }

/* ===== the pop-up ===== */
html.ppq-lock { overflow: hidden; }
.ppq-dialog {
  padding: 0; border: 0; width: min(1100px, calc(100vw - 32px)); max-width: none; height: min(860px, calc(100dvh - 32px)); max-height: none;
  border-radius: 28px; background: var(--surface); color: var(--ink); box-shadow: 0 40px 90px -20px rgba(var(--shadow-rgb), .6); overflow: hidden;
}
.ppq-dialog::backdrop { background: rgba(var(--shadow-rgb, 30, 42, 68), .55); backdrop-filter: blur(3px); }
.ppq-dialog[open] { animation: ppqIn .2s ease-out; }
@keyframes ppqIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.ppq-shell { display: flex; flex-direction: column; height: 100%; }
.ppq-head { flex: none; display: flex; align-items: center; gap: 16px; padding: 14px 18px 14px 28px; background: var(--bg); border-bottom: 1px solid var(--line); }
.ppq-head h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.ppq-head h2:focus { outline: none; }
.ppq-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: .93rem; }
.ppq-head p a { font-weight: 800; }
.ppq-close { margin-left: auto; flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--deep); display: grid; place-items: center; cursor: pointer; }
.ppq-close:hover { background: var(--deep); color: var(--on-deep); }
.ppq-close .icon { width: 22px; height: 22px; }
.ppq-dialog .qw-wrap { flex: 1; min-height: 0; }
.ppq-dialog .qw { height: 100%; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "main side" "foot foot"; column-gap: 0; align-items: stretch; }
.ppq-dialog .qw-main { overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 0; background: var(--surface); padding: 22px 28px 24px; box-shadow: none; }
.ppq-dialog .q-summary { position: static; overflow-y: auto; background: var(--bg-alt); padding: 20px; align-content: start; border-left: 1px solid var(--line); }
.ppq-dialog .qw-foot { border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 12px 24px; background: var(--bg); }
.ppq-dialog .qw-foot .q-nav { border-top: 0; padding-top: 0; }
.ppq-dialog .qw[data-state="done"] .qw-main { border: 0; border-radius: 0; box-shadow: none; }
@container (max-width: 879px) {
  .ppq-dialog .qw { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "foot"; }
}
@media (max-width: 720px) {
  .ppq-dialog { width: 100vw; height: 100vh; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; border-radius: 0; }
  .ppq-head { padding: 10px 12px 10px 16px; }
  .ppq-head p { font-size: .86rem; }
  .ppq-dialog .qw-main { padding: 16px 16px 20px; }
  .ppq-dialog .qw-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
}
