* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #40a7e3;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #f4f4f5;
    --tg-theme-section-bg-color: #ffffff;
    --tg-theme-section-separator-color: #e7e7e7;
    --tg-theme-subtitle-text-color: #999999;
    --custom-heading-color: #353535;
    --custom-description-color: #777777;
}

html {
    background-color: var(--tg-theme-secondary-bg-color);
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Скрываем скроллбар для WebKit браузеров */
body::-webkit-scrollbar {
    display: none;
}

#main-window {
    min-height: 100vh;
    padding-bottom: 2rem;
    background-color: var(--tg-theme-secondary-bg-color);
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0;
    background-color: transparent;
}

/* Lottie анимация */
.animation-section {
    text-align: center;
    padding: 1rem 0;
    background-color: transparent;
}

.lottie-container {
    width: 144px;
    height: 144px;
    margin: 0 auto;
    cursor: pointer;
}

/* Заголовок */
.header-section {
    text-align: center;
    padding: 0 1rem 1rem;
    background-color: transparent;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--custom-heading-color);
    margin-bottom: 0.5rem;
}

.description {
    font-size: 0.875rem;
    color: var(--custom-heading-color);
    line-height: 1.4;
}

.description strong {
    font-weight: 700;
}

#bot-username {
    color: var(--tg-theme-link-color);
}

/* Секции */
.tariffs-section .section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin-bottom: 0.5rem;
    padding: 0 1rem;
}

/* Тарифы */
.tariffs-section {
    background: var(--tg-theme-section-bg-color);
    border-radius: 25px;
    overflow: hidden;
    margin: 0.5rem 1rem;
}

.tariff-item {
    display: flex;
    align-items: center;
    position: relative;
    height: 44px;
    padding: 0 0 0 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s;
}

.tariff-item.disabled {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.tariff-item:active {
    background-color: rgba(0, 0, 0, 0.05);
}

.tariff-separator {
    height: 0.33px;
    background: var(--tg-theme-section-separator-color);
    margin-left: 48px;
    margin-right: 0;
}

.tariff-radio {
    width: 22px;
    height: 22px;
    border: 1px solid rgba(119, 119, 119, 0.2);
    border-radius: 11px;
    position: relative;
    flex-shrink: 0;
    margin-right: 10px;
    transition: all 0.2s ease;
}

.tariff-radio.checked {
    border: none;
    background: var(--tg-theme-button-color);
}

.tariff-radio.checked::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 11px;
    left: 7px;
    top: 4px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: checkmark 0.2s ease-in-out;
}

@keyframes checkmark {
    0% {
        opacity: 0;
        transform: rotate(45deg) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: rotate(45deg) scale(1);
    }
}

.tariff-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tariff-info {
    display: flex;
    flex-direction: column;
}

.tariff-name {
    font-size: 17px;
    font-weight: 400;
    line-height: 22px;
    color: var(--tg-theme-text-color);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.43px;
}

.tariff-badge {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: -0.154px;
    display: none;
}

/* Оставляем старый класс для совместимости */
.tariff-trial-badge {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: -0.154px;
}

.tariff-price {
    color: #8E8E93;
    font-size: 17px;
    font-weight: 400;
    line-height: 22px;
    letter-spacing: -0.43px;
    padding-right: 16px;
}

/* Методы оплаты */
.payment-methods-section {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 8px;
}

.payment-methods-section .section-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 18px;
    line-height: 20px;
    letter-spacing: 0.38px;
    color: var(--custom-heading-color);
    padding: 0 0 0 15px;
    margin: 0;
}

.payment-methods-scroll {
    display: flex;
    gap: 9px;
    padding: 2px 0 2px 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: flex-end;
}

.payment-methods-scroll::-webkit-scrollbar {
    display: none;
}

.payment-method-card {
    width: 135px;
    height: 120px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 28px;
    transition: all 0.2s;
    padding: 2px;
    border: 2px solid transparent;
}

.payment-method-card.selected {
    border-color: #5792EE;
}

.payment-method-card:active {
    transform: scale(0.95);
}

.payment-method-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    height: 100%;
    box-sizing: border-box;
    border-radius: 24px;
}

.payment-method-card[data-method="card"] .payment-method-inner {
    background: rgba(5, 103, 255, 0.13);
}

.payment-method-card[data-method="stars"] .payment-method-inner {
    background: rgba(243, 227, 0, 0.13);
}

.payment-method-card[data-method="send"] .payment-method-inner {
    background: rgba(33, 171, 231, 0.13);
}

.payment-method-icon {
    width: 40px;
    height: 40px;
    border-radius: 120px;
    object-fit: cover;
    flex-shrink: 0;
}

.payment-method-text {
    display: flex;
    flex-direction: column;
    width: 115px;
    overflow: visible;
}

.payment-method-name {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.38px;
    color: var(--custom-heading-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payment-method-description {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.38px;
    color: var(--custom-description-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Чекбоксы */
.checkboxes-section {
    background: var(--tg-theme-section-bg-color);
    padding: 0.625rem 0.75rem;
    border-radius: 1rem;
    margin: 1rem 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-wrapper {
    /* margin убран, используем gap родителя */
}

.checkbox-wrapper:last-child {
    /* margin убран, используем gap родителя */
}

.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.custom-checkbox:active .checkbox-label,
.custom-checkbox:active {
    background-color: transparent;
    color: inherit;
}

.custom-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-mark {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid var(--tg-theme-button-color);
    border-radius: 99px;
    margin-right: 0.5rem;
    flex-shrink: 0;
    position: relative;
    transition: background-color 0.2s;
    align-self: flex-start;
    margin-top: 2px;
}

.custom-checkbox input[type="checkbox"]:checked + .checkbox-mark {
    background-color: var(--tg-theme-button-color);
}

.custom-checkbox input[type="checkbox"]:checked + .checkbox-mark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    font-size: 0.75rem;
    color: var(--tg-theme-subtitle-text-color);
    line-height: 1.4;
}

.checkbox-label a {
    color: var(--tg-theme-link-color);
    text-decoration: none;
}

/* Индикатор скролла */
#scroll-indicator {
    height: 1px;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Анимация shake для ошибки */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}
