/* ===== Final screen — Sofi House v2 (matches quiz-v2 + design-concepts) ===== */
.quiz__last-screen {
  --qz-font: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  --qz-accent: #ea580c;
  --qz-accent-mid: #f97316;
  --qz-accent-soft: #d1d5db;
  --qz-accent-bg: #f9fafb;
  --qz-ink: #111827;
  --qz-text-soft: #6b7280;
  --qz-border: #e5e7eb;
  --qz-border-strong: #d1d5db;
  --qz-surface: #fff;
  --qz-bg: #f3f4f6;
  --qz-band: #f3f4f6;
  --qz-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --qz-r-lg: 16px;
  --qz-r-xl: 20px;
  --qz-shadow: 0 8px 28px rgba(17, 24, 39, 0.08);

  font-family: var(--qz-font);
  background: var(--qz-bg);
  max-width: 428px;
  margin: 0 auto;
  touch-action: manipulation;
}

/* Hero image */
.quiz__last-screen > .img,
.quiz__last-screen > .img-desktop {
  position: relative;
}

.quiz__last-screen > .img::after,
.quiz__last-screen > .img-desktop::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(17, 24, 39, 0.25) 100%);
}

/* Form shell */
.quiz__last-screen_form-wrapper {
  margin-top: -20px;
  padding: 1.35rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  border-radius: var(--qz-r-xl) var(--qz-r-xl) 0 0;
  background: var(--qz-surface);
  border-top: 2px solid var(--qz-border-strong);
  box-shadow: 0 -8px 32px rgba(17, 24, 39, 0.08);
}

.quiz__last-screen_form-wrapper .top-part {
  max-width: none;
  padding-bottom: 1.15rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--qz-border);
}

/* Bonuses — card list like quiz-v2 strip */
.quiz__last-screen .quiz__first-screen_bonus-label-wrapper {
  margin: 1rem 0;
  padding: 1rem 0.85rem;
  background: var(--qz-band);
  border: 1.5px solid var(--qz-border);
  border-radius: var(--qz-r-lg);
}

.quiz__last-screen .quiz__first-screen_bonus-label-wrapper::before {
  content: "Ваші бонуси";
  display: block;
  margin-bottom: 0.75rem;
  padding: 0 0 0.65rem;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--qz-text-soft);
  border-bottom: 1px solid var(--qz-border);
  border-left: 3px solid var(--qz-accent);
  padding-left: 0.65rem;
}

.quiz__last-screen .quiz__first-screen-main-block_bonus-wrapper {
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
}

.quiz__last-screen .quiz__first-screen-main-block_bonus-item {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: stretch;
  width: 100%;
  height: auto;
  min-height: 72px;
  margin: 0;
  background: var(--qz-surface);
  border: 1.5px solid var(--qz-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--qz-shadow);
  cursor: default;
}

.quiz__last-screen .quiz__first-screen-main-block_bonus-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--qz-accent), var(--qz-accent-mid));
  z-index: 3;
}

.quiz__last-screen .quiz__first-screen-main-block_bonus-item .bonus-item-bg {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  height: 100%;
  min-height: 72px;
  overflow: hidden;
}

.quiz__last-screen .quiz__first-screen-main-block_bonus-item .bonus-item-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quiz__last-screen .quiz__first-screen-main-block_bonus-item .bonus-item-filter {
  display: none;
}

.quiz__last-screen .quiz__first-screen-main-block_bonus-item .bonus-item-text {
  grid-column: 2;
  grid-row: 1;
  position: static;
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 0.75rem 2.75rem 0.75rem 0.85rem;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--qz-ink);
  text-align: left;
  text-shadow: none;
  max-width: none;
  min-width: 0;
  right: auto;
  top: auto;
}

.quiz__last-screen .quiz__first-screen-main-block_bonus-item .bonus-item-lock {
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  background: #d1d5db;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.12);
}

.quiz__last-screen .quiz__first-screen-main-block_bonus-item .bonus-item-lock svg {
  width: 11px;
  height: 11px;
  fill: #fff;
}

