:root {
  --bg-1: #f5f9ff;
  --bg-2: #eaf2ff;
  --surface: #ffffff;
  --surface-2: #f4f8ff;
  --surface-3: #fbfdff;
  --text: #12284a;
  --muted: #4d648a;
  --brand: #1c62db;
  --brand-dark: #124ba9;
  --accent: #23b26a;
  --line: #d3e0f5;
  --danger: #d64a4a;
  --shell-shadow: 0 16px 30px rgba(26, 73, 145, 0.14);
  --header-grad-1: #1c62db;
  --header-grad-2: #164fae;
  --header-border: #1d58b5;
  --header-subtitle: #edf4ff;
  --header-pill-bg: rgba(255, 255, 255, 0.14);
  --header-pill-line: rgba(255, 255, 255, 0.24);
  --card-bg: linear-gradient(180deg, #ffffff, #f5f9ff);
  --card-property-bg: linear-gradient(180deg, #f2f8ff, #e4f0ff);
  --card-property-line: #afc9e9;
  --card-client-bg: linear-gradient(180deg, #f1fff8, #e2f8ec);
  --card-client-line: #adddc4;
  --card-hover-line: #74a0df;
  --card-property-hover-line: #7ea9de;
  --card-client-hover-line: #78c79b;
  --last-answer-bg: rgba(224, 234, 248, 0.45);
  --last-answer-line: rgba(126, 160, 212, 0.75);
  --bar-piece-bg: #d6e2f4;
  --coach-bg: linear-gradient(180deg, #ebfff3, #e3fbe8);
  --coach-line: rgba(71, 195, 121, 0.6);
  --coach-text: #18653a;
  --input-bg: #ffffff;
  --input-line: #9eb9de;
  --input-text: #102749;
  --chip-bg: #fdfefe;
  --chip-line: #7ea1d5;
  --chip-text: #274b7c;
  --chip-active-bg: #e9fff1;
  --chip-active-line: #35bf79;
  --chip-active-text: #1a7d47;
  --range-bg: #f7fbff;
  --range-line: #d3e0f5;
  --range-title: #49648e;
  --range-text: #153a70;
  --location-feedback: #3f8f5f;
  --ghost-bg: #eaf2ff;
  --ghost-text: #274b7c;
  --summary-bg: #ffffff;
  --summary-text: #1b355d;
  --footer-grad-1: #1c62db;
  --footer-grad-2: #164fae;
  --footer-border: #1d58b5;
  --footer-text: #edf4ff;
  --footer-title: #cce1ff;
  --footer-sep: rgba(255, 255, 255, 0.24);
  --focus-ring: rgba(28, 98, 219, 0.42);
}

body.theme-dark {
  --bg-1: #0f1525;
  --bg-2: #161f34;
  --surface: #1a2337;
  --surface-2: #1e2940;
  --surface-3: #1c283d;
  --text: #e4ecff;
  --muted: #a6b5d6;
  --brand: #6aa3ff;
  --brand-dark: #3d74cf;
  --accent: #49d993;
  --line: #30415f;
  --shell-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  --header-grad-1: #1d4f93;
  --header-grad-2: #183d73;
  --header-border: #2d5288;
  --header-subtitle: #e2eeff;
  --header-pill-bg: rgba(10, 20, 36, 0.42);
  --header-pill-line: rgba(167, 194, 244, 0.32);
  --card-bg: linear-gradient(180deg, #1a273d, #192539);
  --card-property-bg: linear-gradient(180deg, #1d2d45, #1b2a41);
  --card-property-line: #3e5f8f;
  --card-client-bg: linear-gradient(180deg, #1b2f35, #1a2a31);
  --card-client-line: #3f7a64;
  --card-hover-line: #5b84c7;
  --card-property-hover-line: #67a0e5;
  --card-client-hover-line: #6dd7a0;
  --last-answer-bg: rgba(35, 51, 80, 0.6);
  --last-answer-line: rgba(98, 143, 214, 0.7);
  --bar-piece-bg: #2a3954;
  --coach-bg: linear-gradient(180deg, #1f3a2d, #1a3227);
  --coach-line: rgba(90, 201, 140, 0.62);
  --coach-text: #b4f2cd;
  --input-bg: #152339;
  --input-line: #3c5a88;
  --input-text: #e4ecff;
  --chip-bg: #1d2c45;
  --chip-line: #45669b;
  --chip-text: #c8dbff;
  --chip-active-bg: #1f4334;
  --chip-active-line: #49d993;
  --chip-active-text: #b8f3d3;
  --range-bg: #172538;
  --range-line: #314a70;
  --range-title: #9eb7de;
  --range-text: #d5e4ff;
  --location-feedback: #8eddb5;
  --ghost-bg: #243552;
  --ghost-text: #d1e1ff;
  --summary-bg: #162236;
  --summary-text: #d8e6ff;
  --footer-grad-1: #1a4785;
  --footer-grad-2: #14396d;
  --footer-border: #2b4d80;
  --footer-text: #deebff;
  --footer-title: #b9d0f4;
  --footer-sep: rgba(173, 200, 245, 0.26);
  --focus-ring: rgba(106, 163, 255, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(28, 98, 219, 0.08), transparent 34%),
    radial-gradient(circle at 88% 76%, rgba(35, 178, 106, 0.08), transparent 30%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  color: var(--text);
  min-height: 0;
  padding: 10px 0;
}

.app-shell {
  width: min(860px, 94vw);
  margin: 0 auto;
  background: linear-gradient(180deg, var(--surface), var(--surface-3));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shell-shadow);
  backdrop-filter: blur(4px);
}

.brand-header {
  text-align: center;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--header-grad-1), var(--header-grad-2));
  border-radius: 16px;
  padding: 12px 12px 10px;
  border: 1px solid var(--header-border);
  cursor: pointer;
}

.brand-header:hover {
  box-shadow: 0 10px 22px rgba(28, 98, 219, 0.2);
}

.brand-header:focus-visible {
  outline: 3px solid rgba(28, 98, 219, 0.35);
  outline-offset: 3px;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-wrap img {
  width: min(440px, 78vw);
  max-width: 100%;
  height: auto;
}

.subtitle {
  display: inline-block;
  margin: 8px 0 0;
  color: var(--header-subtitle);
  font-size: 1.02rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--header-pill-bg);
  border: 1px solid var(--header-pill-line);
}

.top-controls {
  margin-top: 10px;
  display: inline-flex;
  gap: 8px;
}

.lang-switch,
.theme-switch {
  border: 1px solid var(--header-pill-line);
  border-radius: 999px;
  background: var(--header-pill-bg);
  color: var(--header-subtitle);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  height: 32px;
  padding: 0 10px;
}

.theme-switch {
  cursor: pointer;
}

.lang-switch option {
  background: #ffffff;
  color: #12284a;
}

body.theme-dark .lang-switch option {
  background: #152339;
  color: #e4ecff;
}

.lang-switch:focus-visible,
.theme-switch:focus-visible,
.chip-btn:focus-visible,
.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.quiz-form input:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.home-intro h1 {
  font-size: clamp(1.35rem, 6vw, 2rem);
}

.support-text {
  color: var(--muted);
  max-width: 60ch;
}

.home-intro {
  text-align: center;
  margin: 0 auto 14px;
}

.home-intro .support-text {
  margin-left: auto;
  margin-right: auto;
}

.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--text);
  text-align: left;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.choice-card h2 {
  margin-bottom: 8px;
}

.choice-card p {
  margin: 0;
}

.choice-card-property {
  background: var(--card-property-bg);
  border-color: var(--card-property-line);
  box-shadow: inset 0 0 0 1px rgba(93, 136, 197, 0.16);
}

.choice-card-client {
  background: var(--card-client-bg);
  border-color: var(--card-client-line);
  box-shadow: inset 0 0 0 1px rgba(74, 156, 106, 0.15);
}

.choice-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(30, 84, 162, 0.16);
  border-color: var(--card-hover-line);
}

.choice-card-property:hover {
  border-color: var(--card-property-hover-line);
}

.choice-card-client:hover {
  border-color: var(--card-client-hover-line);
}

.top-progress {
  margin-bottom: 14px;
}

.last-answer {
  margin: 0 0 8px;
  color: var(--muted);
  background: var(--last-answer-bg);
  border-left: 2px solid var(--last-answer-line);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.92;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

#progress-percent {
  color: var(--muted);
  font-weight: 600;
}

.bar-track {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.bar-piece {
  height: 8px;
  border-radius: 999px;
  background: var(--bar-piece-bg);
}

.bar-piece.done {
  background: linear-gradient(90deg, #1f6cf0 0%, #2acb7d 100%);
  box-shadow: 0 0 10px rgba(38, 159, 244, 0.45);
}

.coach-box {
  border: 1px solid var(--coach-line);
  background: var(--coach-bg);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  animation: floatIn 0.36s ease;
}

.coach-box h3 {
  display: none;
}

.coach-box p {
  margin: 0;
  color: var(--coach-text);
  font-size: 13px;
  line-height: 1.35;
}

.quiz-form {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-radius: 14px;
  padding: 14px;
  animation: floatIn 0.28s ease;
}

.quiz-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.quiz-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--input-line);
  background: var(--input-bg);
  color: var(--input-text);
  border-radius: 10px;
  font-size: 15px;
}

.choices-wrap {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  border: 1px solid var(--chip-line);
  background: var(--chip-bg);
  color: var(--chip-text);
  border-radius: 999px;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip-btn:hover,
.chip-btn.is-active {
  border-color: var(--chip-active-line);
  background: var(--chip-active-bg);
  color: var(--chip-active-text);
}

.price-range-box {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--range-line);
  border-radius: 12px;
  background: var(--range-bg);
}

.price-range-title {
  margin: 0;
  color: var(--range-title);
  font-size: 13px;
}

.price-range-values {
  margin: 6px 0 0;
  font-weight: 700;
  color: var(--range-text);
}

.price-range-sliders {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.price-slider {
  width: 100%;
  accent-color: #1c62db;
}

.location-feedback {
  margin: 0;
  color: var(--location-feedback);
  font-size: 13px;
}

.location-suggestions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.location-suggestions .location-feedback {
  text-align: center;
}

.suggestion-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.suggestion-chip-row.neighborhood-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.suggestion-chip-row.neighborhood-row .chip-btn {
  width: 100%;
  border-radius: 12px;
}

.actions-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

button,
.primary-btn,
.ghost-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.primary-btn {
  background: var(--brand);
  color: #fff;
}

.primary-btn:hover {
  background: var(--brand-dark);
}

.ghost-btn {
  background: var(--ghost-bg);
  color: var(--ghost-text);
}

.summary-box {
  border: 1px solid var(--line);
  background: var(--summary-bg);
  border-radius: 12px;
  padding: 12px;
  white-space: pre-wrap;
  color: var(--summary-text);
}

.review-list {
  margin: 12px 0;
  display: grid;
  gap: 8px;
}

.review-item {
  border: 1px solid var(--line);
  background: var(--summary-bg);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.review-item p {
  margin: 0;
}

.review-item button {
  white-space: nowrap;
}

.site-footer {
  width: min(860px, 94vw);
  margin: 12px auto 0;
  padding: 0;
}

.footer-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: linear-gradient(180deg, var(--footer-grad-1), var(--footer-grad-2));
  border: 1px solid var(--footer-border);
  border-radius: 16px;
  box-shadow: 0 14px 26px rgba(26, 73, 145, 0.24);
  overflow: hidden;
}

.footer-section {
  color: var(--footer-text);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  min-height: 100%;
}

.footer-section + .footer-section {
  border-left: 1px solid var(--footer-sep);
}

.footer-section h3 {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--footer-title);
}

.footer-section p {
  margin: 0;
}

.footer-section p + p {
  margin-top: 4px;
}

.footer-section a,
.footer-section a:visited,
.footer-section a:hover,
.footer-section a:active,
.footer-section a[x-apple-data-detectors],
.footer-section a[x-apple-data-detectors-type="telephone"] {
  color: var(--footer-text) !important;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-note {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

@media (max-width: 760px) {
  body {
    padding: 0;
  }

  .app-shell {
    width: 100vw;
    min-height: auto;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 12px;
    box-shadow: none;
  }

  .site-footer {
    width: 100vw;
    margin: 8px 0 0;
    padding: 0 10px 12px;
  }

  .footer-card {
    grid-template-columns: 1fr;
  }

  .footer-section + .footer-section {
    border-left: 0;
    border-top: 1px solid var(--footer-sep);
  }

  .brand-header {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 12px;
  }

  .top-progress {
    margin-bottom: 10px;
  }

  .coach-box {
    margin-bottom: 10px;
    padding: 10px;
  }

  .quiz-form {
    padding: 10px;
  }

  .actions-row {
    margin-top: 10px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .choices-wrap {
    display: grid;
    grid-template-columns: 1fr;
  }

  .suggestion-chip-row.neighborhood-row {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .progress-copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions-row {
    justify-content: stretch;
    flex-direction: column;
  }

  button,
  .primary-btn,
  .ghost-btn {
    width: 100%;
    text-align: center;
  }

  .quiz-form input {
    min-height: 46px;
    font-size: 16px;
  }

  .price-range-box {
    padding: 9px 10px;
  }
}
