/* ============================================================
   Windows & Doors4U — theme tokens
   Brand colors sampled directly from their logo/marketing graphics.
   ============================================================ */
:root {
  --color-text: #0A0A0A;
  --color-eyebrow: #0D46A3;
  --color-bg: #FFFFFF;
  --color-field-bg: #0D46A3;    /* brand blue — buttons, answer tiles */
  --color-field-bg-hover: #0A3680;
  --color-accent: #FBE401;      /* brand yellow — price/highlight text */
  --color-red: #DE0202;         /* brand red, sampled from the logo — offer banner */
  --color-star: #22C55E;
  --color-border: #E4E4E1;
  --color-error: #C0392B;
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 640px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- Header ---------- */
.site-header {
  padding: 16px 24px;
  background: var(--color-bg);
}
.site-header__logo img {
  height: 44px;
  width: auto;
  border-radius: 6px;
}

/* ---------- Layout ---------- */
.app {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  padding-bottom: 6px; /* room for the fixed progress bar */
}

.screen {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 24px 56px;
  animation: screenEnter 480ms ease both;
}
.screen.leaving { animation: screenLeave 320ms ease both; }
@keyframes screenEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes screenLeave {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

.narrow { max-width: var(--max-width); margin-left: auto; margin-right: auto; }

/* ---------- Progress bar ---------- */
.progress-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: var(--color-border);
  z-index: 50;
}
.progress-bar__fill {
  height: 100%;
  background: var(--color-field-bg);
  transition: width 300ms ease;
}

/* ---------- Typography — left-aligned throughout, matching the reference funnel ---------- */
.eyebrow {
  color: var(--color-eyebrow);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}
h1.headline {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--color-text);
}
h1.headline .accent { color: var(--color-field-bg); }

h2.question {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--color-text);
  text-align: left;
  margin: 8px 0 6px;
  letter-spacing: -0.01em;
}
.question-sub {
  text-align: left;
  font-size: 16px;
  font-weight: 300;
  color: #4B5563;
  margin: 0 0 24px;
}
.body-text {
  color: #4B5563;
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 20px;
}

@media (min-width: 640px) {
  h1.headline { font-size: 40px; }
  h2.question { font-size: 34px; }
}

.question-head { text-align: left; margin-bottom: 24px; }

/* ---------- Offer banner ---------- */
.offer-banner {
  background: var(--color-red);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}
.offer-banner .accent { color: var(--color-accent); }
.offer-banner small { display: block; font-weight: 300; font-size: 12px; opacity: 0.9; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  max-width: 420px;
  background: var(--color-field-bg);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  transition: background 150ms ease, transform 150ms ease;
}
.btn-primary:hover { background: var(--color-field-bg-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary .btn-sub { font-weight: 300; font-size: 13px; opacity: 0.85; }
.btn-primary-wrap { display: flex; justify-content: flex-start; margin: 4px 0 32px; }

/* ---------- Choice answers — icon cards (used for every choice question) ----------
   2-up by default, even on the narrowest phones; expands with viewport.
   A lone leftover card (odd item count) centers itself rather than
   stretching or sticking left — verified against the reference funnel
   at 320/375/413/768/1280px before picking this breakpoint. */
.answers-media-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 14px;
  margin-bottom: 28px;
}
.answers-media-grid .answer-card { width: calc(50% - 7px); }
@media (min-width: 560px) {
  .answers-media-grid .answer-card { width: calc(33.333% - 10px); }
}
@media (min-width: 860px) {
  .answers-media-grid .answer-card { width: calc(25% - 11px); }
}

.answer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  padding: 24px 12px;
  border-radius: var(--radius);
  background: var(--color-field-bg);
  color: #fff;
  text-align: center;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
  aspect-ratio: 1 / 1;
}
.answer-card:hover { background: var(--color-field-bg-hover); transform: translateY(-2px); }
.answer-card:active { transform: scale(0.98); }
.answer-card.selected { box-shadow: 0 0 0 3px var(--color-accent) inset; }
.answer-card__media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.answer-card__media svg { width: 56%; height: 56%; max-height: 64px; fill: #fff; }
.answer-card__label {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
}

/* ---------- Multi-select tiles (Services step) ---------- */
.answers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 560px) {
  .answers-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}
.answer-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  color: var(--color-text);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease;
}
.answer-tile:hover { border-color: var(--color-field-bg); }
.answer-tile.selected { background: var(--color-field-bg); color: #fff; border-color: var(--color-field-bg); }
.answer-tile .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.answer-tile.selected .check { background: #fff; color: var(--color-field-bg); border-color: #fff; }

/* ---------- Form fields ---------- */
.field-group { margin-bottom: 20px; }
.field-label { display: block; font-size: 17px; font-weight: 300; margin-bottom: 8px; }

.field-textarea-wrap { position: relative; margin-bottom: 8px; }
textarea.field-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  color: var(--color-text);
}
textarea.field-textarea:focus { outline: none; border-color: var(--color-field-bg); }

.contact-form { margin-bottom: 20px; }
.input-wrap { margin-bottom: 14px; }
.input-wrap input[type="text"],
.input-wrap input[type="email"],
.input-wrap input[type="tel"] {
  width: 100%;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  color: var(--color-text);
}
.input-wrap input:focus { outline: none; border-color: var(--color-field-bg); }

.phone-wrap {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 14px;
}
.phone-wrap:focus-within { border-color: var(--color-field-bg); }
.phone-code {
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px;
  background: #F5F5F3;
  border-right: 2px solid var(--color-border);
  font-size: 16px;
  white-space: nowrap;
}
.phone-wrap input[type="tel"] {
  border: none; flex: 1; min-width: 0; padding: 16px;
  font-family: inherit; font-size: 16px; font-weight: 300; color: var(--color-text);
}
.phone-wrap input[type="tel"]:focus { outline: none; }

.field-error { color: var(--color-error); font-size: 13px; margin: -10px 0 14px 4px; display: none; }
.field-error.visible { display: block; }

.consent-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 18px 0 24px; font-size: 14px; line-height: 1.5; color: var(--color-text);
}
.consent-row input[type="checkbox"] {
  margin-top: 3px; width: 18px; height: 18px;
  accent-color: var(--color-field-bg); flex-shrink: 0;
}
.consent-row a { text-decoration: underline; }

