/*
 * Mood — окно «адрес подтверждён».
 *
 * Показывается после перехода по ссылке из письма (mood-profile.js, параметр
 * email_verified). Раньше на её месте был тост: событие проходило незаметно и
 * никуда не вело. Здесь же игрок видит, что осталось одно действие до
 * приветственного предложения, и может перейти к пополнению сразу.
 *
 * На телефоне окно — нижний лист: до кнопки дотягивается большой палец, а
 * содержимое остаётся прокручиваемым на низких экранах.
 */

.mev {
    /*
     * Тёплый коралл бренда фиксируем внутри окна.
     *
     * Сайтовый --accent зависит от темы: в светлой он коралловый, в тёмной —
     * мятный, а --btn-primary-text под него почти чёрный. На заливке кнопки такая
     * подпись сливалась с фоном. Здесь заливка одна в обеих темах, и подпись на
     * ней всегда белая.
     */
    --mev-warm: #E2415C;
    --mev-warm-deep: #BE2B47;

    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal, 1200) + 30);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mev.hidden {
    display: none;
}

.mev__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(8, 10, 18, 0.62);
    cursor: pointer;
}

html[data-theme="light"] .mev__backdrop {
    background: rgba(16, 24, 40, 0.38);
}

.mev__dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 26px 24px 22px;
    border-radius: var(--radius-lg, 20px);
    background: var(--bg-elevated, #fff);
    box-shadow: 0 24px 60px rgba(8, 10, 18, 0.32);
    text-align: center;
    animation: mev-pop 0.24s ease-out both;
}

@keyframes mev-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.mev__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dim);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition, 0.18s ease), color var(--transition, 0.18s ease);
}

.mev__close:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* ------------------------------------------------------------
   Галочка
   ------------------------------------------------------------ */

.mev__check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    margin: 2px auto 14px;
    border-radius: 50%;
    background: var(--success-dim, rgba(52, 211, 153, 0.14));
    color: var(--success, #34D399);
    /* Ореол вместо рамки: на светлой и тёмной теме читается одинаково. */
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--success, #34D399) 8%, transparent);
}

.mev__check svg {
    width: 30px;
    height: 30px;
}

.mev__eyebrow {
    margin: 0 0 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--success-text, var(--success, #34D399));
}

.mev__title {
    margin: 0 0 8px;
    font-size: 1.32rem;
    font-weight: 800;
    line-height: 1.24;
    letter-spacing: -0.01em;
    color: var(--text);
}

.mev__lead {
    margin: 0 0 16px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.mev__lead strong {
    color: var(--text);
    font-weight: 600;
    /* Длинный адрес не должен растягивать окно. */
    overflow-wrap: anywhere;
}

/* ------------------------------------------------------------
   Карточка предложения
   ------------------------------------------------------------ */

/*
 * Предложение — тёплым градиентом бренда, а не зелёным.
 *
 * Галочка, шкала и «пройдено» уже зелёные: в одном цвете карточка предложения
 * сливалась с подтверждением и не читалась как отдельное действие.
 */
.mev__offer {
    padding: 16px 16px 14px;
    border-radius: var(--radius-md, 14px);
    background: color-mix(in srgb, var(--mev-warm) 7%, var(--surface-2));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mev-warm) 24%, transparent);
}

.mev__offer-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-pill, 999px);
    background: var(--mev-warm);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mev__offer-figures {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 0;
    font-size: 1.68rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
}

.mev__offer-plus {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dim);
}

.mev__offer-note {
    margin: 8px 0 0;
    font-size: 0.76rem;
    line-height: 1.45;
    color: var(--text-muted);
}

/* ------------------------------------------------------------
   Три шага: два позади, один остался
   ------------------------------------------------------------ */

.mev__progress {
    margin: 18px 0 0;
}

.mev__track {
    position: relative;
    height: 4px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}

.mev__track-fill {
    display: block;
    height: 100%;
    width: 66%;
    border-radius: 999px;
    /* От зелёного пройденного к тёплому цвету предложения — шкала «тянет» вперёд. */
    background: linear-gradient(90deg, var(--success, #34D399), var(--mev-warm));
}

.mev__steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.mev__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--text-dim);
}

.mev__step-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 0.62rem;
    font-weight: 700;
}

.mev__step.is-done .mev__step-dot {
    background: var(--success-dim, rgba(52, 211, 153, 0.14));
    color: var(--success-text, var(--success, #34D399));
}

.mev__step.is-next {
    color: var(--text);
    font-weight: 600;
}

.mev__step.is-next .mev__step-dot {
    background: var(--mev-warm);
    color: #fff;
}

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

.mev__actions {
    display: grid;
    gap: 8px;
    margin: 18px 0 0;
}

.mev__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: var(--radius-pill, 999px);
    background: linear-gradient(135deg, var(--mev-warm) 0%, var(--mev-warm-deep) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--mev-warm-deep) 28%, transparent);
    transition: filter var(--transition, 0.18s ease), transform var(--transition, 0.18s ease);
}

.mev__cta:hover {
    filter: brightness(1.06);
}

.mev__cta:active {
    transform: translateY(1px);
}

.mev__later {
    min-height: 40px;
    border: 0;
    border-radius: var(--radius-pill, 999px);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition, 0.18s ease), background var(--transition, 0.18s ease);
}

.mev__later:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* ------------------------------------------------------------
   Телефон: нижний лист
   ------------------------------------------------------------ */

@media (max-width: 700px) {
    .mev {
        align-items: flex-end;
        padding: 0;
    }

    .mev__dialog {
        max-width: none;
        /* dvh: адресная строка мобильного браузера не должна срезать кнопку. */
        max-height: min(92dvh, 92vh);
        padding: 22px 18px calc(16px + env(safe-area-inset-bottom, 0px));
        border-radius: var(--radius-lg, 20px) var(--radius-lg, 20px) 0 0;
        animation: mev-sheet-up 0.26s ease-out both;
    }

    .mev__title {
        font-size: 1.2rem;
    }

    .mev__offer-figures {
        font-size: 1.5rem;
    }

    .mev__step {
        font-size: 0.66rem;
    }

    .mev__cta {
        min-height: 50px;
    }
}

@keyframes mev-sheet-up {
    from { transform: translateY(100%); }
    to { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mev__dialog {
        animation: none;
    }
}
