/* ============================================================
   DESIGN TOKENS — mirrors Backyard Planner palette
============================================================ */
:root {
  --stone-50:  #FAF9F7;
  --stone-100: #F2F0EC;
  --stone-200: #E4E0D8;
  --stone-300: #C9C4B8;
  --stone-400: #9E9889;
  --stone-500: #6E6A5E;
  --stone-600: #4A4740;
  --stone-700: #32302B;
  --stone-800: #1E1D19;
  --sage-400:  #7A9B7A;
  --sage-500:  #5C8060;
  --sage-600:  #3E6042;
  --sage-700:  #284530;
  --gold-300:  #D4B896;
  --gold-400:  #C4A07A;
  --blue-700:  #00598e;
  --white:          #FFFFFF;
  --text-primary:   #1E1D19;
  --text-secondary: #4A4740;
  --text-muted:     #6E6A5E;
  --text-light:     #9E9889;
  --border:    rgba(30,29,25,0.09);
  --border-md: rgba(30,29,25,0.15);
  --r-sm: 4px; --r-md: 8px; --r-lg: 14px;
  --font-serif: 'EB Garamond', Georgia, serif;
  --font-display: 'Oswald', sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease: 0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font-sans); font-size: 16px; color: var(--text-primary); background: var(--stone-50); -webkit-font-smoothing: antialiased; }

/* ============================================================
   TOP BAR (desktop)
============================================================ */
@media (min-width: 780px) {
  #desktop-top-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 32px;
    background: var(--stone-800); padding: 0 40px; height: 56px;
    position: sticky;
    top: 0;
    z-index: 150;
    display: none;
  }
  #desktop-top-bar .dtb-label {
    font-family: var(--font-display); font-size: 11px; font-weight: 600;
    letter-spacing: .13em; text-transform: uppercase; color: var(--stone-400);
    white-space: nowrap; flex-shrink: 0;
  }
  #desktop-top-bar .dtb-pips { display: flex; align-items: center; gap: 5px; flex: 1; justify-content: center; }
  #desktop-top-bar .dtb-pip  { height: 3px; width: 20px; border-radius: 2px; background: var(--stone-600); transition: background .3s, width .25s; }
  #desktop-top-bar .dtb-pip.done   { background: var(--sage-500); }
  #desktop-top-bar .dtb-pip.active { background: var(--white); width: 32px; }
  #desktop-top-bar .dtb-right      { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
  #desktop-top-bar .dtb-breakdown  { font-size: 12px; color: var(--stone-500); text-align: right; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
#desktop-top-bar { display: none; }
@media (min-width: 780px) { #desktop-top-bar { display: flex; display: none; } }

/* ============================================================
   APP SHELL
============================================================ */
#app { display: flex; flex-direction: column; }

@media (max-width: 780px) {
    #app { padding-top: 20px; }
}

/* ============================================================
   PHOTO PANEL
============================================================ */
#photo-panel {
  position: relative; width: 100%; height: 56vw;
  min-height: 440px; max-height: 460px; overflow: hidden;
  background: var(--stone-800); flex-shrink: 0;
}
.photo-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .65s ease; z-index: 1; }
.photo-slide.active { opacity: 1; z-index: 2; }
.photo-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.1) 45%, rgba(0,0,0,.06) 100%); }
.slide-overlay { position: absolute; bottom: 30px; left: 0; right: 0; padding: 22px 22px 18px; z-index: 3; opacity: 0; transform: translateY(8px); transition: opacity .5s ease .2s, transform .5s ease .2s; }
.photo-slide.active .slide-overlay { opacity: 1; transform: translateY(0); }
.slide-quote { display: flex; align-items: flex-start; gap: 10px; background: rgba(255,255,255,.11); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.17); padding: 10px 14px; }
.slide-quote .sq-mark { font-family: var(--font-serif); font-size: 65px; line-height: 1; color: white; flex-shrink: 0; margin-top: -3px; }
.slide-quote .sq-text { font-size: 15px; color: rgba(255,255,255,.95); font-style: italic; line-height: 1.5; }
.slide-quote .sq-author { font-size: 12px; font-style: normal; font-weight: 600; color: white; margin-top: 5px; }

