/* Top-up page styles (SPA integrated) */

#view-topup {
    /* ✅ Убраны view-specific paddings - используются глобальные из layout.css */
    max-width: 600px;
    margin: 0 auto;
}

.topup-header {
    text-align: center;
    margin-bottom: 24px;
}

.topup-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: white;
    margin: 0 0 8px 0;
}

.topup-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Прайс hint - менее акцентно */
.topup-price-hint {
    text-align: center;
    margin-bottom: 20px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: inline-block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
}

.topup-price-hint span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* Result card - главный акцент */
.topup-result-card {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.2), rgba(114, 137, 218, 0.15));
    border: 2px solid rgba(88, 101, 242, 0.4);
    border-radius: 20px;
    padding: 28px 24px;
    margin-bottom: 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Label "Вы получите" */
.topup-main-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Главный акцент - БОЛЬШИЕ цифры токенов */
.topup-tokens-big {
    font-size: 56px;
    font-weight: 900;
    color: white;
    margin-bottom: 12px;
    letter-spacing: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 64px;  /* ✅ Фиксированная высота - предотвращает прыжки */
}

.topup-tokens-big span {
    display: inline-block;  /* ✅ Для стабильности при изменении */
}

.topup-tokens-big .token-star {
    flex-shrink: 0;  /* ✅ Звезда не меняет размер */
}

.topup-tokens-big .token-star {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8))
            drop-shadow(0 0 24px rgba(255, 215, 0, 0.5))
            drop-shadow(0 0 4px rgba(255, 215, 0, 1));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Анимация звезды при изменении количества */
.topup-tokens-big .token-star.pulse {
    animation: star-pulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes star-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8))
                drop-shadow(0 0 24px rgba(255, 215, 0, 0.5))
                drop-shadow(0 0 4px rgba(255, 215, 0, 1));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 16px rgba(255, 215, 0, 1))
                drop-shadow(0 0 32px rgba(255, 215, 0, 0.7))
                drop-shadow(0 0 8px rgba(255, 215, 0, 1));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8))
                drop-shadow(0 0 24px rgba(255, 215, 0, 0.5))
                drop-shadow(0 0 4px rgba(255, 215, 0, 1));
    }
}


/* Затухающая тряска для бонуса */
@keyframes bounce-fade {
    0% {
        transform: translateX(0) scale(1);
    }
    15% {
        transform: translateX(-6px) scale(1.05);
    }
    30% {
        transform: translateX(6px) scale(1.05);
    }
    45% {
        transform: translateX(-4px) scale(1.02);
    }
    60% {
        transform: translateX(3px) scale(1.02);
    }
    75% {
        transform: translateX(-1px) scale(1);
    }
    100% {
        transform: translateX(0) scale(1);
    }
}

/* ============================================
   ТАРИФЫ - минималистичные карточки-селекторы
   ============================================ */

.topup-tariffs {
    display: flex;
    flex-direction: column;
    gap: 16px;  /* ✅ Увеличен отступ между блоками */
    margin-bottom: 24px;
}

.topup-tariff {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.topup-tariff:active {
    transform: scale(0.98);
}

/* Выбранный тариф - белая окантовка и свечение */
.topup-tariff.selected {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 1);  /* ✅ Белая окантовка */
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15),  /* ✅ Легкое белое свечение */
                0 8px 32px rgba(255, 255, 255, 0.2);
}

/* Галочка справа у selected */
.topup-tariff.selected::after {
    content: '✓';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
}

/* Метка сверху - цветной фон */
.topup-tariff-label {
    position: absolute;
    top: -10px;
    left: 16px;
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;  /* ✅ Shimmer не вылетает за пределы */
}

/* Популярный - яркий желтый */
.topup-tariff[data-amount="500"] .topup-tariff-label {
    background: linear-gradient(135deg, #FFD700, #FFC700);
    color: #000000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

/* Опт Для Про - премиум градиент */
.topup-tariff[data-amount="1000"] .topup-tariff-label {
    background: linear-gradient(135deg, #C471F5 0%, #9B6FED 50%, #7B3FE4 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(155, 111, 237, 0.4),
                0 4px 16px rgba(196, 113, 245, 0.25);
}

/* Shimmer эффект для Опт Для Про */
.topup-tariff[data-amount="1000"] .topup-tariff-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: label-shimmer 3s ease-in-out infinite;
}

@keyframes label-shimmer {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 200%;
    }
}

/* Ускоренный shimmer для Опт Для Про */
.topup-tariff[data-amount="1000"] .topup-tariff-label::before {
    animation: label-shimmer 1.8s ease-in-out infinite;  /* ✅ Чаще: 3s → 1.8s */
}

/* Сумма */
.topup-tariff-amount {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.8px;
    line-height: 1;
}

/* Бонус с иконкой */
.topup-tariff-bonus {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
}

/* Wrapper для текста - СТРОГО по ширине */
.topup-tariff-bonus .bonus-text {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

/* Shimmer СТРОГО по тексту (не по всей строке!) */
.topup-tariff-bonus .bonus-text.shimmer-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.7) 50%,
        transparent 100%
    );
    animation: bonus-shimmer 0.8s ease-out;
}

@keyframes bonus-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.topup-tariff-bonus .bonus-star {
    width: 16px;
    height: 16px;
    filter: brightness(0) saturate(100%) invert(100%);
    opacity: 0.75;
}

/* Без бонуса (серый текст) */
.topup-tariff-bonus-none {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
}

/* Информация о генерациях */
.topup-tariff-info {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;  /* ✅ Ещё ниже от бонуса */
}

/* Счётчик токенов под блоками */
.topup-tokens-summary {
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);  /* ✅ Слабо серый */
    margin-bottom: 24px;
}

.topup-tokens-summary .summary-count,
.topup-tokens-summary .summary-price {
    font-weight: 700;
    color: rgba(255, 255, 255, 1);  /* ✅ Белые цифры и ₽ */
}


/* Form */
.topup-form {
    margin-bottom: 28px;
}

.topup-input-label {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    font-weight: 500;
}

/* Поле ввода суммы */
.topup-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.topup-amount-input {
    width: 100%;
    padding: 16px 50px 16px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.topup-amount-input:focus {
    outline: none;
    border-color: rgba(88, 101, 242, 0.5);
    background: rgba(255, 255, 255, 0.12);
}

/* Remove spinner arrows */
.topup-amount-input::-webkit-outer-spin-button,
.topup-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.topup-amount-input[type=number] {
    -moz-appearance: textfield;
}

.topup-currency {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.topup-slider-container {
    position: relative;
}

.topup-amount-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    margin-bottom: 12px;
}

.topup-amount-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5865F2, #7289DA);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.topup-amount-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5865F2, #7289DA);
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.topup-slider-marks {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
}

.topup-mark {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Пометки бонусов */
.topup-mark-bonus {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.topup-mark-bonus .mark-value {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.topup-mark-bonus .mark-label {
    font-size: 9px;
    font-weight: 700;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.15);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Payment button */
.topup-button-container {
    margin-bottom: 28px;
}

.topup-payment-btn {
    width: 100%;
    background: linear-gradient(135deg, #5865F2, #7289DA);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.topup-payment-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.topup-payment-btn:not(:disabled):active {
    transform: translateY(2px);
}

/* Payment info */
.topup-payment-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.topup-payment-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: white;
    margin: 0 0 12px 0;
}

.topup-payment-info ul {
    margin: 0;
    padding: 0 0 0 20px;
    list-style: disc;
}

.topup-payment-info li {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.topup-payment-info li:last-child {
    margin-bottom: 0;
}
