.lead-quiz {
    position: fixed;
    inset: 0;
    z-index: 5000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.22s ease,
        visibility 0.22s ease;
}

.lead-quiz.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lead-quiz__overlay {
    position: absolute;
    inset: 0;

    background: rgba(2, 7, 4, 0.76);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lead-quiz__dialog {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overflow-x: hidden;

    padding: 32px;

    color: #222222;
    background: #ffffff;
    border-radius: 28px;

    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);

    transform: translateY(16px) scale(0.985);

    transition:
        transform 0.22s ease;
}

.lead-quiz.is-open .lead-quiz__dialog {
    transform: translateY(0) scale(1);
}

.lead-quiz__dialog::-webkit-scrollbar {
    width: 0;
}

.lead-quiz__back,
.lead-quiz__close {
    position: absolute;
    top: 31px;
    z-index: 10;

    width: 28px;
    height: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #818181;
    background: transparent;
    border: 0;
    border-radius: 50%;

    cursor: pointer;

    transition:
        color 0.18s ease,
        background 0.18s ease;
}

.lead-quiz__back {
    left: 32px;
}

.lead-quiz__close {
    right: 32px;
}

.lead-quiz__back:hover,
.lead-quiz__close:hover {
    color: #020704;
    background: rgba(2, 7, 4, 0.045);
}

.lead-quiz__back.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lead-quiz__mount {
    width: 100%;
}


/* RTL for Arabic */
.lead-quiz[dir="rtl"] {
    direction: rtl;
}

.lead-quiz[dir="rtl"] .lead-quiz__back {
    left: auto;
    right: 32px;
}

.lead-quiz[dir="rtl"] .lead-quiz__close {
    right: auto;
    left: 32px;
}

.lead-quiz[dir="rtl"] .lead-quiz__back svg {
    transform: scaleX(-1);
}

@media (max-width: 640px) {
    .lead-quiz {
        padding: 0;
        align-items: stretch;
    }

    .lead-quiz__dialog {
        max-width: none;
        max-height: 100vh;
        min-height: 100vh;

        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .lead-quiz__dialog {
        padding: 32px;
    }
}
/* ==========================================================================
   Lead Quiz Form
========================================================================== */

.lq-form {
    width: 100%;
}

.lq-step {
    display: none;
}

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

.lq-step__meta {
    margin: 51px 0 12px;

    font-size: 16px;
    line-height: 1;
    font-weight: 400;
    color: #898989;
}

.lq-progress {
    width: 100%;
    height: 7px;
    margin-bottom: 28px;

    overflow: hidden;

    background: #dfdfdd;
    border-radius: 999px;
}

.lq-progress__bar {
    height: 100%;
    width: 0;

    background: #00D348;
    border-radius: inherit;

    transition: width 0.25s ease;
}

.lq-title {
    margin: 0 0 8px;

    font-family: var(--font-main, 'Gilroy', Arial, sans-serif);
    font-size: 30px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.045em;
    color: #252529;
}

.lq-subtitle {
    margin: 0 0 27px;

    font-size: 17px;
    line-height: 1.35;
    font-weight: 400;
    color: #909090;
}

.lq-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lq-field {
    width: 100%;
}

.lq-label {
    display: block;
    margin-bottom: 10px;

    font-size: 17px;
    line-height: 1.25;
    font-weight: 700;
    color: #222222;
}

.lq-small-label {
    display: block;
    margin-bottom: 8px;

    font-size: 14px;
    line-height: 1.2;
    font-weight: 500;
    color: #222222;
}

.lq-error {
    margin-top: 6px;

    font-size: 13px;
    line-height: 1.25;
    color: #ff2626;
}

.lq-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lq-options--chips {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.lq-option {
    position: relative;

    width: 100%;
    min-height: 48px;
    padding: 0 48px 0 16px;

    display: flex;
    align-items: center;

    color: #222222;
    background: #f1f0ef;
    border: 1px solid transparent;
    border-radius: 10px;

    cursor: pointer;
    user-select: none;

    transition:
        background 0.18s ease,
        border-color 0.18s ease;
}

.lq-option:hover {
    border-color: rgba(0, 107, 61, 0.4);
}

.lq-option.is-selected {
    background: #fbfff7;
    border-color: #00D348;
}

.lq-options--chips .lq-option {
    width: auto;
    min-height: 48px;
    padding: 0 17px 0 40px;
}

.lq-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lq-option__text {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 500;
    color: #222222;
}

.lq-option__circle {
    position: absolute;
    top: 50%;
    right: 16px;

    width: 20px;
    height: 20px;

    border: 2px solid #bdbdbb;
    border-radius: 50%;

    transform: translateY(-50%);

    transition:
        background 0.18s ease,
        border-color 0.18s ease;
}

.lq-options--chips .lq-option__circle {
    left: 14px;
    right: auto;
}

.lq-option.is-selected .lq-option__circle {
    background: #006B3D;
    border-color: #006B3D;
}

.lq-option.is-selected .lq-option__circle::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 4px;

    width: 7px;
    height: 4px;

    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;

    transform: rotate(-45deg);
}

.lq-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.lq-input {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;

    font-size: 16px;
    line-height: 1.2;
    font-weight: 400;
    color: #222222;

    background: #f1f0ef;
    border: 1px solid transparent;
    border-radius: 10px;

    outline: none;

    transition:
        background 0.18s ease,
        border-color 0.18s ease;
}

.lq-input::placeholder {
    color: #9a9a9a;
}

.lq-input:focus {
    background: #ffffff;
    border-color: #006B3D;
}

.lq-field.is-error > .lq-input,
.lq-field.is-error .lq-contact-box {
    border-color: #ff2626;
}

.lq-contact-box {
    padding: 18px 16px 16px;

    border: 1px solid #dedede;
    border-radius: 16px;
}

.lq-contact-box__title {
    margin-bottom: 6px;

    font-size: 17px;
    line-height: 1.2;
    font-weight: 700;
    color: #222222;
}

.lq-contact-box__text {
    margin-bottom: 14px;

    font-size: 14px;
    line-height: 1.3;
    color: #8d8d8d;
}

.lq-inner-field {
    margin-bottom: 14px;
}

.lq-inner-field:last-child {
    margin-bottom: 0;
}

.lq-info {
    margin-top: 16px;
    padding: 14px 16px;

    display: flex;
    flex-direction: column;
    gap: 10px;

    border: 1px solid #dedede;
    border-radius: 10px;
}

.lq-info__item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: start;

    font-size: 15px;
    line-height: 1.28;
    color: #222222;
}

