/* Окна кабинета и входа: профиль, касса, баланс, история, настройки, вход и регистрация, окно акции. */

/* ---------- каркас небольших окон ---------- */

.modal--small .modal__box { max-width: 400px; padding: 24px 20px; }
.modal--small .modal__head { margin: -24px -20px 16px; padding: 24px 20px 8px; }
.modal__head--back { flex-wrap: wrap; row-gap: 4px; }
.modal__head--back .modal__title { flex-basis: 100%; order: 3; }
.modal__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    color: var(--accent-hover);
    font-size: 14px;
    font-weight: 600;
}
.modal__back .icon { width: 20px; height: 20px; }
.modal__back:hover { color: #d48cff; }
.modal__text { margin-bottom: 16px; font-size: 14px; line-height: 20px; }
.modal__box--tall { min-height: min(640px, calc(100vh - 96px)); }

.stack { display: flex; flex-direction: column; gap: 8px; }

/* Светлые окна (касса, история платежей): те же блоки на белом фоне. */
.modal--light .modal__box {
    --panel: #fff;
    --panel-2: #fff;
    --surface: #ececf1;
    --surface-hover: #e1e1e8;
    --line: rgba(0, 0, 0, .08);
    --text: #16121c;
    --muted: #6f6a78;
    color: var(--text);
}
.modal--light .modal__close:hover { background: var(--surface); }
.modal--light .select__list { box-shadow: 0 16px 40px rgba(20, 10, 30, .18); }

.tabs--light .tabs__item:hover { background: rgba(0, 0, 0, .04); }
.tabs--light .tabs__item.is-active { background: #fff; box-shadow: 0 2px 8px rgba(20, 10, 30, .12); }
.tabs--accent .tabs__item.is-active { background: var(--accent); color: #fff; }
.tabs .icon { width: 20px; height: 20px; }
.tabs + .tab-pane, .tabs + [data-tab-pane], [data-tabs] > .tabs { margin-bottom: 16px; }
.tab-pane { display: flex; flex-direction: column; gap: 12px; margin-top: 0; }
.tab-pane[hidden] { display: none; }

/* ---------- вход и регистрация ---------- */

.auth__forgot { align-self: flex-end; margin: -4px 0 4px; }
.auth__or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 12px;
    color: var(--muted);
    font-size: 14px;
}
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth__socials { display: flex; justify-content: center; gap: 8px; }
.auth__social { width: 44px; height: 44px; border-radius: var(--r); transition: transform .15s, filter .2s; }
.auth__social .icon { width: 44px; height: 44px; }
.auth__social:hover { filter: brightness(1.1); transform: translateY(-1px); }
.auth__switch { margin-top: 20px; color: var(--muted); font-size: 14px; line-height: 20px; text-align: center; }

.modal--small .modal__box--register { padding-top: 0; }
.modal__box--register .modal__head { position: static; margin-top: 0; padding-top: 16px; }
.reg-banner {
    position: relative;
    display: flex;
    align-items: center;
    height: 88px;
    margin: 0 -20px;
    padding: 0 20px;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    background: linear-gradient(100deg, #6c2bd9, #b633fe);
    overflow: hidden;
}
.reg-banner b { position: relative; z-index: 1; font-family: var(--font-head); font-size: 20px; font-weight: 800; line-height: 24px; }
.reg-banner img { position: absolute; right: 48px; bottom: -14px; width: 132px; height: auto; }

/* ---------- профиль ---------- */

.user-card { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.avatar--l { width: 40px; height: 40px; }
.user-card__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.user-card__text b { overflow: hidden; font-size: 15px; font-weight: 600; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; }
.user-card__text small { color: var(--muted); font-size: 12px; line-height: 16px; }

.sum { display: flex; flex-direction: column; margin-bottom: 16px; }
.sum__label { color: var(--muted); font-size: 12px; line-height: 16px; }
.sum__value { font-family: var(--font-head); font-size: 32px; font-weight: 700; line-height: 40px; }

.profile-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 20px; }

.menu-list { overflow: hidden; border-radius: var(--r-m); background: var(--surface); }
.menu-list + .menu-list { margin-top: 12px; }
.menu-list__item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    transition: background-color .2s;
}
.menu-list__item + .menu-list__item { border-top: 1px solid var(--line); }
.menu-list__item:hover { background: var(--surface); }
.menu-list__item > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.menu-list__item b { font-size: 15px; font-weight: 600; line-height: 20px; }
.menu-list__item small { color: var(--muted); font-size: 12px; line-height: 16px; }
.menu-list__icon-wrap { position: relative; display: flex; }
.menu-list__icon { width: 24px; height: 24px; color: var(--muted); }
.dot--red { top: -2px; right: -2px; background: #ff5f7e; }

/* ---------- пополнение ---------- */

.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    height: 80px;
    padding: 12px;
    border-radius: var(--r-m);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: background-color .2s, transform .1s;
}
.pay-tile:hover { background: var(--surface-hover); }
.pay-tile:active { transform: scale(.98); }
.pay-tile img { width: auto; height: 32px; }
[data-step="methods"] { display: flex; flex-direction: column; gap: 12px; }

.pay-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pay-head__method { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pay-head__method img { width: auto; height: 28px; }

.quick-sums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick-sums__item {
    height: 36px;
    border-radius: var(--r-s);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .2s;
}
.quick-sums__item:hover { background: var(--surface-hover); }

.crypto-min { color: var(--text); font-size: 14px; line-height: 20px; text-align: center; }
.crypto-address { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--r-m); background: var(--surface); }
.crypto-address__qr { flex: none; width: 104px; height: 104px; padding: 4px; border-radius: var(--r-s); background: #fff; }
.crypto-address__info { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.crypto-address__info b { font-size: 15px; }
.crypto-address__info code { max-width: 100%; font: 600 13px/18px var(--font); word-break: break-all; }
.crypto-address__info small { color: var(--muted); font-size: 11px; line-height: 14px; }

.crypto-bonus-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.crypto-bonus {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 120px;
    padding: 14px 140px 14px 14px;
    border: 2px solid var(--green);
    border-radius: var(--r-m);
    background: linear-gradient(110deg, #0a7a25, #2cc04b);
    color: #fff;
    overflow: hidden;
    transition: opacity .2s, border-color .2s;
}
.crypto-bonus.is-off { border-color: transparent; opacity: .5; }
.crypto-bonus__img { position: absolute; right: -6px; bottom: -20px; width: 150px; height: auto; }
.crypto-bonus__title { font-size: 14px; font-weight: 700; line-height: 18px; }
.crypto-bonus__text { font-size: 12px; line-height: 16px; }
.crypto-bonus__row { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.crypto-bonus__info { display: grid; place-items: center; color: #fff; }
.crypto-bonus__info .icon { width: 16px; height: 16px; }
.crypto-bonus__check {
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--green);
    color: #04361a;
}
.crypto-bonus__check .icon { width: 12px; height: 12px; }
.crypto-bonus.is-off .crypto-bonus__check { display: none; }

/* ---------- баланс ---------- */

.points {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--r-m);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
}
.points img { width: 24px; height: 24px; }
.points__name { flex: 1; }
.points__info { display: grid; place-items: center; color: var(--muted); }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 12px; }
.list-head__title { font-family: var(--font-head); font-size: 22px; font-weight: 700; line-height: 28px; }
.list-head__link { display: inline-flex; align-items: center; gap: 4px; }

.coins { overflow: hidden; border-radius: var(--r-m); background: var(--surface); }
.coins__item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.coins__item + .coins__item { border-top: 1px solid var(--line); }
.coins__item img { width: 32px; height: 32px; }
.coins__name { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.coins__name b { font-size: 14px; font-weight: 600; line-height: 18px; }
.coins__name small { color: var(--muted); font-size: 12px; line-height: 16px; }
.coins__sum { font-size: 14px; font-weight: 600; }

/* ---------- настройки ---------- */

.list-title { margin: 16px 0 8px; color: var(--muted); font-size: 14px; font-weight: 400; line-height: 20px; }
.list-title:first-of-type { margin-top: 0; }
.list { overflow: hidden; border-radius: var(--r-m); background: var(--surface); }
.list + .list { margin-top: 12px; }
.list__row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}
.list__row + .list__row { border-top: 1px solid var(--line); }
button.list__row { transition: background-color .2s; }
button.list__row:hover { background: var(--surface); }
.list__row > span:first-child { flex: 1; }
.list__row > span:first-child:has(small) { display: flex; flex-direction: column; }
.list__row small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 16px; }
.list__row--muted { color: var(--muted); }
.list__value { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__arrow { color: var(--muted); }
.list__alert { color: #ff5f7e; }
.list-note { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 16px; }
.list-note--error { color: #ff5f7e; }
.settings-logout { margin-top: 20px; color: #ff5f7e; }

/* ---------- окно акции ---------- */

.modal--promo .modal__box--promo { max-width: 900px; padding: 0; overflow: hidden; }
.promo-modal { min-height: 200px; }
.promo-modal.is-loading { display: grid; place-items: center; min-height: 420px; }
.promo-modal.is-loading::after {
    content: "";
    width: 32px;
    height: 32px;
    border: 3px solid var(--surface-hover);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.promo-modal__top { position: relative; }
.promo-modal__img { width: 100%; height: auto; aspect-ratio: 897 / 378; object-fit: cover; background: var(--panel-2); }
.promo-modal__actions { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; }
.promo-modal__icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(20, 10, 30, .55);
    color: #fff;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background-color .2s;
}
.promo-modal__icon:hover { background: rgba(20, 10, 30, .8); }
.promo-modal__icon .icon { width: 18px; height: 18px; }
.promo-modal__content { padding: 32px 72px 48px; }
.promo-modal__title { text-wrap: balance; font-family: var(--font-head); font-size: 40px; font-weight: 700; line-height: 46px; }
.promo-modal__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0; }
.promo-modal__ends {
    margin-left: auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    line-height: 16px;
}
.promo-modal__ends b { margin-left: 4px; color: var(--text); }
.promo-modal__lead { margin-bottom: 16px; font-size: 16px; line-height: 24px; }
.promo-modal__text { color: rgba(230, 230, 230, .85); font-size: 15px; line-height: 22px; }
.promo-modal__text p + p, .promo-modal__text p + .table, .promo-modal__text .table + p, .promo-modal__text ul + p, .promo-modal__text p + ul { margin-top: 12px; }

.table { max-width: 100%; overflow-x: auto; border-radius: var(--r); background: var(--surface); }
.table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.table th, .table td { padding: 8px 12px; text-align: left; white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; }
.table tr + tr td, .table tbody tr:first-child td { border-top: 1px solid var(--line); }

/* ---------- телефон ---------- */

@media (max-width: 1023px) {
    .modal--small .modal__box { max-width: none; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
    .modal--small .modal__head { margin: -24px -16px 16px; padding: 24px 16px 8px; }
    .modal--small .modal__box--register { padding-top: 0; }
    .modal__box--register .modal__head { margin-top: 0; padding-top: 16px; }
    .reg-banner { margin: 0 -16px; padding: 0 16px; }
    .modal__box--tall { min-height: 85vh; }
    .modal--promo .modal__box--promo { max-width: none; }
    .promo-modal__content { padding: 20px 16px calc(32px + env(safe-area-inset-bottom)); }
    .promo-modal__title { font-size: 26px; line-height: 32px; }
    .promo-modal__meta { margin: 16px 0; }
    .promo-modal__meta .btn { flex: 1; }
    .promo-modal__ends { margin-left: 0; }
    .crypto-bonus { padding-right: 112px; }
    .crypto-bonus__img { width: 120px; }
}
