/* ============================================
   DARK THEME — Click Change
   ============================================ */

:root {
    --dm-bg: #0f0f14;
    --dm-bg-2: #1a1a22;
    --dm-bg-3: #23232d;
    --dm-text: #f0f0f5;
    --dm-text-muted: #a0a0b0;
    --dm-text-dim: #8a8a99;
    --dm-border: #2a2a35;
    --dm-accent: #5b7bff;
    --dm-accent-bg: rgba(91, 123, 255, 0.15);
    --dm-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

html.dark body {
    background: var(--dm-bg);
    color: var(--dm-text);
}

html.dark .title,
html.dark .panel__title,
html.dark .exchange__title,
html.dark .advantages__title,
html.dark .rules__title,
html.dark .partners__title,
html.dark .application__title,
html.dark .verification__title,
html.dark .error__title,
html.dark .attention__title {
    color: var(--dm-text);
}

html.dark .exchange__subtitle,
html.dark .panel__subtitle,
html.dark .panel__text,
html.dark .panel__text_small,
html.dark .application__text,
html.dark .application__subtitle,
html.dark .application__payment-text,
html.dark .rules__text,
html.dark .partners__text,
html.dark .verification__text,
html.dark .attention__subtitle,
html.dark .error__subtitle,
html.dark .reviews__block-text,
html.dark .reviews__block-date {
    color: var(--dm-text-muted);
}

html.dark .panel {
    background: var(--dm-bg-2);
    border-color: var(--dm-border);
}

html.dark .reviews {
    background: var(--dm-bg-2);
}

html.dark .reviews__block {
    background: var(--dm-bg-3);
}

html.dark .advantages__block-img {
    background: var(--dm-accent-bg);
}

html.dark .advantages__block-title {
    color: var(--dm-text);
}

html.dark .advantages__block-subtitle {
    color: var(--dm-text-muted);
}

html.dark .header_background_white,
html.dark .footer {
    background: var(--dm-bg-2);
    border-top-color: var(--dm-border);
    box-shadow: var(--dm-shadow);
}

html.dark .nav__text {
    color: var(--dm-text-muted);
}

html.dark .nav__link,
html.dark .nav__lang-link_active {
    color: var(--dm-text);
}

html.dark .panel__link {
    color: var(--dm-text-muted)
}

html.dark .panel__link_active {
    color: var(--dm-text)
}

html.dark .nav__lang-link {
    color: var(--dm-text-dim);
}

html.dark .nav__link:hover,
html.dark .nav__lang-link:hover {
    color: var(--dm-accent);
}

html.dark .nav__link_active {
    color: var(--dm-accent);
}

html.dark .header__menu {
    background: var(--dm-bg-2);
    box-shadow: var(--dm-shadow);
}

html.dark .input {
    background: rgba(35, 35, 45, 0.7);
    color: var(--dm-text);
    border-color: var(--dm-border)
}

html.dark .input::placeholder {
    color: var(--dm-text-dim)
}

html.dark .input__text {
    color: var(--dm-text);
}

html.dark .select__header {
    background: var(--dm-bg-3);
    border-color: var(--dm-border);
    box-shadow: none;
}

html.dark .select__current {
    color: var(--dm-text);
}

html.dark .select__body {
    background: var(--dm-bg-3);
    border-color: var(--dm-border);
}

html.dark .select__item {
    background: var(--dm-bg-3);
    color: var(--dm-text);
}

html.dark .select__item:hover {
    background: var(--dm-bg-2);
}

html.dark .btn_border_gray {
    color: var(--dm-text-muted);
    border-color: var(--dm-border);
}

html.dark .btn_border_gray:hover {
    color: var(--dm-text);
    border-color: var(--dm-accent);
}

html.dark .btn_border_blue {
    background: var(--dm-bg-2);
}

html.dark .application__block {
    background: var(--dm-bg-2);
    border-color: var(--dm-border);
    box-shadow: var(--dm-shadow);
}

html.dark .application__block-title,
html.dark .application__panel-block-title,
html.dark .application__date-title {
    color: var(--dm-text-muted);
}

html.dark .application__block-subtitle,
html.dark .application__panel-block-subtitle,
html.dark .application__date-subtitle,
html.dark .application__timer-time,
html.dark .application__payment-title {
    color: var(--dm-text);
}

html.dark .application__panel-block,
html.dark .application__date {
    background: var(--dm-bg-3);
}

html.dark .application__date-img {
    background: var(--dm-accent-bg);
}

html.dark .application__timer-title {
    color: var(--dm-text-muted);
}

html.dark .attention {
    background: var(--dm-bg-2);
}

html.dark .panel__line {
    background: var(--dm-border);
}

html.dark .account__tr,
html.dark .partners__tr {
    border-color: var(--dm-border);
}

html.dark .account__th,
html.dark .partners__th,
html.dark .account__td,
html.dark .partners__td {
    color: var(--dm-text);
}

html.dark .account__td_color_gray,
html.dark .partners__td_color_gray {
    color: var(--dm-text-muted);
}

html.dark .account__td_color_black,
html.dark .partners__td_color_black,
html.dark .partners__user {
    color: var(--dm-text);
}

html.dark .rules__panel-block {
    background: var(--dm-bg-3);
}

html.dark .rules__panel-text {
    color: var(--dm-text-muted);
}

html.dark .step {
    background: var(--dm-accent-bg);
    color: rgba(91, 123, 255, 0.5);
}

html.dark .step_open {
    color: var(--dm-accent);
}

html.dark .error__face {
    background: var(--dm-accent-bg);
}

html.dark .preloader {
    background: var(--dm-bg);
}

html.dark .coins__img img {
    border-color: var(--dm-bg-2);
}

html.dark .application__qr {
    background: #fff;
    padding: 8px;
    border-radius: 8px;
}

/* ============================================
   КНОПКА ПЕРЕКЛЮЧЕНИЯ ТЕМЫ
   ============================================ */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 16px;
    background: transparent;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #12141d;
    transition: 0.3s;
}

