/* Scope everything to .mquiz to avoid MODX site conflicts */
.mquiz {
    --bg: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --card: #ffffff;
    --cardLine: #e5e7eb;

    --blue: #006463;
    /* requested */
    --blueSoft: #e6f2f1;

    --green: #2f8083;
    /* requested (button bg) */
    --greenDark: #379497;
    /* requested (hover bg) */

    --shadow: 0 1px 0 rgba(17, 24, 39, .03);
    --radius: 10px;
    --radius2: 14px;

    --inputBg: #f3f4f6;

    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
}

/* Trigger button */
.mquiz__trigger {
    display: flex;
    align-items: center;
    gap: 14px;
    border: none;
    cursor: pointer;
    background: var(--green);
    color: #fff;
    padding: 16px 22px;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
    transition: transform .06s ease, background-color .15s ease;
    text-align: left;
}

.mquiz__trigger:hover {
    background: var(--greenDark);
}

.mquiz__trigger:active {
    transform: scale(.99);
}

.mquiz__triggerIcon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.mquiz__triggerIcon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.mquiz__triggerText {
    font-weight: 600;
    letter-spacing: .05em;
    line-height: 1.2;
    font-size: 20px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Modal shell */
.mquiz__modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

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

.mquiz__overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .55);
}

.mquiz__dialog {
    position: relative;
    max-width: 800px;
    width: min(800px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;

    background: var(--bg);
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);

    z-index: 1000000;
}

.mquiz__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: #111827;
    transition: transform .06s ease, opacity .15s ease;
    z-index: 2;
}

.mquiz__close:active {
    transform: scale(.98);
}

.mquiz__close svg {
    width: 18px;
    height: 18px;
}

.mquiz__topbar {
    padding: 16px 22px;
    color: var(--muted);
    font-size: 14px;
    border-bottom: 1px solid var(--line);
}

.mquiz__panel {
    padding: 18px 22px 22px;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mquiz__title {
    font-size: 25px;
    line-height: 1.15;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #000000;
    text-align: center;
}

.mquiz__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    margin-top: 6px;
}

.mquiz__option {
    position: relative;
    border: 1px solid var(--cardLine);
    background: var(--card);
    border-radius: 6px;
    padding: 16px 16px 16px 56px;
    cursor: pointer;
    user-select: none;
    box-shadow: var(--shadow);
    transition: border-color .15s ease, box-shadow .15s ease;
    min-height: 56px;
    display: flex;
    align-items: center;
    font-size: 17px;
    color: #111827;
}

.mquiz__option::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #cfd6df;
    background: #fff;
    box-sizing: border-box;
}

/* ВНУТРЕННЯЯ ТОЧКА */
.mquiz__option::after {
    content: "";
    position: absolute;
    left: 18px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    pointer-events: none;
}

.mquiz__option:hover {
    border-color: #d7dde6;
}

.mquiz__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mquiz__option[data-checked="true"] {
    border-color: rgba(0, 100, 99, .55);
    box-shadow: 0 0 0 2px rgba(0, 100, 99, .12);
}

.mquiz__option[data-checked="true"]::before {
    border-color: var(--blue);
}

.mquiz__option[data-checked="true"]::after {
    background:
        radial-gradient(circle at center,
            var(--blue) 0 4px,
            transparent 5px);
}

/* bottom nav */
.mquiz__bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
}

.mquiz__step {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.mquiz__dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.mquiz__dot {
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: #d1d5db;
}

.mquiz__dot.is-active {
    background: var(--blue);
}

.mquiz__nav {
    display: flex;
    gap: 14px;
    align-items: center;
}

.mquiz__btnCircle {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .06s ease, opacity .15s ease;
}

.mquiz__btnCircle:active {
    transform: scale(.98);
}

.mquiz__btnCircle:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.mquiz__btnPrimary {
    height: 44px;
    border-radius: 999px;
    padding: 0 18px;
    border: 1px solid rgba(0, 100, 99, .55);
    color: var(--blue);
    background: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: transform .06s ease, opacity .15s ease;
}

.mquiz__btnPrimary:active {
    transform: scale(.99);
}

.mquiz__btnPrimary:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.mquiz__icon {
    width: 18px;
    height: 18px;
    display: inline-block;
}

/* Final step */
.mquiz__final {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
    padding-top: 10px;
}

.mquiz__final h2 {
    font-size: 25px;
    margin: 0 0 10px;
    font-weight: 600;
    color: #000000;
}

.mquiz__final p {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.mquiz__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    padding: 0 10px;
}

.mquiz__field {
    position: relative;
}

.mquiz__field input {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 10px;
    background: var(--inputBg);
    padding: 0 16px 0 25px;
    font-size: 17px;
    outline: none;
    color: #111827;
}

.mquiz__field input::placeholder {
    color: #9ca3af;
}

.mquiz__ficon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: .55;
}

