/* Quote Engine customer page. Calm, light, one accent color (from config). */

:root {
  --accent: #1f6feb;
  --bg: #faf8f4;
  --surface: #fff;
  --text: #1d1b18;
  --muted: #5d584f;
  --line: #e4dfd6;
  --line-strong: #cfc8bc;
  --error: #b3261e;
  --error-bg: #fbf1ef;
  --glow: #fff0c6;
  --wall-2: #f3efe8;
  --tint: #eef3fd;
  --tint-2: #d9e5fb;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 180ms;
  --move: 260ms;
}

@supports (color: color-mix(in srgb, red, white)) {
  :root {
    --tint: color-mix(in srgb, var(--accent) 9%, white);
    --tint-2: color-mix(in srgb, var(--accent) 20%, white);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 16px/1.5 var(--font-body);
  color: var(--text);
  background: var(--bg);
}

.page {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------- header / footer ---------- */

.site-header {
  padding: 1.1rem 0 0.25rem;
}

.biz-name {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.logo {
  display: block;
  max-height: 36px;
  width: auto;
}

.site-footer {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}

.site-footer p {
  margin: 0;
}

/* ---------- layout ---------- */

.layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.house-panel {
  order: -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 190px;
  padding: 0.6rem 0.75rem 0.5rem;
  border-radius: 20px;
  background: var(--tint);
  overflow: hidden;
}

.layout[data-step="contact"] .house-panel,
.layout[data-step="sent"] .house-panel {
  height: 124px;
}

.house {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.live-price {
  flex: none;
  margin: 0;
  min-height: 1.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

/* Once the price is the headline, the caption is noise. */
.layout[data-step="price"] .live-price,
.layout[data-step="contact"] .live-price,
.layout[data-step="sent"] .live-price {
  display: none;
}

main {
  min-width: 0;
}

@media (min-width: 900px) {
  .layout {
    display: grid;
    grid-template-columns: minmax(0, 30rem) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
    padding-top: 1rem;
  }

  .house-panel {
    order: 0;
    position: sticky;
    top: 1.5rem;
    height: auto;
    padding: 2rem 1.5rem 1.25rem;
    border-radius: 28px;
  }

  .layout[data-step="contact"] .house-panel,
  .layout[data-step="sent"] .house-panel {
    height: auto;
  }

  .house {
    max-width: 440px;
    height: auto;
  }

  .live-price {
    font-size: 1rem;
    margin-top: 0.75rem;
  }
}

/* ---------- topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
}

.progress {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bar {
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  transition: transform var(--move) var(--ease);
}

/* ---------- type ---------- */

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 1.25rem 0 1rem;
}

/* Headings get focus from script so screen readers start at the question. */
h1:focus {
  outline: none;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
}

@media (min-width: 900px) {
  h1 {
    font-size: 2.25rem;
  }
}

/* ---------- forms ---------- */

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
  min-width: 0;
}

legend {
  padding: 0;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

legend h1 {
  display: block;
}

.field {
  margin-bottom: 1rem;
}

.field > label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 52px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: transform var(--fast) var(--ease);
}

.choice:active {
  transform: scale(0.99);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--tint);
}

.choice input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

.addon-price {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* stops iOS zooming in on focus */
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235d584f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}

textarea {
  resize: vertical;
}

[aria-invalid="true"] {
  border-color: var(--error);
}

fieldset[aria-invalid="true"] .choice {
  border-color: var(--error);
}

button {
  font: inherit;
  min-height: 48px;
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
}

.primary {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
  transition: transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}

.primary:hover {
  transform: translateY(-1px);
}

.primary:active {
  transform: scale(0.99);
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Dark text, accent underline: readable on the warm background whatever the
   client's accent is (a mid-blue accent alone misses AA on it). */
.back,
.link {
  border: 0;
  background: none;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  padding-left: 0;
  padding-right: 0;
}

.back {
  min-height: 44px;
  font-weight: 600;
}

.link {
  min-height: 0;
  padding: 0;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.actions {
  margin: 1.5rem 0;
}

.error {
  color: var(--error);
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

.notice {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border-left: 4px solid var(--accent);
  background: var(--tint);
}

.notice.alert {
  border-left-color: var(--error);
  background: var(--error-bg);
}

.notice a {
  color: inherit;
  font-weight: 600;
}

/* ---------- price screen ---------- */

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.price .to {
  font-size: 0.5em;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0;
  margin: 0 0.25rem;
  vertical-align: 0.2em;
}

.price-sub {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.included {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.included li {
  position: relative;
  padding-left: 1.75rem;
}

.included li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.range-note {
  color: var(--muted);
  margin: 1.25rem 0 0;
}

@media (min-width: 900px) {
  .price {
    font-size: 3.25rem;
  }

  .included {
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
  }
}

/* ---------- screen transitions ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#screen.enter {
  animation: rise 240ms var(--ease) both;
}

/* ---------- the house ---------- */

.house .ground {
  fill: var(--tint-2);
}

.house .part {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--move) var(--ease), transform var(--move) var(--ease);
}

.house .built {
  opacity: 0;
  transition: opacity var(--move) var(--ease);
}

.house .part.on,
.house.is-built .built,
.house:not(.is-built) .outline,
.house.has-neighbors .neighbors,
.house.deep .sparkle,
.house.moving .boxes,
.house.pets-1 .cat,
.house.pets-2 .dog,
.house.recurring .badge {
  opacity: 1;
  transform: none;
}

.house.roof-flat .gable,
.house:not(.roof-flat) .flat,
.house.roof-flat .cap {
  opacity: 0;
}

.house .sparkle:nth-child(2) { transition-delay: 60ms; }
.house .sparkle:nth-child(3) { transition-delay: 120ms; }
.house .sparkle:nth-child(4) { transition-delay: 180ms; }

.house .outline {
  fill: none;
  stroke: var(--accent);
  stroke-opacity: 0.4;
  stroke-width: 2;
  stroke-dasharray: 6 5;
  stroke-linejoin: round;
}

.house .house-g {
  transform: scale(var(--size, 1));
  transform-origin: 160px 218px;
  transition: transform var(--move) var(--ease);
}

.house .roof {
  transform: translateY(calc(-46px * (var(--stories, 1) - 1)));
  transition: transform var(--move) var(--ease);
}

.house .wall,
.house .housing {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.house .neighbors path {
  fill: var(--wall-2);
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.house .gable path,
.house .flat rect,
.house .cap {
  fill: var(--accent);
}

.house .win rect {
  fill: var(--glow);
  stroke: var(--line-strong);
  stroke-width: 1.2;
}

.house .win path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.2;
}

.house .tile rect {
  fill: var(--tint-2);
  stroke: var(--surface);
  stroke-width: 1;
}

.house .drop {
  fill: var(--accent);
}

.house .interior {
  fill: var(--glow);
}

.house .door rect {
  fill: var(--accent);
}

.house .door circle {
  fill: var(--surface);
}

.house .door {
  transform-box: fill-box;
  transform-origin: 0 50%;
  transition: opacity var(--move) var(--ease), transform var(--move) var(--ease);
}

.house.door-open .door {
  transform: scaleX(0.22);
}

.house .cat,
.house .dog {
  fill: var(--muted);
}

.house .cat .line,
.house .dog .line {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.house .sparkle {
  fill: var(--accent);
}

.house .boxes rect {
  fill: #ecdcc3;
  stroke: #c9b08a;
  stroke-width: 1.2;
}

.house .boxes .tape {
  fill: none;
  stroke: #c9b08a;
  stroke-width: 3;
}

.house .badge .head {
  fill: var(--accent);
}

.house .badge .body {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1.2;
}

.house .badge .check {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.house .badge text {
  font: 600 11px var(--font-body);
  fill: var(--muted);
}

@keyframes settle {
  0% { transform: scale(1); }
  40% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

.house.settle .settle-g {
  transform-origin: 160px 218px;
  animation: settle 240ms var(--ease) 1;
}

/* ---------- utilities ---------- */

/* Honeypot: off-screen for people, still in the form for bots. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Turnstile (step 9). Reserve the widget's height so the button does not jump. */
.turnstile {
  min-height: 65px;
  margin: 1rem 0 0.25rem;
}
.turnstile:empty {
  min-height: 0;
}
