:root {
  --page: #f7f7f5;
  --surface: #ffffff;
  --ink: #171719;
  --muted: #58606a;
  --line: #e3e1dc;
  --line-strong: #24282d;
  --blue: #1672c9;
  --red: #e0192f;
  --soft: #f0efeb;
  --shadow: 0 10px 26px rgba(23, 23, 25, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.quiz-app {
  --header-height: 64px;
  --promo-height: 42px;
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--header-height) var(--promo-height) 4px minmax(0, 1fr);
}

.quiz-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 76px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand-lockup {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #8a9098;
  font-weight: 700;
}

.brand-lockup-single {
  gap: 0;
}

.company-logo {
  width: auto;
  height: 38px;
  display: block;
  object-fit: contain;
  background: transparent;
}

.balkon24-logo {
  width: 178px;
  height: auto;
  max-height: 52px;
  display: block;
}

.header-icon {
  width: 100%;
  min-height: 64px;
  border: 0;
  display: grid;
  place-items: center;
  color: #24282d;
  background: transparent;
  text-decoration: none;
  font-size: 34px;
  line-height: 1;
}

.header-icon:hover,
.header-icon:focus-visible {
  background: rgba(23, 23, 25, 0.04);
  outline: none;
}

.back-button {
  visibility: hidden;
}

.back-button.is-visible {
  visibility: visible;
}

.promo-strip {
  position: sticky;
  top: var(--header-height);
  z-index: 39;
  min-width: 0;
  min-height: var(--promo-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fff;
  background: var(--red);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0;
}

.promo-strip span,
.promo-strip strong {
  min-width: 0;
}

.promo-strip strong {
  font-weight: 800;
}

.promo-strip i {
  width: 1px;
  height: 18px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.55);
}

.progress-track {
  position: sticky;
  top: calc(var(--header-height) + var(--promo-height));
  z-index: 38;
  width: 100%;
  height: 4px;
  background: transparent;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width 220ms ease;
}

.quiz-stage {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(24px, 4.5vh, 42px) 24px 30px;
}

.quiz-status {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-bottom: 12px;
  color: #3d4650;
  font-size: 13px;
  font-weight: 700;
}

#stepHint {
  display: none;
}

.step {
  display: none;
}

.step.is-active {
  display: block;
}

.question-head {
  margin: 0 auto 20px;
  text-align: center;
}

.question-head h1,
.result-step h1 {
  max-width: 850px;
  margin: 0 auto;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 3.8vw, 50px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0;
}

