/* ==========================================================================
   Квиз GL Vision — попап. Все селекторы под .glq, чтобы не задеть тему Aspro.
   ========================================================================== */

.glq {
    --glq-blue: #1f3969;
    --glq-blue-dark: #16294d;
    --glq-yellow: #f5b400;
    --glq-red: #e31e24;
    --glq-ink: #171b1f;
    --glq-text: #31383f;
    --glq-muted: #687078;
    --glq-line: #e2e6e9;
    --glq-bg: #f5f7f8;

    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--glq-text);
    line-height: 1.55;
}

.glq.is-open {
    display: block;
}

.glq *,
.glq *::before,
.glq *::after {
    box-sizing: border-box;
}

.glq__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 17, .62);
}

.glq__win {
    position: relative;
    margin: 4vh auto;
    width: min(1040px, calc(100% - 32px));
    max-height: 92vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(10, 20, 40, .35);
}

/* ---------------------------------------------------------------- шапка */

.glq__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 64px 16px 28px;
    border-bottom: 1px solid var(--glq-line);
    background: #fff;
}

.glq__brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .16em;
    color: var(--glq-blue);
    text-transform: uppercase;
}

.glq__brand-mark {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--glq-yellow);
    color: var(--glq-ink);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
}

.glq__counter {
    font-size: 12.5px;
    color: var(--glq-muted);
    white-space: nowrap;
}

.glq__progress {
    height: 3px;
    background: #eef1f4;
}

.glq__progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--glq-yellow);
    transition: width .35s ease;
}

.glq__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f2f4f7;
    color: #4a5563;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
    z-index: 2;
}

.glq__close:hover {
    background: var(--glq-red);
    color: #fff;
}

.glq__body {
    padding: 30px 28px 28px;
}

/* ------------------------------------------------------------- загрузка */

.glq__loader,
.glq__error {
    padding: 60px 10px;
    text-align: center;
    font-size: 15px;
    color: var(--glq-muted);
}

.glq__error {
    color: var(--glq-red);
}

/* -------------------------------------------------------------- кнопки */

.glq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.glq-btn--primary {
    background: var(--glq-blue);
    color: #fff;
}

.glq-btn--primary:hover:not([disabled]) {
    background: var(--glq-blue-dark);
    color: #fff;
}

.glq-btn--ghost {
    background: #fff;
    border-color: #d7dee8;
    color: var(--glq-blue);
}

.glq-btn--ghost:hover {
    border-color: var(--glq-blue);
}

.glq-btn--link {
    padding: 8px 6px;
    color: var(--glq-muted);
    font-weight: 500;
    text-decoration: underline !important;
}

.glq-btn[disabled] {
    opacity: .45;
    cursor: default;
}

/* ------------------------------------------------------------ стартовый */

.glq-start__kicker {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    background: #eef2f8;
    color: var(--glq-blue);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.glq-start__title {
    margin: 16px 0 12px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.18;
    letter-spacing: -.02em;
    color: var(--glq-ink);
    font-weight: 800;
}

.glq-start__text {
    margin: 0 0 18px;
    max-width: 760px;
    font-size: 15.5px;
    color: #4a5563;
}

.glq-start__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 0 0 22px;
    font-size: 13px;
    color: var(--glq-muted);
}

.glq-start__meta b {
    color: var(--glq-ink);
}

.glq-start__media {
    margin: 0 0 22px;
    border-radius: 14px;
    overflow: hidden;
}

.glq-start__note {
    margin: 14px 0 0;
    font-size: 12.5px;
    color: #8b95a1;
}

/* --------------------------------------------------------------- вопрос */

.glq-q__title {
    margin: 0 0 8px;
    font-size: clamp(20px, 2.4vw, 27px);
    line-height: 1.25;
    letter-spacing: -.02em;
    color: var(--glq-ink);
    font-weight: 800;
}

.glq-q__dir {
    display: inline-block;
    margin: 0 0 10px;
    padding: 4px 11px;
    border-radius: 20px;
    background: #eef2f8;
    color: #3a4a63;
    font-size: 12.5px;
}

.glq-q__dir b {
    color: var(--glq-blue);
}

.glq-q__hint {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--glq-muted);
}

.glq-opts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
    gap: 12px;
}

.glq-opt {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1.5px solid var(--glq-line);
    border-radius: 12px;
    background: #fff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.glq-opt:hover {
    border-color: #b9c4dd;
    box-shadow: 0 6px 18px rgba(31, 57, 105, .08);
}

.glq-opt.is-selected {
    border-color: var(--glq-blue);
    background: #f7f9ff;
    box-shadow: 0 0 0 3px rgba(31, 57, 105, .1);
}