.quiz__last-screen .quiz__first-screen-main-block_bonus-item .bonus-item-info {
  display: none;
}

/* Title block — premium highlight substrate */
.quiz__last-screen-header {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-wrap: balance;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.quiz__last-screen-header::before,
.quiz__last-screen-header::after {
  content: none;
}

.quiz__last-screen-header__accent {
  font-weight: 800;
  color: var(--qz-accent);
  text-decoration: underline;
  text-decoration-color: rgba(234, 88, 12, 0.45);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.quiz__last-screen-header__accent--pill {
  display: inline;
  font-style: normal;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--qz-accent), var(--qz-accent-mid));
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(234, 88, 12, 0.28);
  white-space: nowrap;
}



.quiz__last-screen-header__lead {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--qz-text-soft);
}

.quiz__last-screen-header__highlight {
  position: relative;
  display: block;
  padding: 1rem 1.05rem 1.05rem;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.025em;
  color: var(--qz-ink);
  background: #fff;
  border: 1.5px solid var(--qz-border);
  border-radius: var(--qz-r-xl);
  box-shadow: var(--qz-shadow);
  overflow: hidden;
}

.quiz__last-screen-header__highlight::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath d='M0 50h100M50 0v100M10 10l80 80M90 10L10 90' stroke='%23111827' stroke-width='0.5' opacity='0.04'/%3E%3C/svg%3E");
  background-size: auto, 100px 100px;
  opacity: 0.85;
}

.quiz__last-screen-header__highlight strong {
  position: relative;
  z-index: 1;
  font-weight: 900;
  color: var(--qz-accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.quiz__last-screen-header__highlight em {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.22rem 0.55rem;
  font-style: normal;
  font-weight: 800;
  font-size: 0.92em;
  color: #fff;
  background: linear-gradient(135deg, var(--qz-accent), var(--qz-accent-mid));
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.quiz__last-screen-text {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--qz-ink);
  background: var(--qz-accent-bg);
  border: 1px solid var(--qz-border);
  border-radius: var(--qz-r-lg);
}

/* Mobile — final screen heading (single line + accents) */
@media (max-width: 818px) {
  .quiz__last-screen-header {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.38;
    color: var(--qz-ink, #111827);
    letter-spacing: -0.02em;
  }

  .quiz__last-screen-header__accent {
    font-size: inherit;
    font-weight: 800;
  }

  .quiz__last-screen-header__accent--pill {
    font-size: inherit;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
  }
}

/* Contact form area */
.quiz__last-screen-contact-way {
  margin-top: 1.25rem;
  max-width: none;
}

.quiz__last-screen-contact-way::before {
  content: "Контактні дані";
  display: block;
  margin-bottom: 0.75rem;
  padding-left: 0.65rem;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--qz-text-soft);
  border-left: 3px solid var(--qz-accent);
}

.quiz__last-screen .contact-way.name-phone {
  padding: 1rem;
  background: var(--qz-surface);
  border: 1.5px solid var(--qz-border);
  border-radius: var(--qz-r-xl);
  box-shadow: var(--qz-shadow);
}

/* Inputs */
.quiz__last-screen .quiz__last-screen_input > span:first-child {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--qz-accent);
}

.quiz__last-screen .quiz__last-screen_input .input-holder {
  border-radius: var(--qz-r-lg);
  overflow: hidden;
  border: 1.5px solid var(--qz-border);
  background: var(--qz-surface);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.04);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.quiz__last-screen .quiz__last-screen_input:focus-within .input-holder {
  border-color: var(--qz-accent);
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.12);
}

.quiz__last-screen .quiz__last-screen_input .input-holder > span {
  height: 52px;
  min-width: 52px;
  border: none;
  border-right: 1.5px solid var(--qz-border);
  border-radius: 0;
  background: #f9fafb;
  color: var(--qz-text-soft);
}

.quiz__last-screen .quiz__last-screen_input .input-holder svg {
  fill: var(--qz-accent);
}

.quiz__last-screen .quiz__last-screen_input .input-holder input {
  height: 52px;
  padding: 0 1rem;
  border: none;
  font-family: var(--qz-font);
  font-size: 16px;
  color: var(--qz-ink);
  background: transparent;
}