/* ---------- Reviews bar ---------- */
.reviews-bar { text-align: left; margin: 8px 0 28px; }
.reviews-bar__avatars { display: flex; justify-content: flex-start; margin-bottom: 8px; }
.reviews-bar__avatars img {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff;
  object-fit: cover; margin-left: -10px;
}
.reviews-bar__avatars img:first-child { margin-left: 0; }
.reviews-bar__stars { color: var(--color-star); font-size: 18px; letter-spacing: 2px; margin-bottom: 6px; }
.reviews-bar__text { font-size: 14px; color: var(--color-text); }
.reviews-bar__text strong { font-weight: 700; }

/* ---------- Hero photo (single image, not a carousel — only one source photo) ---------- */
.hero-photo {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  aspect-ratio: 21 / 9;
  background: #eee;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Video testimonials ---------- */
.video-testimonials { margin: 8px 0 28px; }
.video-testimonials__title { font-size: 20px; font-weight: 700; margin: 0 0 14px; }
.video-testimonials__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 560px) { .video-testimonials__grid { grid-template-columns: repeat(3, 1fr); } }
.video-testimonials__item {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-text);
  cursor: pointer;
}
.video-testimonials__item img { width: 100%; height: 100%; object-fit: cover; }
.video-testimonials__video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-testimonials__play {
  position: absolute; inset: 0; margin: auto; width: 44px; height: 44px;
  background: rgba(255,255,255,0.9); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.video-testimonials__play svg { width: 22px; height: 22px; fill: var(--color-field-bg); }
.video-testimonials__placeholder {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: #6B7280;
}
.video-testimonials__placeholder svg { width: 32px; height: 32px; fill: var(--color-border); margin: 0 auto 10px; }
.video-testimonials__placeholder p { font-size: 13px; margin: 0; line-height: 1.5; }
.video-testimonials__placeholder code { background: #F3F4F6; padding: 1px 5px; border-radius: 4px; }

/* ---------- Why Us section ---------- */
.why-us { margin: 36px 0 28px; }
.why-us__eyebrow {
  color: var(--color-field-bg); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 8px;
}
.why-us__title { font-size: 28px; font-weight: 700; line-height: 1.15; margin: 0 0 20px; letter-spacing: -0.01em; }
.why-us__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.why-us__item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 2px 4px rgba(13,70,163,0.04), 0 12px 32px -8px rgba(13,70,163,0.10);
}
.why-us__icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(13,70,163,0.08);
  display: flex; align-items: center; justify-content: center;
}
.why-us__icon svg { width: 22px; height: 22px; fill: var(--color-field-bg); }
.why-us__item h3 { font-size: 18px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.why-us__item p { font-size: 15px; font-weight: 300; line-height: 1.5; color: #4B5563; margin: 0; }

.quote-block {
  border-left: 4px solid var(--color-field-bg);
  padding: 4px 0 4px 18px;
  margin: 24px 0;
  font-size: 16px;
  font-style: italic;
  color: #374151;
}
.quote-block cite { display: block; margin-top: 8px; font-style: normal; font-weight: 700; font-size: 14px; color: var(--color-text); }

/* ---------- Areas covered ---------- */
.areas { margin: 28px 0; }
.areas h3 { font-size: 20px; font-weight: 700; margin: 0 0 14px; }
.areas ul { list-style: none; padding: 0; margin: 0 0 12px; }
.areas li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 15px; }
.areas li svg { width: 18px; height: 18px; fill: var(--color-field-bg); flex-shrink: 0; }
.areas .note { font-size: 13px; color: var(--color-error); margin: 0; }

/* ---------- Thank-you page ---------- */
.thanks-headline { color: var(--color-text); font-weight: 700; font-size: 26px; text-align: left; margin: 8px 0 20px; line-height: 1.2; }
.thanks-body { font-size: 16px; line-height: 1.6; text-align: left; margin-bottom: 8px; color: #374151; white-space: pre-line; }
.thanks-signoff { display: block; font-weight: 700; margin-top: 18px; color: var(--color-text); }

/* ---------- Confetti ---------- */
.confetti-piece {
  position: fixed; top: -10px; width: 8px; height: 14px; opacity: 0.9;
  z-index: 999; pointer-events: none; animation: confettiFall linear forwards;
}
@keyframes confettiFall { to { transform: translateY(110vh) rotate(540deg); opacity: 0.4; } }
