/* Mobile v2 polish — font, bonuses, last screen, answer deco (gold palette) */

:root {
  --qz-font: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  --qz-gold: #b69f0e;
  --qz-gold-mid: #d7b900;
  --qz-gold-dark: #85740a;
  --qz-ink: #111827;
  --qz-text: #1a1a1a;
  --qz-text-soft: #4b5563;
  --qz-border: #e5e7eb;
  --qz-surface: #fff;
  --qz-bg: #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);
}

body,
.quiz__first-screen,
.quiz__question-frame,
.quiz__last-screen,
.design-showcase {
  font-family: var(--qz-font);
}

/* Hide bonus hint triggers everywhere */
.bonus-item-info,
.bonus-item-hint {
  display: none !important;
}

/* Hide skyline behind first-screen bonuses */
.dc-bonus__grid-wrap .deco-skyline-strip,
.dc-bonus .deco-skyline-strip {
  display: none !important;
}

.dc-bonus__grid-wrap {
  min-height: 0;
  padding-bottom: 0;
}

/* ===== Answer cards — decorative icon on the right ===== */
@media (max-width: 818px) {
  .input-radio {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 0 10px;
    padding: 0.55rem 0.75rem;
    min-height: unset;
  }

  .input-radio .input-radio_pin {
    width: 18px;
    height: 18px;
  }

  .input-radio .input-radio_label {
    margin: 0;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
  }

  .input-check-box {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 0 10px;
    padding: 0.55rem 0.75rem;
    min-height: unset;
  }

  .input-check-box .quiz_checkbox {
    grid-column: 1 / 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    align-self: stretch;
    gap: 10px;
    width: 100%;
    min-height: 100%;
    padding: 0;
  }

  .input-check-box .quiz_checkbox .border {
    grid-column: 1;
    grid-row: 1;
    width: 18px;
    height: 18px;
  }

  .input-check-box .quiz_checkbox input[type="checkbox"] {
    grid-column: 1;
    grid-row: 1;
    width: 18px;
    height: 18px;
  }

  .input-check-box .quiz-answer-deco {
    grid-column: 3;
    grid-row: 1;
  }

  .input-check-box .label {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
  }

  .quiz-answer-deco {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .quiz-answer-deco svg {
    width: 18px;
    height: 18px;
  }
}

@media (min-width: 819px) {
  .input-radio {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 0 12px;
  }

  .input-radio .input-radio_label {
    margin: 0;
    min-width: 0;
  }

  .input-check-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .input-check-box .quiz_checkbox {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  .input-check-box .quiz-answer-deco {
    flex-shrink: 0;
    margin-left: auto;
  }

  .input-check-box:has(.info) {
    display: grid;
    grid-template-columns: 1fr auto min-content;
    align-items: center;
  }

  .input-check-box:has(.info) .quiz_checkbox {
    grid-column: 1;
  }

  .input-check-box:has(.info) .quiz-answer-deco {
    grid-column: 2;
    margin-left: 0;
  }
}

.quiz-answer-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #faf6eb 0%, #f3f0e0 100%);
  border: 1px solid #e8dcc0;
  color: var(--qz-gold);
  opacity: 0.85;
  transition: opacity 0.22s ease, transform 0.22s var(--qz-ease), background 0.22s ease;
}

.quiz-answer-deco svg {
  width: 22px;
  height: 22px;
  display: block;
}

.input-radio.selected .quiz-answer-deco,
.input-check-box:has(input:checked) .quiz-answer-deco {
  opacity: 1;
  background: linear-gradient(135deg, var(--qz-gold) 0%, var(--qz-gold-mid) 100%);
  border-color: transparent;
  color: #fff;
  transform: scale(1.04);
}

.input-radio:has(.info) {
  grid-template-columns: 20px 1fr auto min-content;
}

.input-check-box:has(.info) {
  grid-template-columns: 1fr auto min-content;
}

@media (max-width: 818px) {
  .input-radio:has(.info) {
    grid-template-columns: 18px minmax(0, 1fr) 32px min-content;
  }

  .input-check-box:has(.info) {
    grid-template-columns: 18px minmax(0, 1fr) 32px min-content;
  }

  .input-check-box:has(.info) .quiz_checkbox .border,
  .input-check-box:has(.info) .quiz_checkbox input[type="checkbox"] {
    grid-column: 1;
  }

  .input-check-box:has(.info) .label {
    grid-column: 2;
  }

  .input-check-box:has(.info) .quiz-answer-deco {
    grid-column: 3;
  }

  .quiz__answers-with-radio-container {
    gap: 10px;
  }
}

/* ===== Mobile bonuses during quiz (progress strip) ===== */
@media (max-width: 818px) {
  .quiz__progress-bonus-wrapper {
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
    padding: 0 1rem;
    cursor: default;
  }

  .quiz__progress-bonus-wrapper .quiz__first-screen-main-block_bonus-item {
    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__progress-bonus-wrapper .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-gold), var(--qz-gold-mid));
    z-index: 3;
  }

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

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

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

  .quiz__progress-bonus-wrapper .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;
  }

  .quiz__progress-bonus-wrapper .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__progress-bonus-wrapper .quiz__first-screen-main-block_bonus-item .bonus-item-lock svg {
    width: 11px;
    height: 11px;
    fill: #fff;
  }

  /* ===== Last screen mobile ===== */
  .quiz__last-screen {
    max-width: 428px;
    background: var(--qz-bg);
  }

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

  .quiz__last-screen > .img {
    position: relative;
  }

  .quiz__last-screen_form-wrapper {
    margin-top: -20px;
    padding: 1.35rem 1.25rem 1rem;
    border-radius: var(--qz-r-xl) var(--qz-r-xl) 0 0;
    background: var(--qz-surface);
    border-top: 2px solid #d1d5db;
    box-shadow: 0 -8px 32px rgba(17, 24, 39, 0.08);
  }

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

  .quiz__last-screen .quiz__first-screen_bonus-label-wrapper {
    margin: 0 0 1rem;
    padding: 1rem 0.85rem;
    background: var(--qz-bg);
    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 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-gold);
  }

  .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 {
    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);
  }

  .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-gold), var(--qz-gold-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;
  }

  .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;
    max-width: none;
    min-width: 0;
  }

  .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-header {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.32;
    letter-spacing: -0.025em;
    color: var(--qz-ink);
    text-wrap: balance;
  }

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

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

  .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);
  }

  .quiz__last-screen .quiz__last-screen_input > span:first-child {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--qz-gold);
  }

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

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

  .quiz__last-screen .quiz__last-screen_input .input-holder input {
    border: none;
    font-family: var(--qz-font);
    font-size: 16px;
    color: var(--qz-ink);
    padding-left: 12px;
    padding-right: 12px;
  }

  .quiz__last-screen .quiz__last-screen_input-with-flag .input-holder input {
    padding-left: 12px;
  }

  /* Fixed submit — visible from page load, docks above checkbox */
  .quiz__last-screen {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .quiz-submit-dock-anchor {
    height: 1px;
    margin: 0;
    pointer-events: none;
    visibility: hidden;
  }

  .quiz__last-screen .quiz-submit-sticky-wrap {
    position: fixed;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 100;
    width: min(calc(100% - 2.5rem), 378px);
    transform: translateX(-50%);
    margin: 0;
    padding: 8px 0 0;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.98) 65%, rgba(255, 255, 255, 0) 100%);
    transition: position 0.2s ease;
  }

  .quiz__last-screen .quiz-submit-sticky-wrap.is-docked {
    position: static;
    transform: none;
    width: 100%;
    left: auto;
    bottom: auto;
    z-index: 1;
    margin-top: 0.85rem;
    padding-top: 0;
    background: none;
  }

  .quiz__last-screen:has(.quiz-submit-sticky-wrap.is-docked) {
    padding-bottom: 0;
  }

  .quiz__last-screen-messengers-block {
    border-radius: var(--qz-r-lg);
    border: 1.5px solid var(--qz-border);
    background: var(--qz-bg);
  }

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

  /* Sticky submit button styles */
  .quiz__last-screen .quiz-submit-sticky-wrap .quiz_button_shadowed {
    width: 100%;
    margin-top: 0;
    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-gold), var(--qz-gold-mid));
    box-shadow: 0 8px 24px rgba(182, 159, 14, 0.35);
    filter: none;
  }

  .quiz__last-screen .quiz-submit-sticky-wrap .quiz_button_shadowed:disabled {
    opacity: 1;
    background: #bfc3d4;
    box-shadow: none;
    filter: none;
    cursor: not-allowed;
  }

  .quiz__last-screen .quiz-submit-sticky-wrap .quiz_button_shadowed:disabled::after {
    display: none;
  }

  .quiz__last-screen .quiz-submit-sticky-wrap .quiz_button_shadowed .last-step-sign {
    fill: #fff;
  }

  .quiz__last-screen-check-box {
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    background: #f9fafb;
    border: 1.5px solid var(--qz-border);
    border-radius: var(--qz-r-lg);
  }

  .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-gold-dark);
    font-weight: 700;
  }
}

@media (min-width: 819px) {
  .quiz__last-screen .quiz-submit-sticky-wrap {
    position: static;
    transform: none;
    width: 100%;
    max-width: 575px;
    background: none;
    padding-top: 0;
    margin-top: 0.85rem;
  }

  .quiz-submit-dock-anchor {
    display: none;
  }
}