.glq-opt__media {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(135deg, #eef2f8, #e2e9f3);
    color: #a6b2c2;
}

.glq-opt__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.glq-opt__media i {
    font-style: normal;
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #aab5c4;
}

.glq-opt__title {
    padding: 0 4px 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #20252a;
}

/* настоящий radio / checkbox перед текстом варианта */
.glq-opt__input {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    width: 22px;
    height: 22px;
    margin: 0;
    flex: 0 0 22px;
    border: 2px solid #c3cddb;
    border-radius: 50%;
    background-color: #fff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 9px 9px;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    transition: background-color .16s ease, border-color .16s ease;
}

/* поверх картинки добавляем белую окантовку, чтобы кружок читался */
.glq-opts:not(.glq-opts--list) .glq-opt__input {
    box-shadow: 0 0 0 3px #fff;
}

.glq-opt__input[type="checkbox"] {
    border-radius: 5px;
    background-size: 12px 10px;
}

.glq-opt:hover .glq-opt__input {
    border-color: #9fb0c8;
}

.glq-opt.is-selected .glq-opt__input {
    border-color: var(--glq-blue);
    background-color: var(--glq-blue);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Ccircle cx='4' cy='4' r='2.4' fill='%23fff'/%3E%3C/svg%3E");
}

.glq-opt.is-selected .glq-opt__input[type="checkbox"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5.2 4.2 8.4 11 1.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* карточка без картинки (все вопросы, кроме первого шага) */
.glq-opt--text {
    min-height: 74px;
    justify-content: center;
    padding: 15px 14px;
}

.glq-opt--text .glq-opt__title {
    padding: 0 20px 0 2px;
    font-size: 14.5px;
}

/* шаги 2+: один вариант — одна строка */
.glq-opts--list {
    grid-template-columns: 1fr;
    gap: 8px;
}

.glq-opts--list .glq-opt,
.glq-opts--list .glq-opt--text {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 0;
    padding: 13px 16px;
}

/* радио/чекбокс по центру первой строки текста */
.glq-opts--list .glq-opt__input {
    position: static;
    margin-top: -3px;
}

.glq-opts--list .glq-opt__title,
.glq-opts--list .glq-opt--text .glq-opt__title {
    padding: 0;
    font-size: 14.5px;
    line-height: 1.35;
}

.glq-text {
    width: 100%;
    min-height: 92px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1.5px solid var(--glq-line);
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    color: var(--glq-text);
    resize: vertical;
}

.glq-text:focus {
    outline: none;
    border-color: var(--glq-blue);
}

.glq-actions {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
}

.glq-actions__right {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-left: auto;
}

/* ------------------------------------------------------------- результат */

.glq-res__list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.glq-card {
    display: flex;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid var(--glq-line);
    border-radius: 14px;
    background: #fbfcfd;
}

.glq-card__body {
    flex: 1 1 auto;
    min-width: 0;
}

.glq-card__media {
    flex: 0 0 200px;
    aspect-ratio: 16 / 10;
}

.glq-card__dir {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--glq-muted);
}

.glq-card__title {
    margin: 4px 0 10px;
    font-size: 19px;
    line-height: 1.3;
    color: var(--glq-ink);
    font-weight: 800;
}

.glq-dl {
    margin: 0;
    display: grid;
    gap: 4px;
}

.glq-dl dt {
    margin-top: 8px;
    font-size: 11.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #9aa7b8;
}

.glq-dl dd {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--glq-text);
}

.glq-dl dd.glq-dl__effect {
    padding: 8px 10px;
    border-radius: 8px;
    background: #eef8f1;
    color: #1a5c33;
}

.glq-chip-row {
    margin-top: 10px;
    font-size: 13px;
}

.glq-chip-row b {
    display: block;
    margin-bottom: 4px;
    font-size: 11.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #9aa7b8;
}

.glq-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.glq-chip {
    padding: 3px 10px;
    border-radius: 20px;
    background: #eef2f8;
    color: #3a4a63;
    font-size: 12.5px;
}

/* ----------------------------------------------------------------- форма */

.glq-form {
    max-width: 640px;
}

.glq-field {
    display: block;
    margin-bottom: 14px;
}

.glq-field > span {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--glq-muted);
}

.glq-field input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--glq-line);
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    color: var(--glq-text);
}

.glq-field input:focus {
    outline: none;
    border-color: var(--glq-blue);
}

.glq-field input.is-error {
    border-color: var(--glq-red);
}

.glq-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--glq-muted);
    cursor: pointer;
}

.glq-check input {
    margin: 2px 0 0;
    flex: 0 0 auto;
}

.glq-check a {
    color: var(--glq-blue);
    text-decoration: underline !important;
}

.glq-form__error {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--glq-red);
}

/* --------------------------------------------------------------- успех */

.glq-done {
    padding: 20px 0 10px;
    text-align: center;
}

.glq-done__icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #eef8f1;
    color: #1a5c33;
    font-size: 28px;
}

.glq-done__title {
    margin: 0 0 10px;
    font-size: 23px;
    line-height: 1.3;
    color: var(--glq-ink);
    font-weight: 800;
}

.glq-done__text {
    max-width: 620px;
    margin: 0 auto 20px;
    font-size: 15px;
    color: var(--glq-muted);
}

.glq-done__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* ------------------------------------------------------------ адаптив */

html.glq-lock,
html.glq-lock body {
    overflow: hidden;
}

@media (max-width: 760px) {
    .glq__win {
        width: 100%;
        height: 100%;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }

    .glq__head {
        padding: 14px 56px 14px 18px;
    }

    .glq__body {
        padding: 20px 18px 26px;
    }

    .glq__close {
        top: 10px;
        right: 10px;
    }

    .glq-opts {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .glq-opt__title {
        font-size: 13px;
    }

    .glq-card {
        flex-direction: column;
        gap: 12px;
    }

    .glq-card__media {
        flex: 0 0 auto;
        max-height: 180px;
    }

    .glq-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .glq-actions .glq-btn,
    .glq-actions__right {
        width: 100%;
    }

    .glq-actions__right {
        margin-left: 0;
    }
}

@media (max-width: 420px) {
    .glq-opts {
        grid-template-columns: 1fr;
    }
}