@media (max-width: 779px) {
    .slide-overlay { top: 20px; bottom: auto; padding: 22px 10px 18px; }
    .photo-slide::after { background: linear-gradient(to bottom, rgba(0,0,0,.7) 0%, rgba(0,0,0,.1) 45%, rgba(0,0,0,.06) 100%); }
    .slide-quote .sq-text { font-size: 12px; margin-bottom: 0; }
}

/* ============================================================
   MOBILE PROGRESS BAR
============================================================ */
#progress-bar { background: var(--stone-800); color: var(--white); padding: 11px 18px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; position: sticky; top: 0; z-index: 20; display: none; }
@media (min-width: 780px) { #progress-bar { display: none; } }
.pb-label { font-family: var(--font-display); font-size: 10px; font-weight: 600; letter-spacing: .10em; text-transform: uppercase; color: var(--stone-400); margin-bottom: 2px; }
.pb-step  { font-size: 12px; color: var(--stone-400); }
.pb-right { display: flex; align-items: center; gap: 14px; }
.pb-pips  { display: flex; flex-direction: column; gap: 3px; }
.pb-pip   { width: 16px; height: 3px; border-radius: 2px; background: var(--stone-600); transition: background .3s; }
.pb-pip.done   { background: var(--sage-500); }
.pb-pip.active { background: var(--white); }

/* ============================================================
   CONTROLS PANEL
============================================================ */
#controls-panel { background: var(--stone-50); display: flex; flex-direction: column; padding-top: 25px; padding-bottom: 50px; }
#steps-scroll { overflow: visible; -webkit-overflow-scrolling: touch; padding: 28px 20px 0; }

/* ============================================================
   STEPS
============================================================ */
.step { display: none; }
.step.active { display: block; animation: fadeUp .26s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.step-eyebrow { font-family: var(--font-display); font-size: 10px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--text-light); margin-bottom: 7px; }
.step-title { font-family: var(--font-display); font-size: 25px; font-weight: 500; text-transform: uppercase; color: var(--text-primary); line-height: 1.2; margin-bottom: 8px; }
.step-desc { font-size: 14px; color: var(--text-muted); line-height: 1.65; margin-bottom: 24px; }

/* ============================================================
   ANSWER TILES (single-select)
============================================================ */
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 22px; }
.tile {
  position: relative; background: var(--white); border: 1.5px solid var(--border-md); padding: 15px 13px 13px; cursor: pointer; text-align: left;
  font-family: var(--font-sans); transition: border-color var(--ease), background var(--ease), transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.tile:active { transform: scale(.97); }
.tile-name { font-size: 15px; font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 3px; }
.tile-sub  { font-size: 12px; color: var(--text-light); display: block; line-height: 1.4; }
.tile.selected { border-color: var(--sage-600); background: #F3F7F3; }
.tile.selected .tile-name { color: var(--sage-700); }
.tile .t-check { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--sage-600); display: none; align-items: center; justify-content: center; }
.tile.selected .t-check { display: flex; }
.tile .t-check::after { content: ''; width: 5px; height: 8px; border: 1.5px solid #fff; border-top: none; border-left: none; transform: rotate(45deg) translateY(-1px); }
.tile.full { grid-column: span 2; }

/* ============================================================
   MULTI-SELECT TILES
============================================================ */
.multi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 22px; }
.multi-tile {
  position: relative; background: var(--white); border: 1.5px solid var(--border-md); padding: 14px 13px 13px 38px; cursor: pointer; text-align: left;
  font-family: var(--font-sans); transition: border-color var(--ease), background var(--ease), transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.multi-tile:active { transform: scale(.97); }
.multi-tile-name { font-size: 14px; font-weight: 600; color: var(--text-primary); display: block; }
.multi-tile-sub  { font-size: 12px; color: var(--text-light); display: block; line-height: 1.4; margin-top: 2px; }
.multi-tile .mt-box {
  position: absolute; top: 14px; left: 13px; width: 18px; height: 18px;
  border-radius: 4px; border: 1.5px solid var(--stone-300); background: var(--stone-50);
  transition: background var(--ease), border-color var(--ease);
  display: flex; align-items: center; justify-content: center;
}
.multi-tile.selected { border-color: var(--sage-600); background: #F3F7F3; }
.multi-tile.selected .multi-tile-name { color: var(--sage-700); }
.multi-tile.selected .mt-box { background: var(--sage-600); border-color: var(--sage-600); }
.multi-tile.selected .mt-box::after { content: ''; width: 5px; height: 8px; border: 1.5px solid #fff; border-top: none; border-left: none; transform: rotate(45deg) translateY(-1px); }
.multi-tile.full { grid-column: span 2; }

/* ============================================================
   PRODUCT CARDS (pool / hot tub / sauna steps)
============================================================ */
.product-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.product-card {
  position: relative; background: var(--white); border: 1.5px solid var(--border-md); overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; flex: auto;
}
.product-card.selected { border-color: var(--sage-600); }
.product-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: background var(--ease); }
.product-card.selected::before { background: var(--sage-600); }
.pc-body-wrap { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 16px 18px; }
.pc-text { flex: 1; min-width: 0; }
.pc-name { font-family: var(--font-display); font-size: 18px; font-weight: 400; color: var(--text-primary); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .02em; }
.pc-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 9px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pc-tag { font-size: 11px; font-weight: 500; letter-spacing: .03em; color: var(--stone-500); background: var(--stone-100); padding: 3px 9px; transition: background var(--ease), color var(--ease); }
.product-card.selected .pc-tag { background: #E6EFE6; color: var(--sage-700); }
.pc-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.pc-circle { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--stone-300); background: var(--stone-50); display: flex; align-items: center; justify-content: center; transition: background var(--ease), border-color var(--ease); flex-shrink: 0; }
.product-card.selected .pc-circle { background: var(--sage-600); border-color: var(--sage-600); }
.pc-circle::after { content: ''; width: 5px; height: 9px; border: 2px solid var(--stone-300); border-top: none; border-left: none; transform: rotate(45deg) translateY(-1px); transition: border-color var(--ease); }
.product-card.selected .pc-circle::after { border-color: var(--white); }

/* ============================================================
   SKIP BUTTON
============================================================ */
.skip-btn {
  width: 100%; background: transparent; border: 1.5px dashed var(--border-md);
  border-radius: var(--r-lg); padding: 14px 18px; font-size: 14px; color: var(--text-muted);
  cursor: pointer; font-family: var(--font-sans); text-align: center; margin-bottom: 22px;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.skip-btn:hover { border-color: var(--stone-400); color: var(--text-secondary); }
.skip-btn.selected { border-style: solid; border-color: var(--sage-600); background: #F3F7F3; color: var(--sage-700); font-weight: 600; }


/* ============================================================
   RESULTS AREA
============================================================ */
.result-section { margin-bottom: 22px; }
.result-section-label { font-family: var(--font-display); font-size: 10px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--text-light); margin-bottom: 10px; }

/* Match cards */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .match-grid { grid-template-columns: 1fr; } }
.match-card { background: var(--white); border: 1.5px solid var(--border-md); overflow: hidden; transition: border-color var(--ease); }
.match-card.primary { border-color: var(--sage-500); }
.match-badge { font-family: var(--font-display); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 6px 14px; border-bottom: 1px solid var(--border); }
.match-card.primary .match-badge { background: #F3F7F3; color: var(--sage-600); }
.match-card.alt .match-badge { background: var(--stone-50); color: var(--text-light); }
.match-body { padding: 0 14px 14px; }
.match-image { width: 100%; height: 130px; object-fit: contain; padding: 8px; }
.match-logo { height: 65px; width: auto; object-fit: contain; margin: 10px 0 6px; display: block; }
.match-name { font-family: var(--font-display); font-size: 17px; color: var(--text-primary); margin-bottom: 4px; text-transform: uppercase; }
.match-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.match-tag { font-size: 11px; color: var(--stone-500); background: var(--stone-100); padding: 2px 8px; }
.match-card.primary .match-tag { background: #E6EFE6; color: var(--sage-700); }
.match-link { display: inline-block; font-family: var(--font-display); font-size: 12px; color: var(--sage-600); text-decoration: none; text-transform: uppercase; }
.match-link:hover { color: var(--sage-700); }

/* Profile summary */
.profile-card { background: var(--white); border: 1px solid var(--border-md); overflow: hidden; margin-bottom: 14px; }
.profile-head { padding: 11px 18px; border-bottom: 1px solid var(--border); font-family: var(--font-display); font-size: 10px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; color: var(--text-muted); background: var(--stone-50); }
.profile-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border); font-size: 14px; }
.profile-row:last-child { border-bottom: none; }
.profile-label { color: var(--text-muted); }
.profile-val { font-weight: 600; color: var(--text-primary); text-align: right; max-width: 60%; }

/* "Not Sure" handling banner */
.no-match-banner { background: var(--stone-100); border: 1px solid var(--border-md); padding: 18px 18px; margin-bottom: 14px; font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.no-match-banner strong { color: var(--text-primary); }


/* Recommendation block */
.rec-block {
  background: #f9f7f4;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.rec-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a7560;
  margin-bottom: 10px;
}

.rec-combo-badge {
  display: inline-block;
  background: #1a3c2e;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.rec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.rec-chip {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #333;
}

.rec-text {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
}

.rec-text strong {
  color: #1a1a1a;
}

/* ============================================================
   FORM GATE
============================================================ */
.lead-card { background: var(--white); border: 1px solid var(--border-md); padding: 20px 18px; margin-bottom: 14px; }
.lead-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; text-transform: uppercase; color: var(--text-primary); margin-bottom: 6px; letter-spacing: .03em; }
.lead-card p  { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.field-row    { display: flex; gap: 10px; margin-bottom: 10px; }
.field-row input, .field-single input {
  flex: 1; width: 100%; background: var(--stone-50); border: 1.5px solid var(--border-md); padding: 11px 14px; font-size: 14px;
  font-family: var(--font-sans); color: var(--text-primary); transition: border-color var(--ease); outline: none;
}
.field-row input:focus, .field-single input:focus { border-color: var(--sage-500); }
.field-single { margin-bottom: 10px; }
.review-disclaimer { font-size: 12px; color: var(--text-light); text-align: center; line-height: 1.65; margin-bottom: 22px; }

/* ============================================================
   NAV FOOTER
============================================================ */
#nav-footer {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 20px 18px; background: var(--stone-50);
  border-top: 1px solid var(--border-md); position: sticky; bottom: 0; z-index: 10;
}
.btn-back  { background: var(--stone-100); color: var(--text-secondary); border: 1.5px solid var(--border-md); flex-shrink: 0; padding: 14px 16px; }
.btn-back:hover { background: var(--stone-200); }
.btn-reset { background: transparent; color: var(--text-light); border: 1.5px solid var(--border-md); flex-shrink: 0; font-size: 12px; padding: 14px 13px; }
.btn-reset:hover { color: var(--text-muted); border-color: var(--stone-300); }
.btn--primary:disabled { background: var(--stone-200); color: var(--stone-400); cursor: not-allowed; transform: none; border:none; }
.btn-cta { flex: 1; background: var(--sage-600); color: var(--white); }
.btn-cta:hover { background: var(--sage-700); }

/* ============================================================
   DESKTOP LAYOUT
============================================================ */
@media (min-width: 780px) {
  #app { flex-direction: row; align-items: flex-start; min-height: calc(100dvh - 56px); overflow: hidden; }
  #photo-panel { width: 46%; height: calc(100dvh - 56px); max-height: none; position: sticky; top: 0; flex-shrink: 0; }
  .slide-overlay { padding: 30px 28px 26px; }
  #controls-panel { width: 54%; min-height: calc(100dvh - 56px); overflow: hidden; }
  #steps-scroll { padding: 34px 30px 50px 30px; }
  .step-title { font-size: 28px; }
  .step-desc { font-size: 15px; }
}
@media (min-width: 1080px) { #photo-panel { width: 50%; } #controls-panel { width: 50%; } }

/* ============================================================
   START SCREEN
============================================================ */
#start-screen { padding: 40px 20px 0; text-align: center; }
@media (min-width: 780px) { #start-screen { padding: 50px 30px 0; text-align: left; } }
#start-screen .start-sub { font-size: 15px; color: var(--text-muted); line-height: 1.65; margin-bottom: 28px; max-width: 480px; }
@media (min-width: 780px) { #start-screen .start-sub { margin-left: 0; margin-right: 0; } }
.start-features { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
.start-feature { display: flex; align-items: center; gap: 12px; padding: 13px 0px; text-align: left; }
.sf-icon { width: 36px; height: 36px; border-radius: 50%; background: #F3F7F3; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; }
.sf-text strong { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.sf-text span   { display: block; font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-top: 1px; }
#btn-start { font-family: var(--font-display); background: var(--blue-700); color: var(--white); border: none; border-radius: 3px; padding: 16px 36px; font-size: 17px; font-weight: 400; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; transition: background var(--ease), transform .12s; }
#btn-start:hover { background: var(--stone-700); }
#btn-start:active { transform: scale(.97); }