.quiz__last-screen .quiz__last-screen_input .input-holder input::placeholder {
  color: #9ca3af;
}

.quiz__last-screen .quiz__last-screen_input .input-holder:not(:has(span)) > input {
  border: none;
  padding: 0 1rem;
}

.quiz__last-screen .quiz__last-screen_input-with-flag {
  margin-top: 0.75rem;
}

.quiz__last-screen .quiz__last-screen_input-with-flag .input-holder > span {
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--qz-ink);
}

/* Messengers shortcut */
.quiz__last-screen-messengers-block {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  gap: 10px;
  background: var(--qz-accent-bg);
  border: 1.5px dashed var(--qz-border-strong);
  border-radius: var(--qz-r-lg);
  transition: border-color 0.22s ease, background 0.22s ease;
}

.quiz__last-screen-messengers-block:hover {
  background: var(--qz-surface);
  border-color: var(--qz-accent);
}

.quiz__last-screen-messengers-block .text {
  font-size: 13px;
  font-weight: 600;
  color: var(--qz-ink);
}

/* Submit button */
.quiz__last-screen .quiz_button_shadowed {
  margin-top: 0.85rem;
  min-height: 52px;
  font-family: var(--qz-font);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--qz-accent), var(--qz-accent-mid));
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.35);
  filter: none;
  transition: transform 0.22s var(--qz-ease), box-shadow 0.22s ease, opacity 0.2s ease;
}

.quiz__last-screen .quiz_button_shadowed:not(:disabled):active {
  transform: scale(0.97);
}

.quiz__last-screen .quiz_button_shadowed:disabled {
  opacity: 0.45;
  filter: none;
  box-shadow: none;
}

.quiz__last-screen .quiz_button_shadowed .last-step-sign {
  fill: #fff;
}

/* Privacy checkbox */
.quiz__last-screen-check-box {
  max-width: none;
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  width: 100%;
  background: #f9fafb;
  border: 1.5px solid var(--qz-border);
  border-radius: var(--qz-r-lg);
}

.quiz__last-screen-check-box .border {
  border-color: var(--qz-border-strong);
  background: var(--qz-surface);
}

.quiz__last-screen-check-box:has(input:checked) .border {
  background: linear-gradient(135deg, var(--qz-accent), var(--qz-accent-mid));
  border-color: var(--qz-accent);
}

.quiz__last-screen-check-box .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--qz-text-soft);
}

.quiz__last-screen-check-box .label a {
  color: var(--qz-accent);
  font-weight: 700;
}

/* Messenger picker */
.quiz__last-screen-contact-way .contact-way.choose-messanger h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--qz-ink);
  letter-spacing: -0.02em;
}

.contact-way_buttons-container .contact {
  min-height: 52px;
  border: 1.5px solid var(--qz-border);
  border-radius: var(--qz-r-lg);
  background: var(--qz-surface);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.04);
  transition: transform 0.22s var(--qz-ease), border-color 0.22s ease, box-shadow 0.22s ease;
}

.contact-way_buttons-container .contact:hover {
  border-color: var(--qz-border-strong);
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.08);
}

.contact-way_buttons-container .contact:active {
  transform: scale(0.98);
}

.quiz__last-screen-contact-way .contact-way.choose-messanger .back-to-name-phone,
.quiz__last-screen-contact-way .contact-way.messanger .back-to-name-phone {
  color: var(--qz-accent);
  font-weight: 600;
}

/* ===== Desktop ===== */
@media (min-width: 500px) {
  .quiz__last-screen > .img {
    height: 320px;
  }
}