.question-head p,
.result-step p {
  max-width: 680px;
  margin: 12px auto 0;
  color: #404852;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.option-grid {
  width: min(100%, 920px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-grid-three {
  width: min(100%, 1040px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-grid-text {
  width: min(100%, 760px);
  align-items: stretch;
}

.option {
  position: relative;
  width: 100%;
  min-height: 260px;
  border: 1px solid rgba(36, 40, 45, 0.12);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}

.option:hover,
.option:focus-visible {
  border-color: var(--line-strong);
  box-shadow: 0 12px 32px rgba(23, 23, 25, 0.1);
  outline: none;
}

.option.is-selected {
  border-color: var(--blue);
  background: linear-gradient(180deg, #ffffff 0%, #eef7ff 100%);
  box-shadow: 0 16px 34px rgba(22, 114, 201, 0.16);
  outline: none;
}

.option.is-selected::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.option:hover,
.option:focus-visible {
  transform: translateY(-2px);
}

.option-image {
  width: 100%;
  height: 176px;
  border-radius: 6px;
  background: #eef0f2;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.option-image img {
  display: block;
  width: 100%;
  height: 176px;
  padding: 0;
  object-fit: cover;
  background: transparent;
}

.option-image img.is-window-triple {
  padding: 4px;
  transform: scale(1.18);
}

.option-image img.is-roof-focus {
  object-position: center 18%;
}

.option-image img.is-electric-focus {
  object-position: center 12%;
}

.option span {
  display: block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.option-copy {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.option-icon {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #edf6ff;
  box-shadow: inset 0 0 0 1px rgba(22, 114, 201, 0.15);
}

.option-icon svg {
  width: 44px;
  height: 44px;
  display: block;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.option.is-selected .option-icon {
  color: #fff;
  background: var(--blue);
  box-shadow: none;
}

.option small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
}

.option-text {
  min-height: 142px;
  justify-content: center;
  align-items: center;
  padding: 22px 22px 20px;
}

.skip-option {
  width: min(100%, 300px);
  min-height: 48px;
  border: 1px solid #6f7780;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px auto 0;
  padding: 0 24px;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
  text-align: center;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.skip-option:hover,
.skip-option:focus-visible,
.skip-option.is-selected {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  outline: none;
}

.skip-option:hover,
.skip-option:focus-visible {
  transform: translateY(-1px);
}

.contact-step {
  max-width: 560px;
  margin: 0 auto;
}

.summary-box {
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.summary-box strong {
  color: var(--ink);
}

.bonus-card {
  width: 100%;
  border-radius: 8px;
  padding: 16px 20px;
  display: grid;
  gap: 6px;
  color: #fff;
  background: linear-gradient(135deg, #e0192f 0%, #bd1023 100%);
  box-shadow: 0 14px 32px rgba(224, 25, 47, 0.18);
  text-align: center;
}

.bonus-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.22;
  font-weight: 800;
}

.bonus-card span {
  display: block;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.contact-bonus {
  margin: 0 0 16px;
}

.contact-fields {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 62px;
  border: 1px solid #d5d9de;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--ink);
  background: var(--surface);
  font-size: 18px;
}

.field input:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 87, 216, 0.14);
}

.field input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(224, 25, 47, 0.12);
}

.privacy {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.privacy a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.privacy a:hover,
.privacy a:focus-visible {
  text-decoration: underline;
}

.unp-note {
  margin: 0 0 18px;
  color: #7a828b;
  font-size: 12px;
  line-height: 1.35;
}

.legal-note {
  margin: 0 0 14px;
  color: #6f7780;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.submit-button,
.secondary-button {
  width: min(100%, 330px);
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 0 24px;
  color: #fff;
  background: var(--red);
  font-weight: 700;
}

.submit-button:hover,
.secondary-button:hover {
  background: #bd1023;
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.submit-button:disabled:hover {
  background: var(--red);
}

.result-step {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.result-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #1f8f56;
  font-size: 30px;
  font-weight: 700;
}

.lead-preview {
  display: none;
}

.policy-page {
  background: #f7f7f5;
}

.policy-wrap {
  width: min(100% - 36px, 860px);
  margin: 0 auto;
  padding: 42px 0 64px;
  color: var(--ink);
}

.policy-back {
  display: inline-flex;
  margin-bottom: 30px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.policy-back:hover,
.policy-back:focus-visible {
  text-decoration: underline;
}

.policy-wrap h1 {
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

.policy-wrap section {
  margin-top: 26px;
}

.policy-wrap h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.25;
}

.policy-wrap p {
  margin: 0;
  color: #38424d;
  font-size: 17px;
  line-height: 1.62;
}

@media (min-width: 701px) and (max-height: 820px) {
  .quiz-stage {
    padding: clamp(12px, 2.5vh, 22px) 24px 22px;
  }

  .question-head {
    margin-bottom: 18px;
  }

  .question-head h1,
  .result-step h1 {
    font-size: clamp(34px, 3.4vw, 46px);
  }

  .option {
    min-height: 228px;
    padding: 14px;
  }

  .option-image,
  .option-image img {
    height: 146px;
  }

  .skip-option {
    margin-top: 10px;
  }
}

@media (max-width: 980px) {
  .option-grid-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .quiz-app {
    --header-height: 58px;
    --promo-height: 54px;
  }

  .quiz-header {
    grid-template-columns: 54px minmax(0, 1fr) 54px;
  }

  .header-icon {
    min-height: 58px;
    font-size: 30px;
  }

  .promo-strip {
    min-height: 50px;
    padding: 8px 18px;
    flex-direction: column;
    gap: 3px;
    font-size: 14px;
  }

  .promo-strip i {
    display: none;
  }

  .brand-lockup {
    gap: 8px;
  }

  .company-logo {
    width: auto;
    height: 34px;
  }

  .balkon24-logo {
    width: min(162px, 54vw);
    max-height: 48px;
  }

  .quiz-stage {
    padding: 26px 26px 34px;
  }

  .question-head {
    margin-bottom: 22px;
  }

  .question-head h1,
  .result-step h1 {
    width: min(100%, 330px);
    font-size: 28px;
    line-height: 1.12;
    overflow-wrap: break-word;
    text-wrap: balance;
  }

  .question-head p,
  .result-step p {
    font-size: 16px;
  }

  .option-grid,
  .option-grid-three,
  .option-grid-text {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .option-grid-text {
    width: min(100%, 330px);
  }

  .option {
    min-height: 112px;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-areas:
      "image title"
      "image text";
    align-items: center;
    justify-items: start;
    text-align: left;
    padding: 13px 16px;
    column-gap: 14px;
    row-gap: 4px;
  }

  .option-image {
    grid-area: image;
    height: 84px;
    width: 112px;
  }

  .option-image img {
    height: 84px;
    padding: 0;
  }

  .option-image img.is-window-triple {
    padding: 2px;
    transform: scale(1.16);
  }

  .option span {
    grid-area: title;
    align-self: end;
    font-size: 18px;
  }

  .option small {
    grid-area: text;
    align-self: start;
    margin: 0;
  }

  .option-text {
    min-height: 104px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 13px;
    padding: 14px 18px;
    text-align: left;
  }

  .option-text .option-copy {
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 5px;
    justify-items: start;
    align-content: center;
  }

  .option-text .option-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
  }

  .option-text .option-icon svg {
    width: 38px;
    height: 38px;
  }

  .option-text span {
    grid-area: auto;
    align-self: auto;
    width: 100%;
    font-size: 17px;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  .option-text small {
    grid-area: auto;
    align-self: auto;
    width: 100%;
    margin: 0;
    font-size: 13px;
    line-height: 1.28;
  }

  .skip-option {
    width: min(100%, 312px);
    min-height: 46px;
    margin-top: 20px;
    font-size: 15px;
  }

  body.show-mobile-extras-next .quiz-stage {
    padding-bottom: calc(106px + env(safe-area-inset-bottom));
  }

  body.show-mobile-extras-next .skip-option {
    position: fixed;
    left: max(18px, env(safe-area-inset-left));
    right: max(18px, env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 60;
    width: auto;
    max-width: 360px;
    min-height: 54px;
    margin: 0 auto;
    border: 0;
    color: #fff;
    background: var(--red);
    box-shadow: 0 14px 32px rgba(224, 25, 47, 0.28);
  }

  body.show-mobile-extras-next .skip-option::after {
    content: " →";
  }

  body.show-mobile-extras-next .skip-option:hover,
  body.show-mobile-extras-next .skip-option:focus-visible {
    background: #bd1023;
  }

  .summary-box {
    font-size: 14px;
    margin-bottom: 12px;
    padding: 14px 16px;
  }

  .bonus-card {
    padding: 14px 16px;
  }

  .bonus-card strong {
    font-size: 16px;
    line-height: 1.2;
  }

  .bonus-card span {
    font-size: 13px;
  }

  .contact-bonus {
    margin-bottom: 14px;
  }

  .result-step {
    max-width: 340px;
    padding-top: 2px;
  }

  .result-mark {
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    font-size: 28px;
  }

  .result-step p {
    width: min(100%, 318px);
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.42;
  }

  .result-step .secondary-button {
    margin-top: 2px;
  }
}