.lq-info__icon {
    width: 22px;
    height: 22px;
    color: #006B3D;
}

.lq-actions {
    margin-top: 24px;
}

.lq-button {
    width: 100%;
    min-height: 44px;
    padding: 0 24px;
    gap: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
    line-height: 1;
    font-weight: 600;
    color: #020704;

    background: #00D348;
    border: 0;
    border-radius: 10px;

    cursor: pointer;

    transition:
        background 0.18s ease,
        opacity 0.18s ease,
        transform 0.18s ease;
}

.lq-textarea {
    min-height: 130px;
    padding: 14px 16px;
    line-height: 1.4;
    resize: vertical;
}

.lq-button:hover {
    background: #10E858;
}

.lq-button:active {
    transform: translateY(1px);
}

.lq-status {
    margin-top: 14px;
    font-size: 14px;
    color: #ff2626;
}

.lq-success {
    padding: 8px 0 4px;
}

.lq-success__icon {
    width: 64px;
    height: 64px;
    margin-bottom: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #020704;
    background: #00D348;
    border-radius: 50%;
}

.lq-success__title {
    margin: 0 0 10px;

    font-size: 29px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.045em;
    color: #252529;
}

.lq-success__text {
    max-width: 410px;
    margin: 0 0 26px;

    font-size: 17px;
    line-height: 1.35;
    color: #8d8d8d;
}

.lq-success__list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lq-success__item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
    align-items: center;

    font-size: 16px;
    line-height: 1.25;
    color: #222222;
}

.lead-quiz[dir="rtl"] .lq-option {
    padding: 0 16px 0 48px;
}

.lead-quiz[dir="rtl"] .lq-option__circle {
    right: auto;
    left: 16px;
}

.lead-quiz[dir="rtl"] .lq-options--chips .lq-option {
    padding: 0 40px 0 17px;
}

.lead-quiz[dir="rtl"] .lq-options--chips .lq-option__circle {
    left: auto;
    right: 14px;
}

@media (max-width: 480px) {
    .lq-title {
        font-size: 28px;
    }

    .lq-subtitle {
        font-size: 16px;
    }

    .lq-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .lq-options--chips {
        gap: 8px;
    }

    .lq-option__text,
    .lq-input {
        font-size: 15px;
    }
}
.lq-start {
    width: 100%;
}

.lq-start-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lq-start-option {
    width: 100%;
    min-height: 58px;
    padding: 12px 16px;

    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 18px;
    gap: 12px;
    align-items: center;

    text-align: start;

    color: #222222;
    background: #f1f0ef;
    border: 1px solid transparent;
    border-radius: 8px;

    cursor: pointer;

    transition:
        background 0.18s ease,
        border-color 0.18s ease;
}