@media (min-width: 819px) {
  .quiz__last-screen {
    max-width: none;
    height: 100vh;
    height: 100svh;
    grid-template-columns: 42% minmax(0, 1fr);
    background: var(--qz-surface);
    overflow: hidden;
  }

  .quiz__last-screen > .img-desktop::after {
    background: linear-gradient(270deg, rgba(17, 24, 39, 0.35), transparent 55%);
  }

  .quiz__last-screen_form-wrapper {
    margin-top: 0;
    width: 100%;
    max-width: none;
    margin-right: 0;
    padding: clamp(1rem, 2.2vh, 1.65rem) clamp(1.5rem, 3vw, 2.75rem);
    border-radius: 0;
    border-top: none;
    box-shadow: none;
    border-left: 1px solid var(--qz-border);
    overflow: hidden;
    justify-content: center;
    background: #fff;
  }

  .quiz__last-screen_form-wrapper .top-part,
  .quiz__last-screen-contact-way,
  .quiz__last-screen-check-box {
    max-width: min(640px, 100%);
    width: 100%;
  }

  .quiz__last-screen_form-wrapper .top-part {
    padding-bottom: 0.55rem;
    margin-bottom: 0.55rem;
    border-bottom: 1px solid rgba(234, 88, 12, 0.14);
  }

  .quiz__last-screen-header {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
    color: #111827;
    margin-bottom: 0.85rem;
  }

  .quiz__last-screen-header__accent--pill {
    white-space: normal;
  }

  .quiz__last-screen .quiz__first-screen_bonus-label-wrapper {
    margin: 0.5rem 0 0;
    padding: 0.6rem 0.7rem;
  }

  .quiz__last-screen .quiz__first-screen_bonus-label-wrapper::before {
    margin-bottom: 0.5rem;
    padding-bottom: 0.45rem;
    font-size: 9px;
  }

  .quiz__last-screen .quiz__first-screen-main-block_bonus-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    position: static;
    bottom: auto;
    width: 100%;
    max-width: 100%;
  }

  .quiz__last-screen .quiz__first-screen-main-block_bonus-item {
    min-width: 0;
    width: 100%;
    min-height: 58px;
    grid-template-columns: 48px 1fr;
  }

  .quiz__last-screen .quiz__first-screen-main-block_bonus-item .bonus-item-bg {
    min-height: 58px;
  }

  .quiz__last-screen .quiz__first-screen-main-block_bonus-item .bonus-item-text {
    min-height: 58px;
    padding: 0.55rem 2.35rem 0.55rem 0.6rem;
    font-size: 11px;
    line-height: 1.3;
    display: block;
  }

  .quiz__last-screen-text {
    margin-top: 0.5rem;
    padding: 0.55rem 0.7rem;
    font-size: 14px;
    line-height: 1.4;
  }

  .quiz__last-screen-contact-way {
    margin-top: 0.55rem;
  }

  .quiz__last-screen-contact-way::before {
    display: none;
    content: none;
  }

  .quiz__last-screen .contact-way.name-phone {
    padding: 0.65rem 0.75rem;
  }

  .quiz__last-screen .quiz__last-screen_input > span:first-child {
    font-size: 9px;
    margin-bottom: 4px;
  }

  .quiz__last-screen .quiz__last-screen_input .input-holder > span,
  .quiz__last-screen .quiz__last-screen_input .input-holder input {
    height: 44px;
    min-height: 44px;
  }

  .quiz__last-screen .quiz__last-screen_input-with-flag {
    margin-top: 0.5rem;
  }

  .quiz__last-screen-messengers-block {
    margin-top: 0.5rem;
    padding: 0.55rem 0.75rem;
  }

  .quiz__last-screen .quiz_button_shadowed {
    min-height: 44px;
    margin-top: 0.5rem;
    font-size: 14px;
  }

  .quiz__last-screen-check-box {
    margin-top: 0.5rem;
    padding: 0.55rem 0.65rem;
  }

  .quiz__last-screen-check-box .label {
    font-size: 11px;
    line-height: 1.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz__last-screen .quiz_button_shadowed,
  .quiz__last-screen .quiz__last-screen_input .input-holder,
  .contact-way_buttons-container .contact {
    transition: none;
  }
}

/* Line break in bonus text — desktop question sidebar only */
.qz-bonus-br {
  display: none;
}

@media (min-width: 819px) {
  .quiz-v2 .quiz__question-desktop-bonus-wrapper .qz-bonus-br,
  .quiz__last-screen .qz-bonus-br {
    display: inline;
  }
}