.mquiz__agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    font-size: 14px;
    color: var(--muted);
    padding: 2px 4px 10px;
}

.mquiz__agree input {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.mquiz__agree a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mquiz__btnGreen {
    height: 56px;
    border: none;
    border-radius: 10px;
    background: var(--green);
    color: #ffffff;
    font-weight: 500;
    font-size: 18px;
    cursor: pointer;
    transition: transform .06s ease, background-color .15s ease, opacity .15s ease;
}

.mquiz__btnGreen:hover {
    background: var(--greenDark);
}

.mquiz__btnGreen:active {
    transform: scale(.99);
}

.mquiz__btnGreen:disabled {
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 747px) {
    .mquiz__title {
        font-size: 22px;
        line-height: 1.3;
        text-align: center;
    }

    .mquiz__grid {
        grid-template-columns: 1fr;
    }

    .mquiz__dialog {
        margin: 18px auto;
    }

    .mquiz__triggerText {
        font-size: 16px;
    }

    .mquiz__final h2 {
        font-size: 22px;
        font-weight: 600;
        line-height: 1.3;
    }

    .mquiz__field input {
        font-size: 16px;
    }

    .mquiz__option {
        font-size: 16px;
    }
}

.mquiz__trigger {
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative;
    z-index: 5;
}

/* ===== FIX: Center modal & overlay above everything ===== */
.mquiz__modal {
    position: fixed !important;
    inset: 0 !important;
    display: none;
    z-index: 999999 !important;
}

.mquiz__modal.is-open {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    pointer-events: auto;
}

.mquiz__overlay {
    position: absolute !important;
    inset: 0 !important;
}

/* Иконки в круглых кнопках (назад/вперёд) */
.mquiz__btnCircle svg {
    width: 20px;
    height: 20px;
    display: block;
}

.mquiz__btnCircle svg path {
    stroke: currentColor !important;
}

/* чтобы иконка была видна */
.mquiz__btnCircle {
    color: #2f8f8b;
    /* можно убрать, если у тебя уже задан цвет */
}

/* Сообщение об успешной отправке */
.mquiz__success {
    text-align: center;
    padding: 48px 20px;
}

.mquiz__successTitle {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #000000;
}

.mquiz__successText {
    font-size: 16px;
    opacity: .8;
    margin: 0 0 24px;
    color: #000000;
}

.mquiz__successActions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.mquiz__btnGhost {
    border: 1px solid rgba(0, 0, 0, .15);
    background: transparent;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    color: #000000;
}

.mquiz__field.error input {
    border: 2px solid #ff3b3b !important;
    box-shadow: 0 0 0 2px rgba(255, 59, 59, 0.15);
}

.mquiz__agree.error {
    color: #ff3b3b;
}

.mquiz__agree.error a {
    color: #ff3b3b;
}

/*Пульсирующая кнопка*/
.mquiz__trigger {

    -webkit-animation-name: 'play_down';
    -moz-animation-name: 'play_up';
    animation-duration: 2.7s;
    animation-iteration-count: infinite;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.88);
}

@keyframes play_top {

    0% {
        box-shadow: 0 0 rgba(255, 255, 255, 0.88);
    }

    to {
        box-shadow: 0 0 0 20px rgba(45, 44, 44, 0);
    }
}

@keyframes play_down {

    0% {
        box-shadow: 0 0 rgba(255, 255, 255, 0.50);
    }

    to {
        box-shadow: 0 0 0 20px rgba(45, 44, 44, 0);
    }

}