/* Estimate quiz popup for allthingsfloor.com.
   Self-contained: everything is scoped to the quiz dialog (or the .btn / .i /
   .eyebrow helpers it uses), so it can sit on top of any page design. */

:root {
  --navy: #03203a;
  --navy-deep: #001629;
  --navy-soft: #0d3557;
  --gold: #f8b858;
  --gold-deep: #eea63a;
  --tan: #e8b878;
  --cream: #f8ecd4;
  --wash: #faf5ec;
  --text: #22344a;
  --muted: #5b6678;
  --line: #e9e1d2;
  --line-soft: #efeae0;

  --display: "Inter Tight", "Inter", system-ui, -apple-system, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 6px;
  --radius-lg: 14px;
  --header-h: 72px;

  color-scheme: light;
}

html.quiz-open { overflow: hidden; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Minimal resets, only inside the dialog. :where() keeps them at zero
   specificity so the component rules below always win. */
:where(.quiz), :where(.quiz) *, :where(.quiz) *::before, :where(.quiz) *::after { box-sizing: border-box; }
:where(.quiz) { font: 400 1rem/1.6 var(--body); color: var(--text); -webkit-font-smoothing: antialiased; }
:where(.quiz) :is(h2, p, dl, dd, dt) { margin: 0; }
:where(.quiz) :is(button, input) { font: inherit; color: inherit; }
:where(.quiz) button { cursor: pointer; background: none; border: 0; padding: 0; }
:where(.quiz) a { color: inherit; text-decoration: none; }
:where(.quiz) :focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 3px; }

.i {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.eyebrow {
  font: 600 .75rem/1 var(--body);
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--gold-deep);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3rem; padding: .5rem 2rem;
  border: 1px solid transparent; border-radius: var(--radius);
  font: 700 .9375rem/1.1 var(--body);
  letter-spacing: .005em;
  transition: background-color .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s;
  white-space: nowrap;
}
.btn .i { width: 1.1em; height: 1.1em; stroke-width: 2.4; transition: transform .18s; }
.btn:hover .i { transform: translateX(3px); }
.btn-gold { background: var(--gold); color: var(--navy); box-shadow: 0 8px 20px -10px rgba(238, 166, 58, .9); }
.btn-gold:hover { background: var(--gold-deep); }
.btn-gold:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* =========================================================
   Estimate quiz (popup)
   ========================================================= */