.lq-start-option:hover {
    background: #f5f8f5;
    border-color: #00562f;
}

.lq-start-option__icon {
    width: 24px;
    height: 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #00562f;
}

.lq-start-option__text {
    min-width: 0;

    font-size: 16px;
    line-height: 1.2;
    font-weight: 500;
    color: #222222;
}

/* ==========================================================================
   Quiz step layout
========================================================================== */

.lq-contact-person,
.lq-contact-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.lq-contact-person--company,
.lq-contact-methods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lq-contact-methods .lq-inner-field {
    min-width: 0;
    margin: 0;
}

.lq-footer {
    margin-top: 20px;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.lq-footer__info {
    min-width: 0;
    margin-right: auto;

    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lq-footer__info-item {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 6px;
    align-items: start;

    font-size: 10px;
    line-height: 1.35;
    color: #353535;
}

.lq-footer__info-item svg {
    color: #00562f;
}

.lq-back-button {
    min-height: 38px;
    padding: 8px 14px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    flex-shrink: 0;

    font-size: 13px;
    line-height: 1;
    color: #252525;

    background: #ffffff;
    border: 1px solid #d2d2d2;
    border-radius: 9px;
}

.lq-back-button:hover {
    background: #f5f7f5;
    border-color: #00562f;
}

/* Сегментированный прогресс */
.lq-progress.lq-progress--segments {
    height: 4px;

    display: flex;
    gap: 6px;

    overflow: visible;
    background: transparent;
    border-radius: 0;
}

.lq-progress__segment {
    height: 100%;
    flex: 1 1 0;

    background: #dedede;
    border-radius: 10px;
}

.lq-progress__segment.is-complete {
    background: #00562f;
}

.lq-progress__segment.is-current {
    background: #00d348;
}

/* ==========================================================================
   Inline quiz — white window inside the section
========================================================================== */

.lq-widget {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 24px;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    font-family: var(--font-main);
    color: #252525;

    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(35, 43, 59, 0.04);
}

/* Верхняя Back во встроенном экземпляре больше не используется */
.lq-widget__back {
    display: none;
}

.lq-widget > .js-lead-quiz-mount {
    flex: 1 1 auto;
    min-height: 0;

    display: flex;
    flex-direction: column;
}

.lq-widget .lq-start {
    flex: 1 1 auto;
    min-height: 0;

    display: flex;
    flex-direction: column;
}

.lq-widget .lq-form {
    flex: 1 1 auto;
    min-height: 0;

    display: flex;
    flex-direction: column;
}

.lq-widget .lq-step.is-active {
    flex: 1 1 auto;
    min-height: 0;

    display: flex;
    flex-direction: column;
}

.lq-widget .lq-step__header {
    flex-shrink: 0;
}

.lq-widget .lq-step__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 4px 4px 0;

    overflow-y: auto;
    overscroll-behavior: contain;

    scrollbar-width: thin;
    scrollbar-color: #bcc8c0 transparent;
}

.lq-widget .lq-step__meta {
    margin: 0 0 10px;

    font-size: 12px;
    line-height: 1.2;
    color: #858585;
}

.lq-widget .lq-progress {
    margin-bottom: 20px;
}

.lq-widget .lq-title {
    margin: 0 0 8px;

    font-size: 25px;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.lq-widget .lq-subtitle {
    margin: 0 0 20px;

    font-size: 13px;
    line-height: 1.4;
    color: #969696;
}

.lq-widget .lq-fields {
    gap: 14px;
}

.lq-widget .lq-small-label {
    margin-bottom: 6px;

    font-size: 12px;
    line-height: 1.2;
}

.lq-widget .lq-input {
    min-height: 40px;
    padding: 0 12px;

    font-size: 13px;
    border-radius: 9px;
}

.lq-widget .lq-textarea {
    min-height: 110px;
    padding: 12px;
}

.lq-widget .lq-contact-box {
    padding: 14px 12px;

    border-color: #e5e5e5;
    border-radius: 14px;
}

.lq-widget .lq-contact-box__title {
    margin-bottom: 5px;

    font-size: 13px;
    font-weight: 600;
}

.lq-widget .lq-contact-box__text {
    margin-bottom: 12px;

    font-size: 11px;
    line-height: 1.35;
}

.lq-widget .lq-start-option {
    min-height: 58px;
}

.lq-widget .lq-start-option__text {
    font-size: 14px;
    line-height: 1.35;
    font-weight: 400;
}

.lq-widget .lq-start > .lq-actions {
    margin-top: auto;
    padding-top: 24px;

    display: flex;
    justify-content: flex-end;
}

.lq-widget .lq-footer {
    flex-shrink: 0;
    margin-top: 16px;
    gap: 12px;
}

.lq-widget .lq-button {
    width: auto;
    min-width: 100px;
    min-height: 38px;
    padding: 9px 16px;

    flex-shrink: 0;

    font-size: 13px;
    border-radius: 9px;
}

.lq-widget .lq-status {
    flex-shrink: 0;
    margin-top: 8px;

    font-size: 11px;
    line-height: 1.3;
}

/* RTL */
.lq-widget[dir="rtl"] .lq-option {
    padding: 0 16px 0 48px;
}

.lq-widget[dir="rtl"] .lq-option__circle {
    right: auto;
    left: 16px;
}

.lq-widget[dir="rtl"] .lq-options--chips .lq-option {
    padding: 0 40px 0 17px;
}

.lq-widget[dir="rtl"] .lq-options--chips .lq-option__circle {
    left: auto;
    right: 14px;
}

.lq-widget[dir="rtl"] .lq-footer__info {
    margin-right: 0;
    margin-left: auto;
}

.lq-widget[dir="rtl"] .lq-button svg,
.lq-widget[dir="rtl"] .lq-back-button svg,
.lead-quiz[dir="rtl"] .lq-button svg {
    transform: scaleX(-1);
}

/* Небольшие десктопы */
@media (min-width: 768px) and (max-width: 1100px) {
    .lq-widget {
        padding: 20px;
    }

    .lq-widget .lq-footer {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
    }

    .lq-widget .lq-footer__info {
        grid-column: 1 / -1;
        grid-row: 1;
        margin: 0;
    }

    .lq-widget .lq-footer > .lq-button {
        justify-self: end;
    }
}

/* Модальный квиз: компактные ряды на узкой ширине */
.lead-quiz .lq-contact-person,
.lead-quiz .lq-contact-methods {
    grid-template-columns: minmax(0, 1fr);
}

.lead-quiz .lq-footer {
    flex-wrap: wrap;
}

.lead-quiz .lq-footer__info {
    flex: 1 1 100%;
    margin: 0;
}

/* Мобильное окно: одинаковая высота на всех шагах */
@media (max-width: 767px) {
    .lq-widget {
        height: 580px;
        padding: 22px 16px;
        border-radius: 12px;
    }

    .lq-widget .lq-title {
        font-size: 23px;
    }

    .lq-widget .lq-subtitle {
        font-size: 13px;
    }

    .lq-widget .lq-contact-person,
    .lq-widget .lq-contact-methods,
    .lq-widget .lq-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .lq-widget .lq-input {
        min-height: 42px;
        font-size: 14px;
    }

    .lq-widget .lq-footer {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
    }

    .lq-widget .lq-footer__info {
        grid-column: 1 / -1;
        grid-row: 1;
        margin: 0;
    }

    .lq-widget .lq-footer > .lq-button {
        justify-self: end;
    }

    .lq-widget .lq-start-option {
        padding: 12px;
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lq-progress__bar,
    .lq-start-option,
    .lq-option,
    .lq-input,
    .lq-button {
        transition: none;
    }
}


.lead-quiz[dir="rtl"] .lq-start-option {
    text-align: right;
}

.lead-quiz[dir="rtl"] {
    direction: rtl;
}
/* Messenger selection */

.lq-email-field {
    margin-bottom: 16px;
}

.lq-messenger-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.lq-messenger-choice {
    display: flex;
    align-items: center;
    gap: 10px;

    min-height: 46px;
    padding: 10px 14px;

    border: 1px solid #dedede;
    border-radius: 10px;
    background: #f1f0ef;

    cursor: pointer;
}

.lq-messenger-choice.is-selected {
    border-color: #00d348;
    background: #f8fff8;
}

.lq-messenger-choice input {
    position: static;
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 18px;

    opacity: 1;
    pointer-events: auto;
    accent-color: #006b3d;
}

.lq-messenger-choice span {
    font-size: 14px;
    line-height: 1.3;
}

.lq-messenger-choice:focus-within {
    outline: 2px solid #006b3d;
    outline-offset: 2px;
}

.lq-messenger-panel {
    margin-top: 14px;
}

.lq-messenger-panel[hidden] {
    display: none !important;
}

@media (max-width: 360px) {
    .lq-messenger-choices {
        grid-template-columns: minmax(0, 1fr);
    }
}