/* ============================================================
   Bespoke Window Renovations — theme tokens
   Matches the live Perspective funnel's theme block: buttonBackgroundColor
   #8ECC46 (green, CTAs/selection), formFieldBackgroundColor #54565A (dark
   warm grey, header/icon-cards/fields), fontColor #323334.
   ============================================================ */
:root {
  --color-text: #323334;
  --color-eyebrow: #8ECC46;    /* source renders the eyebrow in the brand green, not grey */
  --color-bg: #FFFFFF;
  --color-field-bg: #8ECC46;   /* primary brand color — buttons, selected states, progress */
  --color-field-bg-hover: #7AB83A;
  --color-card-bg: #54565A;    /* icon-card / header / form-field background */
  --color-card-bg-hover: #45474B;
  --color-accent: #8ECC46;
  --color-star: #FACC15;
  --color-border: #E4E4E1;
  --color-error: #C0392B;
  --color-danger: #D64545;     /* the start page's "No" option only */
  --color-danger-hover: #B93A3A;
  --radius: 8px;
  --radius-sm: 6px;
  --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-card-bg);
  text-align: center;
}
.site-header__logo {
  display: inline-block;
}
.site-header__logo img {
  height: 40px;
  width: auto;
}

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

.screen {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 24px 56px;
  animation: screenEnter 480ms ease both;
}
.screen--tight-top { padding-top: 8px; }
@keyframes screenEnter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

/* ---------- Typography ---------- */
.eyebrow {
  color: var(--color-eyebrow);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 8px;
}
h1.headline {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
  color: var(--color-text);
}
.subheadline {
  text-align: center;
  font-size: 15px;
  font-weight: 300;
  color: #6B6D70;
  margin: 0 0 20px;
}

h2.question {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  margin: 8px 0 6px;
}
.question-sub {
  text-align: center;
  font-size: 15px;
  color: #6B6D70;
  margin: 0 0 24px;
}
.body-text {
  color: #6B6D70;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  margin: 0 0 24px;
}

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

.question-head { text-align: center; margin-bottom: 24px; }
.question-divider {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto 24px;
  border: none;
  border-top: 1px solid var(--color-border);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  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.6; cursor: not-allowed; }
.btn-primary .btn-sub { font-weight: 300; font-size: 13px; opacity: 0.85; }
.btn-primary-wrap { display: flex; justify-content: center; margin: 4px 0 32px; }

/* ---------- Single-select icon-card grid ----------
   Verified live on the source funnel: 2 columns at 375px, jumping
   straight to 4 columns at BOTH 768px and 1280px (no 3-column step).
   CSS Grid (not flexbox) so a row remainder lands left-aligned under
   the first columns, not centered — matches the source exactly. */
.answers-icon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
@media (min-width: 768px) {
  .answers-icon-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

.answer-icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: var(--radius);
  background: var(--color-field-bg);
  color: #fff;
  padding: 20px 10px;
  text-align: center;
  transition: background 150ms ease, transform 150ms ease;
}
.answer-icon-card:hover { background: var(--color-field-bg-hover); }
.answer-icon-card:active { transform: scale(0.97); }
.answer-icon-card:disabled { opacity: 0.6; }
.answer-icon-card svg { width: 32px; height: 32px; fill: #fff; }
.answer-icon-card span.label { font-size: 13px; font-weight: 700; line-height: 1.3; }

/* The start page's ownership question is the one exception to the
   green default — Yes stays green, No is red. */
.answer-icon-card--danger { background: var(--color-danger); }
.answer-icon-card--danger:hover { background: var(--color-danger-hover); }

/* ---------- Multi-select list rows (Services question) ----------
   Full-width stacked rows at every width tested — not a grid at any
   breakpoint, just a wider centered column on larger screens. */
.answers-list {
  max-width: var(--max-width);
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.answer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease;
}
.answer-row.selected { border-color: var(--color-field-bg); background: #F3FAEC; }
.answer-row .emoji { font-size: 22px; line-height: 1; flex-shrink: 0; }
.answer-row .row-label { flex-grow: 1; }
.answer-row .row-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  transition: background 150ms ease, border-color 150ms ease;
}
.answer-row.selected .row-check { background: var(--color-field-bg); border-color: var(--color-field-bg); }

/* ---------- Text / textarea inputs (postcode, details) ---------- */
.field-input-wrap, .field-textarea-wrap {
  position: relative;
  margin-bottom: 8px;
}
.field-input-wrap .field-icon, .field-textarea-wrap .field-icon {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 18px;
}
.field-input-wrap input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 16px 16px 46px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  color: var(--color-text);
}
.field-input-wrap input:focus { outline: none; border-color: var(--color-field-bg); }
textarea.field-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 16px 16px 46px;
  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 ---------- */
.contact-form { margin-bottom: 20px; }
.input-wrap { position: relative; margin-bottom: 14px; }
.input-wrap .field-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  font-size: 17px;
  pointer-events: none;
}
.input-wrap input[type="text"],
.input-wrap input[type="email"],
.input-wrap input[type="tel"] {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 16px 16px 46px;
  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); }

.field-error {
  color: var(--color-error);
  font-size: 13px;
  margin: -2px 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: center; margin: 8px 0 12px; }
.reviews-bar__avatars { display: flex; justify-content: center; 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 image ---------- */
.hero-image {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  aspect-ratio: 8 / 5;
  background: #eee;
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Thank-you page ---------- */
.thanks-headline {
  color: var(--color-text);
  font-weight: 700;
  font-size: 24px;
  text-align: center;
  margin: 8px 0 24px;
}
.thanks-image {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 1 / 1;
}
.thanks-image img { width: 100%; height: 100%; object-fit: cover; }
.thanks-body {
  font-size: 16px;
  line-height: 1.65;
  text-align: left;
  max-width: var(--max-width);
  margin: 0 auto 32px;
  white-space: pre-line;
}

/* ---------- 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; }
}

/* ---------- Misc ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