.theme-toggle:hover {
    background: #f4f5fa;
}

html.dark .theme-toggle {
    border-color: var(--dm-border);
    color: var(--dm-text);
}

html.dark .theme-toggle:hover {
    background: var(--dm-bg-3);
}

.theme-toggle__moon { display: none; }
html.dark .theme-toggle__sun { display: none; }
html.dark .theme-toggle__moon { display: inline; }

html.dark .header__menu,
html.dark .nav__wrapper {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

html.dark .header,
html.dark .nav,
html.dark .header__container {
    background: transparent !important;
    box-shadow: none !important;
}

html.dark .reviews__block-username {
    color: var(--dm-text) !important;
}

html.dark .reviews__block-date {
    color: var(--dm-text-muted) !important;
}

/* ============================================
   ЛОГОТИПЫ — светлый / тёмный
   ============================================ */

/* Базовые стили для обоих логотипов */
.nav__logo .logo-light,
.nav__logo .logo-dark {
    display: inline-block !important;
    height: 26px !important;
    width: auto !important;
    vertical-align: middle !important;
}

/* По умолчанию тёмный скрыт */
.nav__logo .logo-dark {
    display: none !important;
}

/* В тёмной теме — скрываем светлый, показываем тёмный */
html.dark .nav__logo .logo-light {
    display: none !important;
}

html.dark .nav__logo .logo-dark {
    display: inline-block !important;
}

/* Мобильные — высота поменьше */
@media (max-width: 940px) {
    .nav__logo .logo-light,
    .nav__logo .logo-dark {
        height: 22px !important;
    }
    .nav__logo .logo-dark {
        display: none !important;
    }
    html.dark .nav__logo .logo-light {
        display: none !important;
    }
    html.dark .nav__logo .logo-dark {
        display: inline-block !important;
    }
}

/* ============================================
   БЛОК «ИНСТРУКЦИЯ»
   ============================================ */
.how-it-works {
    padding: 80px 0;
    padding-bottom: 120px !important;
    background: #fff;
}

.how-it-works__container {
    text-align: center;
}

.how-it-works__title {
    font-size: 48px;
}

.how-it-works__subtitle {
    margin-top: 18px;
    color: #12141d;
    font-size: 18px;
    line-height: 155.5%;
    opacity: 0.7;
}

.how-it-works__wrapper {
    margin-top: 60px;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.how-it-works__step {
    position: relative;
    flex: 1 1 280px;
    padding: 40px 30px;
    background: #f4f5fa;
    border-radius: 20px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.how-it-works__step:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.how-it-works__step-num {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2b59ff;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    border-radius: 50%;
}

.how-it-works__step-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaefff;
    border-radius: 14px;
}

.how-it-works__step-title {
    margin-top: 24px;
    font-family: "Mazzard", sans-serif;
    color: #12141d;
    font-weight: 600;
    font-size: 22px;
    line-height: 120%;
}

.how-it-works__step-text {
    margin-top: 12px;
    color: #3f3f46;
    font-size: 15px;
    line-height: 160%;
    opacity: 0.75;
}

html.dark .how-it-works {
    background: var(--dm-bg);
}
html.dark .how-it-works__title {
    color: var(--dm-text);
}
html.dark .how-it-works__subtitle {
    color: var(--dm-text-muted);
}
html.dark .how-it-works__step {
    background: var(--dm-bg-2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
html.dark .how-it-works__step:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
html.dark .how-it-works__step-icon {
    background: var(--dm-accent-bg);
}
html.dark .how-it-works__step-title {
    color: var(--dm-text);
}
html.dark .how-it-works__step-text {
    color: var(--dm-text-muted);
}

@media (max-width: 940px) {
    .how-it-works { padding: 60px 0; }
    .how-it-works__title { font-size: 36px; }
    .how-it-works__wrapper { margin-top: 40px; gap: 20px; }
    .how-it-works__step { padding: 30px 24px; }
    .how-it-works__step-title { font-size: 20px; }
}

@media (max-width: 640px) {
    .how-it-works__title { font-size: 30px; }
    .how-it-works__subtitle { font-size: 16px; }
    .how-it-works__step { flex: 1 1 100%; }
}

@media (max-width: 940px) {
    html.dark .header__menu {
        background: var(--dm-bg-3) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
        border-radius: 0 0 16px 16px;
    }
}

/* ============================================
   ЖИВОЙ ИНДИКАТОР КУРСА
   ============================================ */
.rate-status {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    width: 100%;
}

.rate-status__dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: rate-pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes rate-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.rate-status__text {
    font-weight: 500;
}

.rate-status__next {
    opacity: 0.7;
}

html.dark .rate-status {
    color: var(--dm-text-muted);
}

html.dark .rate-status__dot {
    background: #34d399;
}

.rate-status--updating .rate-status__dot {
    background: #3b82f6;
    animation: rate-pulse-blue 0.5s;
}

@keyframes rate-pulse-blue {
    0%   { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    100% { box-shadow: 0 0 0 12px rgba(59, 130, 246, 0); }
}

.rate-status--fresh .rate-status__dot {
    background: #22c55e;
}

@media (max-width: 640px) {
    .rate-status {
        font-size: 12px;
        flex-wrap: wrap;
    }
}

/* ============================================
   ВЫРАВНИВАНИЕ ЭЛЕМЕНТОВ КАЛЬКУЛЯТОРА
   ============================================ */
.select__header {
    min-height: 76px;
    box-sizing: border-box;
    align-items: center;
}

.select__current {
    display: flex;
    align-items: center;
    min-height: 30px;
}

.select__img {
    height: 30px;
    width: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.exchange__panel-start,
.exchange__panel-end {
    justify-content: flex-start !important;
}

.exchange__panel-start .exchange__panel-wrapper-show {
    margin-top: 20px !important;
}

/* Отступ подзаголовка до калькулятора */
.exchange__panel {
    margin-top: 90px !important;
}

/* Индикатор курса — сдвиг в центр между колонками */
.exchange__panel-end .rate-status {
    position: relative;
    left: -50% !important;
    top: 10px !important;
    justify-content: center !important;
}

@media (max-width: 940px) {
    .exchange__panel-start .exchange__panel-wrapper-show {
        margin-top: 25px !important;
    }
    .exchange__panel-end .rate-status {
        left: 0 !important;
        top: 0 !important;
        margin: 10px 0 !important;
        justify-content: center !important;
    }
    .rate-status {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 4px;
        text-align: center;
    }
    .rate-status__text,
    .rate-status__next {
        flex-shrink: 0;
        flex-grow: 0;
        white-space: nowrap;
    }
}

/* ============================================
   ПЛАВАЮЩАЯ КНОПКА TELEGRAM
   ============================================ */
.tg-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(34, 158, 217, 0.4);
    z-index: 999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: tg-pulse 2.5s infinite;
    text-decoration: none;
}

.tg-float:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(34, 158, 217, 0.6);
    animation: none;
}

.tg-float svg {
    display: block;
}

@keyframes tg-pulse {
    0% {
        box-shadow: 0 8px 24px rgba(34, 158, 217, 0.4), 0 0 0 0 rgba(34, 158, 217, 0.5);
    }
    70% {
        box-shadow: 0 8px 24px rgba(34, 158, 217, 0.4), 0 0 0 16px rgba(34, 158, 217, 0);
    }
    100% {
        box-shadow: 0 8px 24px rgba(34, 158, 217, 0.4), 0 0 0 0 rgba(34, 158, 217, 0);
    }
}

@media (max-width: 640px) {
    .tg-float {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
    }
}

/* ============================================
   COPYRIGHT В ФУТЕРЕ
   ============================================ */
.footer__copyright {
    padding: 8px 0;
    text-align: center;
    font-size: 14px;
    color: #8a8a99;
    line-height: 1.4;
    margin: 0
}

html.dark .footer__copyright {
    border-top-color: var(--dm-border);
    color: var(--dm-text-dim);
}

@media (max-width: 640px) {
    .footer__copyright {
        margin: 0;
        padding: 6px 0;
        font-size: 13px;
    }
}
/* Убираем пустоту внизу страницы */
html.dark body,
body,
.wrapper {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.footer {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.footer__container {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* ============================================
   РЕЗЕРВ МОНЕТЫ
   ============================================ */
.coin-reserve {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #22c55e;
    min-height: 18px;
    text-align: right;
    transition: color 0.2s ease;
}

/* Если рядом с резервом есть валидация — поднимаем на одну строку */
.exchange__panel-end:has(.address-validation-msg:not(:empty)) .coin-reserve {
    margin-top: -24px;
}

.coin-reserve--empty {
    color: #ef4444;
}

.coin-reserve--loading {
    color: #8a8a99;
    font-weight: 400;
}

html.dark .coin-reserve {
    color: #34d399;
}

html.dark .coin-reserve--empty {
    color: #f87171;
}

html.dark .coin-reserve--loading {
    color: var(--dm-text-dim);
}

@media (max-width: 940px) {
    .coin-reserve {
        margin-top: 8px;
        text-align: center;
    }
}

/* ============================================
   ИНДИКАТОР СЛОЖНОСТИ ПАРОЛЯ
   ============================================ */
.password-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #8a8a99;
    line-height: 1.4;
}

.password-strength {
    margin-top: 8px;
    width: 100%;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
    transition: 0.3s;
}

.password-strength__bar {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
}

.password-strength__bar.level-1 {
    width: 25%;
    background: #ef4444;
}

.password-strength__bar.level-2 {
    width: 50%;
    background: #f59e0b;
}

.password-strength__bar.level-3 {
    width: 100%;
    background: #22c55e;
}

.password-strength__text {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #8a8a99;
    transition: color 0.3s ease;
}

.password-match {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 500;
    min-height: 16px;
    display: block !important;
    position: static !important;
    height: auto !important;
    width: auto !important;
}

.password-match.is-success {
    color: #22c55e !important;
}

.password-match.is-error {
    color: #ef4444 !important;
}

#change_pass_status.is-success {
    color: #22c55e !important;
}

#change_pass_status.is-error {
    color: #ef4444 !important;
}

html.dark .password-hint,
html.dark .password-strength__text {
    color: var(--dm-text-dim);
}

html.dark .password-strength {
    background: var(--dm-border);
}

/* Обёртки полей — relative */
.input__wrapper {
    position: relative !important;
}

/* Все кнопки Показать/Скрыть — жёстко absolute внутри обёртки */
.input__wrapper > .input__btn,
form#req_form .input__btn,
form#change_pass_form .input__btn {
    position: absolute !important;
    top: 22px !important;
    right: 24px !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: 5 !important;
    display: inline-block !important;
}

/* ============================================
   DROPDOWN «ПРАВИЛА» — ТЁМНАЯ ТЕМА
   ============================================ */
html.dark .nav__dropdown-menu {
    background: var(--dm-bg-2);
    border-color: var(--dm-border);
    box-shadow: var(--dm-shadow)
}

html.dark .nav__dropdown-item {
    color: var(--dm-text-muted)
}

html.dark .nav__dropdown-item:hover {
    background: var(--dm-bg-3);
    color: var(--dm-accent)
}

html.dark .nav__dropdown-item_active {
    background: var(--dm-accent-bg);
    color: var(--dm-accent)
}

html.dark .nav__arrow {
    opacity: .6
}

/* ============================================
   FAQ — ТЁМНАЯ ТЕМА
   ============================================ */
html.dark .faq__item {
    background: var(--dm-bg-2);
    border-color: var(--dm-border)
}

html.dark .faq__item:hover {
    border-color: var(--dm-accent)
}

html.dark .faq__item_active {
    border-color: var(--dm-accent);
    box-shadow: 0 4px 20px rgba(91, 123, 255, .15)
}

html.dark .faq__question {
    color: var(--dm-text)
}

html.dark .faq__question:hover {
    color: var(--dm-accent)
}

html.dark .faq__arrow {
    color: var(--dm-text-dim)
}

html.dark .faq__item_active .faq__arrow {
    color: var(--dm-accent)
}

html.dark .faq__answer p {
    color: var(--dm-text-muted)
}

/* ============================================
   АНИМИРОВАННЫЙ ФОН — ТЁМНАЯ ТЕМА
   ============================================ */
html.dark .bg-waves__path_1 {
    fill: rgba(91, 123, 255, .06)
}

html.dark .bg-waves__path_2 {
    fill: rgba(91, 123, 255, .1)
}

html.dark .bg-waves__path_3 {
    fill: rgba(91, 123, 255, .14)
}

/* ============================================
   ПРОЗРАЧНЫЕ ПАНЕЛИ — ТЁМНАЯ ТЕМА
   ============================================ */
html.dark body {
    background: linear-gradient(180deg, #0f0f14 0%, #13172a 50%, #0f1428 100%)
}

html.dark .input,
html.dark .select__header,
html.dark .select__item,
html.dark .panel__btn,
html.dark .faq__item,
html.dark .application__block,
html.dark .footer {
    background: rgba(26, 26, 34, 0.7)
}

html.dark .select__body,
html.dark .nav__dropdown-menu {
    background: rgba(26, 26, 34, 0.9)
}

html.dark .reviews,
html.dark .how-it-works__step,
html.dark .rules__panel-block,
html.dark .partners__panel-block,
html.dark .application__panel-block,
html.dark .application__date,
html.dark .attention {
    background: rgba(35, 35, 45, 0.7)
}

html.dark .panel__text_small {
    color: var(--dm-text-muted);
    opacity: 1
}

html.dark .panel__link-rules {
    color: var(--dm-text-muted);
    opacity: 1
}

html.dark .panel__link-rules:hover {
    color: var(--dm-accent);
    opacity: 1
}

/* ============================================
   ОБО МНЕ — ТЁМНАЯ ТЕМА
   ============================================ */
html.dark .about__row {
    border-bottom-color: var(--dm-border)
}

html.dark .about__label {
    color: var(--dm-text-muted)
}

html.dark .about__value {
    color: var(--dm-text)
}

html.dark .about__copy {
    background: var(--dm-accent-bg);
    color: var(--dm-accent)
}

html.dark .about__copy:hover {
    background: rgba(91, 123, 255, 0.25)
}

html.dark .about__copy.is-copied {
    background: rgba(34, 197, 94, 0.2);
    color: #34d399
}

html.dark .about__tg-status.is-success {
    color: #34d399
}

html.dark .about__tg-status.is-error {
    color: #f87171
}

/* Мобильная коррекция для кнопок Показать/Скрыть */
@media (max-width: 640px) {
    .input__wrapper > .input__btn,
    form#req_form .input__btn,
    form#change_pass_form .input__btn {
        top: 14px !important;
    }
}