.quiz {
  width: 100%; height: 100%; max-width: 100vw; max-height: 100dvh;
  margin: 0; padding: 0; border: 0;
  background: transparent;
  overflow: hidden;
}
.quiz[open] { display: grid; place-items: center; animation: quiz-fade .2s ease; }
.quiz::backdrop { background: rgba(0, 22, 41, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes quiz-fade { from { opacity: 0; } }
.quiz-card {
  position: relative;
  width: 100%; height: 100%;
  overflow-y: auto; overscroll-behavior: contain;
  background: #fff; color: var(--text);
  display: flex; flex-direction: column;
}
.quiz-top {
  position: sticky; top: 0; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  min-height: 60px; padding: .5rem .75rem .5rem 1rem;
  background: #fff;
}
.quiz-back {
  justify-self: start; display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem .6rem .55rem .35rem; border-radius: var(--radius);
  font: 600 .875rem var(--body); color: var(--muted);
}
.quiz-back .i { width: 18px; height: 18px; }
.quiz-back:hover { color: var(--navy); background: var(--wash); }
.quiz-back[hidden] { display: inline-flex; visibility: hidden; }
.quiz-count { font: 600 .72rem/1 var(--body); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.quiz-close {
  justify-self: end; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  color: var(--navy); background: var(--wash);
  transition: background-color .15s;
}
.quiz-close:hover { background: var(--cream); }
.quiz-close .i { width: 20px; height: 20px; }
.quiz-progress { height: 4px; background: var(--line-soft); }
.quiz-progress span { display: block; height: 100%; width: 0; background: var(--gold-deep); border-radius: 0 4px 4px 0; transition: width .35s ease; }
.quiz-body { padding: 1.75rem 1.25rem 2rem; flex: 1; }
@media (min-width: 640px) {
  /* Pinned near the top so the card only grows downward between steps. */
  .quiz { padding: max(1.5rem, 7vh) 1.5rem 1.5rem; }
  .quiz[open] { align-items: start; }
  .quiz-card {
    width: min(100%, 620px); height: auto; max-height: calc(100dvh - max(1.5rem, 7vh) - 1.5rem);
    border-radius: 18px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .55);
  }
  .quiz-top { border-radius: 18px 18px 0 0; padding-inline: 1.25rem 1rem; }
  .quiz-body { padding: 2rem 2.25rem 2.25rem; }
}

.q-eyebrow { display: block; margin-bottom: .7rem; }
.q-title {
  font: 700 clamp(1.5rem, 4.6vw, 1.875rem)/1.15 var(--display);
  letter-spacing: -.025em; color: var(--navy);
}
.q-title:focus { outline: none; }
.q-sub { margin-top: .55rem; color: var(--muted); font-size: .975rem; }
.q-options { margin-top: 1.5rem; }

/* step 1: icon cards, like simplyfloorz.com's quiz */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .55rem;
  padding: 1rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; text-align: left;
  transition: border-color .15s, background-color .15s;
}
.tile:hover { border-color: var(--tan); background: #fffdf8; }
.tile .tile-icon { width: 24px; height: 24px; color: var(--gold-deep); }
.tile .t { font: 500 1rem/1.25 var(--body); color: var(--navy); }
.tile .tick {
  position: absolute; top: .65rem; right: .65rem;
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--navy); color: #fff; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s;
}
.tile .tick .i { width: 12px; height: 12px; stroke-width: 3; }
.tile[aria-pressed="true"] { border-color: var(--navy); background: var(--wash); }
.tile[aria-pressed="true"] .tick { opacity: 1; transform: none; }

/* list choices */
.opts { display: grid; gap: .65rem; }
.opt {
  display: flex; align-items: center; gap: .9rem; width: 100%;
  padding: .85rem 1rem; min-height: 64px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  text-align: left; font: 600 1.0625rem/1.25 var(--display); color: var(--navy); letter-spacing: -.01em;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.opt:hover { border-color: var(--tan); background: #fffdf8; }
.opt .dot { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--wash); color: var(--navy); transition: background-color .15s, color .15s; }
.opt .dot .i { width: 19px; height: 19px; }
.opt .chev { margin-left: auto; width: 18px; height: 18px; color: var(--muted); }
.opt[aria-pressed="true"] { border-color: var(--navy); background: var(--wash); box-shadow: 0 0 0 1.5px var(--navy); }
.opt[aria-pressed="true"] .dot { background: var(--navy); color: var(--gold); }

/* contact form */
.q-form { margin-top: 1.5rem; }
.fields { display: grid; gap: .75rem; }
.field-row { display: grid; grid-template-columns: 1fr 7.5rem; gap: .75rem; }
.field { position: relative; display: block; }
.field .fi { position: absolute; left: 1rem; top: 1.6rem; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.field input {
  width: 100%; height: 3.2rem; padding: 0 1rem 0 2.8rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  font: 500 1rem var(--body); color: var(--navy);
  transition: border-color .15s, box-shadow .15s;
}
.field-zip input { padding-left: 1rem; }
.field input::placeholder { color: #8b94a3; font-weight: 400; }
.field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(248, 184, 88, .45); }
.field input[aria-invalid="true"] { border-color: #c2410c; }
.field .err { display: block; margin-top: .3rem; font-size: .8125rem; color: #b4380a; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.q-submit { width: 100%; margin-top: 1.25rem; min-height: 3.5rem; font-size: 1rem; }
.reassure { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: .9rem; font-size: .8125rem; color: var(--muted); }
.reassure .i { width: 14px; height: 14px; }

/* result screens */
.result { text-align: center; }
.crest {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 1.1rem;
  border-radius: 50%; background: var(--wash); color: var(--navy); border: 1.5px solid var(--tan);
}
.crest .i { width: 30px; height: 30px; stroke-width: 2.4; }
.result.warn .crest { color: var(--gold-deep); }
.result .q-sub { max-width: 30rem; margin-inline: auto; }
.booking { position: relative; min-height: 720px; margin: 1.5rem -.5rem 0; }
.booking iframe { width: 100%; min-height: 720px; border: 0; overflow: hidden; opacity: 0; transition: opacity .2s; }
.booking.loaded iframe { opacity: 1; }
.booking-skeleton { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .8rem; padding-top: 6rem; color: var(--muted); font-size: .9375rem; }
.booking.loaded .booking-skeleton { display: none; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold-deep); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.recap { margin: 1.25rem 0 0; border: 1px solid var(--line); border-radius: 12px; text-align: left; overflow: hidden; }
.recap div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; font-size: .9rem; }
.recap div + div { border-top: 1px solid var(--line-soft); }
.recap dt { color: var(--muted); }
.recap dd { font-weight: 600; color: var(--navy); text-align: right; }
.result-actions { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-top: 1.5rem; }
.link-btn { padding: .6rem 1rem; font: 600 .875rem var(--body); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--navy); }


@media (prefers-reduced-motion: reduce) {
  .quiz, .quiz * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
