/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Более темный градиент для лучшей читаемости */
    background: linear-gradient(135deg, #4a5bb3 0%, #5a3a7a 100%);
    background-attachment: fixed;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 100px; /* Место для парящего нижнего меню */
}

/* Заголовок приложения */
.app-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.back-button:active {
    transform: translateX(-1px);
    background: rgba(255, 255, 255, 0.15);
}

.back-button svg {
    width: 20px;
    height: 20px;
}

.app-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

/* Основной контент */
.main-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Блок профиля */
.profile-section {
    margin-bottom: 4px;
}

/* Реферальная программа */
.referral-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.referral-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.ref-stat-item {
    background: rgba(var(--primary-rgb), 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 16px;
    padding: 20px 12px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ref-stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.ref-stat-item:hover::before {
    transform: translateX(100%);
}

.ref-stat-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.25);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.ref-stat-item.highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0); }
}

.ref-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 6px;
    animation: countUp 0.6s ease-out;
    text-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ref-stat-label {
    font-size: 11px;
    color: var(--text-primary);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ref-link-section {
    margin-bottom: 24px;
}

.ref-link-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    font-weight: 500;
}

.ref-link-preview {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: 8px;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
}

.ref-link-section .copy-btn {
    width: 100%;
    margin-bottom: 8px;
}

.share-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    padding: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.referral-list {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.1);
}

.ref-list-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

#referral-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.referral-item {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06), rgba(var(--primary-rgb), 0.02));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.referral-item:hover {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--primary-rgb), 0.05));
    border-color: rgba(var(--primary-rgb), 0.25);
    transform: translateX(4px);
    box-shadow: -4px 0 12px rgba(var(--primary-rgb), 0.15);
}

.referral-item-info {
    flex: 1;
}

.referral-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.referral-item-status {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.referral-item-status::before {
    content: '•';
    font-size: 16px;
    color: var(--primary-color);
}

.referral-item-reward {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.referral-item-reward.pending {
    color: var(--text-secondary);
    opacity: 0.6;
}

.referral-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    background: rgba(var(--primary-rgb), 0.03);
    border-radius: 16px;
    border: 2px dashed rgba(var(--primary-rgb), 0.15);
}

.referral-empty::before {
    content: '📢';
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Блок "Как это работает" */
.referral-info-block {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), rgba(var(--primary-rgb), 0.02));
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.referral-info-block h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.referral-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.referral-step {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    transition: all 0.3s ease;
}

.referral-step:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.2);
    transform: translateX(4px);
}

.referral-step.highlight-step {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    border: 2px solid rgba(var(--primary-rgb), 0.3);
}

.referral-step.highlight-step:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.18));
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.referral-step.highlight-step .step-number {
    font-size: 22px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.step-content {
    flex: 1;
}

.step-content h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.referral-step.highlight-step .step-content h5 {
    color: var(--primary-color);
    font-weight: 700;
}

/* Кнопка "Назад" */
.back-btn {
    background: rgba(var(--primary-rgb), 0.1);
    border: none;
    border-radius: 12px;
    padding: 8px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 12px;
}

.back-btn:hover {
    background: rgba(var(--primary-rgb), 0.2);
    transform: translateX(-2px);
}

.back-btn:active {
    transform: scale(0.95);
}

/* CTA карточка реферальной программы */
.referral-cta-section {
    margin-bottom: 24px;
}

.referral-cta-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 20px;
    padding: 20px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.referral-cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.referral-cta-card:hover::before {
    left: 100%;
}

.referral-cta-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--primary-rgb), 0.4);
    box-shadow: 0 8px 32px rgba(var(--primary-rgb), 0.3);
}

.referral-cta-icon {
    font-size: 48px;
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}

.referral-cta-content {
    flex: 1;
}

.referral-cta-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.referral-cta-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.referral-cta-arrow {
    flex-shrink: 0;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.referral-cta-card:hover .referral-cta-arrow {
    transform: translateX(4px);
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.large {
    height: 24px;
    width: 60%;
}

.skeleton-text.small {
    height: 14px;
    width: 40%;
}

.skeleton-box {
    height: 60px;
    width: 100%;
    border-radius: 12px;
}

.profile-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-header-with-photo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.profile-header-with-photo h2 {
    margin: 0;
    flex: 1;
}

.profile-photo-container {
    flex-shrink: 0;
}

.profile-photo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-photo-square {
    border-radius: 16px;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-header-with-photo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.profile-header-with-photo h2 {
    margin: 0;
    flex: 1;
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 6px 16px rgba(102, 126, 234, 0.3);
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-info h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffffff;
}

.profile-info p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

/* Статистика с иконками в профиле */
.profile-stats-icons {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.stat-icon-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.stat-icon-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-icon-item svg {
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.stat-icon-item span {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

/* Тултип для статистики */
.stat-icon-item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.stat-icon-item::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.stat-icon-item:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

.stat-icon-item:hover::after {
    opacity: 1;
}

.renew-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #00b4d8, #4361ee);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 10px 24px rgba(67, 97, 238, 0.35);
    position: relative;
    overflow: hidden;
}

.renew-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 120%;
    height: 100%;
    background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -150%; }
    100% { left: 150%; }
}

.renew-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(76, 175, 80, 0.35);
}

.renew-btn:active {
    transform: translateY(0);
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
}

.status-indicator.active {
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-indicator.expired {
    background: #dc3545;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Блок ключа */
/* Установка и настройка */
.setup-section {
    margin: 2px 0;
}

.setup-card {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25) 0%, rgba(56, 142, 60, 0.25) 100%);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(76, 175, 80, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.setup-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(76, 175, 80, 0.2);
}

.setup-text h3 {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.device-badge-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.device-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(56, 142, 60, 0.3) 100%);
    border: 2px solid rgba(76, 175, 80, 0.5);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.device-badge.ios {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.3) 0%, rgba(10, 132, 255, 0.3) 100%);
    border-color: rgba(0, 122, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.device-badge.android {
    background: linear-gradient(135deg, rgba(61, 220, 132, 0.3) 0%, rgba(48, 209, 88, 0.3) 100%);
    border-color: rgba(61, 220, 132, 0.5);
    box-shadow: 0 4px 12px rgba(61, 220, 132, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.device-badge.macos {
    background: linear-gradient(135deg, rgba(142, 142, 147, 0.3) 0%, rgba(99, 99, 102, 0.3) 100%);
    border-color: rgba(142, 142, 147, 0.5);
    box-shadow: 0 4px 12px rgba(142, 142, 147, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.device-badge.windows {
    background: linear-gradient(135deg, rgba(0, 120, 215, 0.3) 0%, rgba(0, 99, 177, 0.3) 100%);
    border-color: rgba(0, 120, 215, 0.5);
    box-shadow: 0 4px 12px rgba(0, 120, 215, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.device-icon {
    font-size: 18px;
    line-height: 1;
}

.device-auto-detect {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.setup-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 0;
}

.setup-btn {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.setup-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

@media (max-width: 480px) {
    .setup-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .setup-btn {
        width: 100%;
    }
    
    /* Адаптивная статистика профиля */
    .profile-stats-icons {
        gap: 8px;
    }
    
    .stat-icon-item {
        padding: 6px 10px;
        gap: 5px;
    }
    
    .stat-icon-item svg {
        width: 16px;
        height: 16px;
    }
    
    .stat-icon-item span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .protocol-buttons {
        grid-template-columns: 1fr;
    }
}

.key-section {
    margin: 2px 0;
}

.key-card {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.25) 0%, rgba(30, 136, 229, 0.25) 100%);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(33, 150, 243, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.key-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2), 0 6px 16px rgba(33, 150, 243, 0.3);
}

.key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.key-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.copy-btn {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}

/* Группа действий с ключом */
.key-actions-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.install-btn {
    background: linear-gradient(135deg, #00b4d8, #4361ee);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
}

.install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.45);
}

.install-btn:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .key-actions-group {
        flex-direction: column;
    }
    
    .install-btn, .copy-btn {
        width: 100%;
        justify-content: center;
    }
}

.key-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.key-display {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #ffffff;
    word-break: break-all;
    line-height: 1.4;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.key-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.protocol-badge, .location-badge {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.location-badge {
    background: #28a745;
}

/* Статистика */
.stats-section {
    margin: 2px 0;
}
.setup-page h2 {
    color: #ffffff;
    margin-bottom: 8px;
}

.setup-page p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
}

/* Контейнер страницы настройки устройств */
.setup-page {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    margin-top: 75px;
}

/* Герой-блок: сначала анимация, затем текст и кнопки */
.setup-hero {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.setup-textblock {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.setup-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
}

.setup-caption {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.setup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Вкладки выбора приложений */
.app-tabs {
    display: flex;
    gap: 12px;
    margin: 24px 0 20px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.app-tab {
    flex: 1;
    padding: 16px 20px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.app-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.app-tab.active {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(56, 142, 60, 0.3) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.app-tab-icon {
    font-size: 20px;
}

.app-tab-name {
    font-size: 15px;
}

/* Контент приложений */
.app-content {
    display: none;
    animation: fadeInApp 0.3s ease;
}

.app-content.active {
    display: block;
}

/* Сетка карточек устройств */
.devices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding: 0;
}

.device-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.device-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.12) 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

.device-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.device-card:hover .device-icon {
    transform: scale(1.1);
    color: #ffffff;
}

.device-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.device-card p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.device-btn {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(56, 142, 60, 0.3) 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(76, 175, 80, 0.4);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.device-btn:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.5) 0%, rgba(56, 142, 60, 0.5) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

@media (max-width: 768px) {
    .devices-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .device-card {
        padding: 20px 12px;
    }
    
    .device-icon {
        width: 60px;
        height: 60px;
    }
    
    .device-icon svg {
        width: 60px !important;
        height: 60px !important;
    }
}

@media (max-width: 480px) {
    .devices-grid {
        grid-template-columns: 1fr;
    }
    
    .device-card h3 {
        font-size: 18px;
    }
}

/* Блоки кода для инструкций */
.code-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
}

.code-block code {
    color: #4CAF50;
    font-size: 13px;
    line-height: 1.6;
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
}

.step code {
    background: rgba(76, 175, 80, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #4CAF50;
}

.step a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step a:hover {
    color: #66BB6A;
    text-decoration: underline;
}

@keyframes fadeInApp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Инструкции */
.instruction-header {
    text-align: center;
    margin-bottom: 32px;
}

.instruction-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.instruction-header p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.step h4 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
}

.step p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
    line-height: 1.6;
}

.step ul {
    margin-left: 20px;
    padding-left: 0;
}

.step ul, .step ol {
    margin-left: 20px;
    padding-left: 0;
}

.step li {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
    line-height: 1.6;
}

.step ol {
    list-style-type: decimal;
}

.step ol li {
    padding-left: 8px;
}

.step.troubleshooting {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15) 0%, rgba(255, 193, 7, 0.15) 100%);
    border-color: rgba(255, 152, 0, 0.3);
}

.link-btn {
    display: inline-block;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.link-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.link-btn.primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: rgba(76, 175, 80, 0.5);
    color: #ffffff !important;
}

.link-btn.secondary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: rgba(33, 150, 243, 0.5);
    color: #ffffff !important;
}

.link-btn {
    display: inline-block;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

/* Важное уведомление */
.important-notice {
    margin-top: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.2) 0%, rgba(255, 193, 7, 0.2) 100%);
    border: 2px solid rgba(255, 152, 0, 0.5);
    border-radius: 12px;
    font-size: 14px;
    color: #ffffff;
    line-height: 1.6;
}

.important-notice strong {
    font-weight: 700;
}

/* Кнопка установки ключа */
.install-key-btn {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin: 12px 0;
}

.install-key-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.install-key-btn:active {
    transform: translateY(0);
}

/* Сворачиваемый блок */
.collapsible-section {
    margin-top: 16px;
}

.collapsible-toggle {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.collapsible-toggle::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.collapsible-toggle.active::after {
    transform: rotate(180deg);
}

.collapsible-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 16px;
}

.collapsible-content.active {
    max-height: 1000px;
    padding: 16px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.action-btn:hover { transform: translateY(-1px); }

.action-btn.primary {
    background: linear-gradient(135deg, #00b4d8, #4361ee);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(67, 97, 238, 0.35);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
}

/* Анимированный контейнер Lottie */
.device-illustration {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.device-illustration lottie-player,
.device-illustration .lottie {
    width: 100%;
    max-width: 360px;
    height: auto;
}

.setup-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn.primary {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.device-card {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-decoration: none;
    padding: 14px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Инструкции установки */
.instruction-section {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    margin-top: 75px;
}

.instruction-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.instruction-title {
    font-size: 22px;
    font-weight: 800;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.app-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
}

.step h4 {
    font-size: 15px;
    margin-bottom: 6px;
}

.screenshot {
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
}

.screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

/* Табы приложений на страницах настройки */
.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tab-btn {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.tab-btn.active {
    background: linear-gradient(135deg, #00b4d8, #4361ee);
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(67,97,238,0.35);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

@media (max-width: 480px) {
    .apps-grid { grid-template-columns: 1fr; }
}

/* Иллюстрации устройств на страницах настройки */
.setup-hero {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.setup-textblock {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.setup-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
}

.setup-caption {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.device-illustration {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-illustration svg {
    width: 100%;
    max-width: 340px;
    height: auto;
    animation: float 4s ease-in-out infinite;
}

.device-glow {
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle at 50% 50%, rgba(103,126,234,0.35), rgba(118,75,162,0.0) 60%);
    pointer-events: none;
    animation: pulseGlow 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Кнопка приза iPhone */
.iphone-prize-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    border-radius: 20px;
    padding: 20px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.iphone-prize-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.iphone-prize-btn:hover::before {
    left: 100%;
}

.iphone-prize-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(255, 107, 107, 0.5);
}

.iphone-prize-btn:active {
    transform: translateY(-2px);
}

.iphone-prize-btn .prize-icon {
    font-size: 42px;
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}

.iphone-prize-btn .prize-text {
    flex: 1;
}

.iphone-prize-btn .prize-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 0 0 4px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.iphone-prize-btn .prize-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.iphone-prize-btn .prize-arrow {
    font-size: 24px;
    color: white;
    flex-shrink: 0;
    transition: transform 0.3s;
}

.iphone-prize-btn:hover .prize-arrow {
    transform: translateX(4px);
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

@media (max-width: 480px) {
    .setup-hero {
        padding: 0;
    }
    
    .setup-title {
        font-size: 20px;
    }
    
    .setup-caption {
        font-size: 14px;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.18);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* Нижнее меню */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    /* Более непрозрачный фон с градиентом для лучшей читаемости */
    background: linear-gradient(135deg, rgba(100, 110, 200, 0.85), rgba(90, 60, 120, 0.85));
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border-radius: 20px;
    display: flex;
    padding: 12px 16px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    /* Улучшенный контраст текста */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.nav-item.active {
    color: #ffffff;
}

.nav-item:hover {
    color: #ffffff;
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
}

/* Цвета для разных иконок навигации */
.nav-item:nth-child(1) .nav-icon svg {
    color: #4CAF50; /* Зеленый для главной */
}

.nav-item:nth-child(2) .nav-icon svg {
    color: #2196F3; /* Синий для профиля */
}

.nav-item:nth-child(3) .nav-icon svg {
    color: #FF9800; /* Оранжевый для подписки */
}

.nav-item:nth-child(4) .nav-icon svg {
    color: #9C27B0; /* Фиолетовый для настроек */
}

.nav-item.active .nav-icon svg {
    color: #ffffff !important; /* Белый для активной иконки */
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

/* Уведомления */
.copy-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #ffffff;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4), 0 0 40px rgba(76, 175, 80, 0.2);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.copy-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: copyPulse 0.6s ease;
}

@keyframes copyPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

/* Конфетти анимация */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f0f;
    position: absolute;
    animation: confetti-fall 3s ease-out forwards;
    z-index: 1999;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti:nth-child(1) { background: #ff6b6b; left: 10%; animation-delay: 0s; }
.confetti:nth-child(2) { background: #4ecdc4; left: 20%; animation-delay: 0.1s; }
.confetti:nth-child(3) { background: #ffe66d; left: 30%; animation-delay: 0.2s; }
.confetti:nth-child(4) { background: #a8e6cf; left: 40%; animation-delay: 0.3s; }
.confetti:nth-child(5) { background: #ff8ed4; left: 50%; animation-delay: 0.4s; }
.confetti:nth-child(6) { background: #95e1d3; left: 60%; animation-delay: 0.1s; }
.confetti:nth-child(7) { background: #ffaaa5; left: 70%; animation-delay: 0.2s; }
.confetti:nth-child(8) { background: #ffd3b6; left: 80%; animation-delay: 0.3s; }
.confetti:nth-child(9) { background: #a8dadc; left: 90%; animation-delay: 0.4s; }
.confetti:nth-child(10) { background: #ff99c8; left: 95%; animation-delay: 0s; }

/* Адаптивность */
@media (max-width: 480px) {
    .main-content {
        padding: 16px;
        gap: 20px;
    }
    
    .profile-card {
        padding: 20px;
    }
    
    .profile-info h2 {
        font-size: 18px;
    }
    
    .profile-info p {
        font-size: 13px;
    }
    
    .stats-grid {
        gap: 12px;
    }
    
    .stat-item {
        padding: 16px 12px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .setup-card, .key-card {
        padding: 20px;
    }
    
    .key-header h3, .setup-text h3 {
        font-size: 16px;
    }
    
    .device-badge-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .device-badge {
        font-size: 15px;
        padding: 6px 14px;
    }
    
    .device-icon {
        font-size: 18px;
    }
    
    .device-auto-detect {
        font-size: 12px;
    }
    
    .app-tabs {
        gap: 8px;
        padding: 3px;
    }
    
    .app-tab {
        padding: 12px 16px;
        font-size: 14px;
        flex-direction: column;
        gap: 4px;
    }
    
    .app-tab-icon {
        font-size: 18px;
    }
    
    .app-tab-name {
        font-size: 12px;
    }
    
    .instruction-header h3 {
        font-size: 20px;
    }
    
    .instruction-header p {
        font-size: 14px;
    }
    
    .step {
        padding: 16px;
    }
    
    .step h4 {
        font-size: 16px;
    }
    
    .step p, .step li {
        font-size: 13px;
    }
    
    .important-notice {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .install-key-btn {
        font-size: 15px;
        padding: 14px 18px;
    }
    
    .collapsible-toggle {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    /* Парящее меню на мобильных */
    .bottom-nav {
        bottom: 16px;
        left: 16px;
        right: 16px;
        padding: 10px 12px;
    }
    
    .nav-icon {
        width: 20px;
        height: 20px;
    }
    
    .nav-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .nav-item span {
        font-size: 11px;
    }
}

/* Стили для страницы профиля */
.profile-card-large {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-avatar-large {
    position: relative;
}

.profile-avatar-large img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--tg-theme-button-color, #007bff);
    object-fit: cover;
}

.avatar-status {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #28a745;
    border: 3px solid var(--tg-theme-secondary-bg-color, #f8f9fa);
    border-radius: 50%;
}

.profile-details h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #ffffff;
}

.profile-details p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.join-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.join-icon {
    font-size: 16px;
}

/* Статистика использования */
.usage-stats {
    margin-bottom: 24px;
}

.usage-stats h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.stats-grid-large {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-icon-large {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-theme-button-color, #007bff);
    border-radius: 12px;
    color: var(--tg-theme-button-text-color, #ffffff);
}

.stat-content {
    flex: 1;
}

.stat-value-large {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.stat-label-large {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Активные ключи */
.active-keys, .activity-history {
    margin-bottom: 24px;
}

.active-keys h3, .activity-history h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.key-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.key-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #28a745;
    color: white;
}

.status-badge.inactive {
    background: #6c757d;
    color: white;
}

.key-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.key-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.detail-value {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.key-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn-small {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* История активности */
.activity-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.activity-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-theme-button-color, #007bff);
    border-radius: 8px;
    color: var(--tg-theme-button-text-color, #ffffff);
}

.activity-content {
    flex: 1;
}

.activity-action {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 4px;
}

.activity-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.activity-location {
    font-weight: 500;
}

/* Действия профиля */
.profile-actions {
    margin-bottom: 24px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.action-btn.secondary {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    color: var(--tg-theme-text-color, #000000);
    border: 1px solid var(--tg-theme-hint-color, #e9ecef);
}

.action-btn.danger {
    background: #dc3545;
    color: white;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-icon {
    font-size: 18px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    backdrop-filter: blur(20px);
    margin: 10vh auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.close-btn-bottom {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 200px;
}

.close-btn-bottom:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.close-btn-bottom:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Стили для модального окна с iframe оплаты */
.payment-iframe-content {
    width: 95%;
    max-width: 600px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
}

.payment-iframe-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#payment-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
    border-radius: 0 0 20px 20px;
}

@media (max-width: 768px) {
    .payment-iframe-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .payment-iframe-content .modal-header {
        border-radius: 0;
    }
    
    #payment-iframe {
        border-radius: 0;
    }
}

.key-detail-full h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.detail-section p {
    font-size: 14px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.9);
}

/* Стили для вкладок соглашения и политики конфиденциальности */
.agreement-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.agreement-tab {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.agreement-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.agreement-tab.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-bottom-color: #ffffff;
    font-weight: 600;
}

.agreement-content {
    display: none;
    max-height: 60vh;
    overflow-y: auto;
    padding: 8px 0;
}

.agreement-content.active {
    display: block;
}

.agreement-text {
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
}

.agreement-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 12px;
    color: #ffffff;
}

.agreement-text h4:first-child {
    margin-top: 0;
}

.agreement-text p {
    font-size: 14px;
    margin-bottom: 12px;
    text-align: justify;
}

.agreement-text ul {
    margin-left: 20px;
    margin-bottom: 12px;
    padding-left: 0;
}

.agreement-text li {
    font-size: 14px;
    margin-bottom: 8px;
    list-style-type: disc;
}

.agreement-text a {
    color: #ffffff;
    text-decoration: underline;
}

.agreement-text a:hover {
    opacity: 0.8;
}

.agreement-date {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* Адаптивность для профиля */
@media (max-width: 480px) {
    .profile-card-large {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .profile-avatar-large img {
        width: 100px;
        height: 100px;
    }
    
    .stats-grid-large {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon-large {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .key-actions {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    /* Парящее меню на мобильных */
    .app-container {
        padding-bottom: 90px;
    }
}

/* Стили для страницы подписки */
.current-subscription {
    margin-bottom: 24px;
}

.subscription-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.subscription-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.subscription-status {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.subscription-status.active {
    background: #28a745;
    color: white;
}

.subscription-status.trial {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.subscription-info {
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.info-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.subscription-progress {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--tg-theme-hint-color, #e9ecef);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    display: block;
}

/* Тарифные планы */
.tariff-plans {
    margin-bottom: 24px;
}

.tariff-plans h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Новый блок выбора устройств/тарифов */
.tariff-subtitle { color: rgba(255,255,255,0.85); margin-top: 6px; margin-bottom: 12px; }

.devices-select { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.devices-label { font-weight: 700; margin-bottom: 10px; }
.devices-slider { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; padding: 10px 12px; background: rgba(0,0,0,0.2); border-radius: 999px; }
.devices-slider .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5); background: transparent; cursor: pointer; }
.devices-slider .dot.active { background: #14b8a6; border-color: #14b8a6; box-shadow: 0 0 0 6px rgba(20,184,166,0.25); }

.plans-grid.modern { grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-modern { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; border-radius: 16px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 255, 0.95)); border: 2px solid rgba(100, 100, 255, 0.3); color: #1a1a2e; text-align: left; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, border .2s ease; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); }
.plan-modern:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.plan-modern .plan-modern-title { font-weight: 700; color: #1a1a2e; }
.plan-modern .plan-modern-price { font-size: 22px; font-weight: 800; color: #2c3e50; }
.plan-modern .plan-modern-note { font-size: 12px; color: #555; font-weight: 500; }
.plans-grid.modern .plan-modern.popular {
    position: relative;
    border-color: rgba(124,58,237,0.6);
    background: linear-gradient(160deg, rgba(15,23,42,0.85), rgba(30,27,75,0.85));
    box-shadow: 0 12px 28px rgba(124,58,237,0.35);
}
.plan-modern.popular .plan-modern-title,
.plan-modern.popular .plan-modern-price,
.plan-modern.popular .plan-modern-note { color: #ffffff; }

/* Выделение выбранной карточки тарифа (для всех, включая популярный) */
.plans-grid.modern .plan-modern.selected {
    border-color: #007bff;
    background: linear-gradient(135deg, #007bff, #0056b3);
    box-shadow: 0 12px 28px rgba(0, 123, 255, 0.4);
}

.plan-modern.selected .plan-modern-title,
.plan-modern.selected .plan-modern-price,
.plan-modern.selected .plan-modern-note {
    color: #ffffff !important;
}
.plans-grid.modern .plan-modern.popular.selected {
    border-color: rgba(20,184,166,0.9);
    background: linear-gradient(135deg, rgba(20,184,166,0.35), rgba(14,165,233,0.35));
}
.plan-modern.popular .popular-badge { position: absolute; top: -10px; left: 12px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; }

.pay-modern-btn { width: 100%; margin-top: 16px; background: linear-gradient(135deg,#14b8a6,#0ea5e9); color: #fff; border: none; border-radius: 14px; padding: 14px; font-size: 16px; font-weight: 800; box-shadow: 0 12px 28px rgba(14,165,233,.35); }

@media (max-width: 480px) {
    .plans-grid.modern { grid-template-columns: 1fr 1fr; }
    .devices-slider { grid-template-columns: repeat(6, 1fr); }
}

.plan-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.plan-card.selected {
    border-color: var(--tg-theme-button-color, #007bff);
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.plan-card.popular {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.popular-badge {
    position: absolute;
    top: -8px;
    right: 16px;
    background: #ffc107;
    color: #000000;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.plan-header {
    text-align: center;
    margin-bottom: 16px;
}

.plan-header h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.plan-card.selected .plan-header h4,
.plan-card.popular .plan-header h4 {
    color: #ffffff;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.price {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.plan-card.selected .price {
    color: #ffffff;
}

.period {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.discount {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
    margin-top: 4px;
}

.plan-features {
    margin-bottom: 20px;
}

.feature {
    font-size: 14px;
    margin-bottom: 8px;
    color: #ffffff;
}

.plan-btn {
    width: 100%;
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.plan-btn.primary {
    background: #ffc107;
    color: #000000;
}

.plan-card.selected .plan-btn {
    background: var(--tg-theme-button-text-color, #ffffff);
    color: var(--tg-theme-button-color, #007bff);
}

/* Способы оплаты */
.payment-methods {
    margin-bottom: 24px;
}

.payment-methods h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.payment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.payment-method {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.payment-method:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-method.selected {
    border-color: var(--tg-theme-button-color, #007bff);
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.payment-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.payment-method span {
    font-size: 12px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
}

.payment-method.selected span {
    color: var(--tg-theme-button-text-color, #ffffff);
}

/* Промокоды */
.promo-section {
    margin-bottom: 24px;
}

.promo-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.promo-card {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.promo-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.promo-input {
    flex: 1;
    background: var(--tg-theme-bg-color, #ffffff);
    border: 1px solid var(--tg-theme-hint-color, #e9ecef);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
}

.promo-input:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #007bff);
}

.promo-btn {
    background: var(--tg-theme-button-color, #007bff);
    color: var(--tg-theme-button-text-color, #ffffff);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.promo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.promo-result {
    font-size: 14px;
    font-weight: 500;
}

.promo-success {
    color: #28a745;
}

.promo-error {
    color: #dc3545;
}

/* История платежей */
.payment-history {
    margin-bottom: 24px;
}

.payment-history h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tg-theme-text-color, #000000);
}

.history-item {
    background: var(--tg-theme-secondary-bg-color, #f8f9fa);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.history-icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-theme-button-color, #007bff);
    border-radius: 8px;
    color: var(--tg-theme-button-text-color, #ffffff);
}

.history-content {
    flex: 1;
}

.history-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.history-plan {
    font-size: 16px;
    font-weight: 500;
    color: var(--tg-theme-text-color, #000000);
}

.history-amount {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-button-color, #007bff);
}

.history-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--tg-theme-hint-color, #6c757d);
}

.history-status {
    font-weight: 500;
}

/* Модальное окно оплаты */
.payment-summary {
    margin-bottom: 24px;
}

.payment-summary h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.payment-details {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.95);
}

.detail-row:last-child {
    margin-bottom: 0;
}

.total-row {
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    padding-top: 12px;
    margin-top: 8px;
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
}

.discount-row {
    color: #4ade80;
    font-weight: 600;
}

.payment-actions {
    text-align: center;
    margin-top: 24px;
}

.payment-btn {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 8px 20px rgba(74, 222, 128, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(74, 222, 128, 0.5);
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.payment-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
}

/* Адаптивность для подписки */
@media (max-width: 480px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .payment-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .promo-input-group {
        flex-direction: column;
    }
    
    .history-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .history-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    /* Парящее меню на мобильных */
    .app-container {
        padding-bottom: 90px;
    }
}

/* Стили для страницы настроек */
.vpn-settings, .protocol-settings, .notification-settings, 
.privacy-settings, .advanced-settings, .app-info {
    margin-bottom: 24px;
}

.vpn-settings h3, .protocol-settings h3, .notification-settings h3,
.privacy-settings h3, .advanced-settings h3, .app-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.settings-group {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.setting-item.clickable {
    cursor: pointer;
}

.setting-item.clickable:hover {
    background: var(--tg-theme-bg-color, #ffffff);
    transform: translateX(4px);
}

.setting-info {
    flex: 1;
}

.setting-label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 4px;
}

.setting-description {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.setting-arrow {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-left: 12px;
}

/* Кнопка сброса */
.reset-settings {
    margin-bottom: 24px;
    text-align: center;
}

.reset-btn {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.reset-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Модальные окна для настроек */
.protocol-list, .location-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Адаптивность для настроек */
@media (max-width: 480px) {
    .setting-item {
        padding: 12px;
    }
    
    .setting-label {
        font-size: 15px;
    }
    
    .setting-description {
        font-size: 13px;
    }
    
    /* Парящее меню на мобильных */
    .app-container {
        padding-bottom: 90px;
    }
}

/* Темная тема - отключена, так как используется градиентный фон */
@media (prefers-color-scheme: dark) {
    /* Градиентный фон применяется ко всем темам */
}

/* Стили для страницы выбора устройств - новый дизайн */
.ms_cont_2 {
    display: flex;
    gap: 20px;
    max-width: 1140px;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

.ms_install_right {
    display: flex;
    gap: 47px;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
}

.ms_install_right h2 {
    font-size: 28px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 30px;
    text-transform: none;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 100%;
}

.ms_install_right h2 u {
    color: #6b4aed;
    text-decoration: none;
    font-weight: 800;
}

.ms_cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(1, 1fr);
    grid-gap: 15px;
}

@media (max-width: 1199px) {
    .ms_cards {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        margin-bottom: 30px;
        max-height: 715px;
    }
    .ms_card {
        max-width: none !important;
    }
}

@media (max-width: 991px) {
    .ms_cards {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(1, 1fr);
        max-height: none;
    }
    .ms_cont_2 {
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .ms_install_right {
        width: 100%;
    }
    .ms_install_right h2 {
        font-size: 28px;
        padding: 0 20px;
    }
}

@media (max-width: 767px) {
    .ms_cards {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        width: 100%;
        max-height: 715px;
        margin-top: 30px;
    }
}

@media (max-width: 600px) {
    .ms_install_right h2 {
        font-size: 20px;
        padding: 0 10px;
        margin-bottom: 24px;
    }
}

.ms_card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px 20px;
    transition: 0.5s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 200px;
    min-height: 220px;
    height: auto;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ms_card:hover {
    transform: scale(1.08);
    background: #6b4aed;
    box-shadow: 0px 8px 24px rgba(107, 74, 237, 0.4);
    border-radius: 12px;
    z-index: 10;
    transition: 0.5s ease;
}

.ms_card svg {
    width: 64px;
    height: 64px;
    margin: 16px 0;
    flex-shrink: 0;
}

.ms_card svg path {
    transition: 0.5s ease;
}

.ms_card:hover svg path {
    fill: #fff;
    transition: 0.5s ease;
}

.ms_card p {
    color: #000;
    font-size: 18px;
    font-weight: 600;
    margin: 12px 0 8px 0;
    transition: 0.5s ease;
    flex-shrink: 0;
}

.ms_card:hover p {
    color: #fff;
    transition: 0.5s ease;
}

.ms_card a {
    border-width: 0;
    font-weight: 700;
    font-size: 12px;
    max-height: 0;
    padding: 0;
    overflow: hidden;
    transition: 0.5s ease, opacity 0s;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 6px;
    display: inline-block;
    text-decoration: none;
    white-space: nowrap;
}

.ms_card:hover a {
    opacity: 1;
    max-height: 40px;
    padding: 8px 20px;
    border-width: 2px;
    margin-top: 12px;
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.badge-primary {
    background: #007bff;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

.text-warning {
    color: #ff9800;
}

.text-danger {
    color: #dc3545;
}
.setup-page .ms_cont_2 {
    padding: 0;
}

.setup-page .ms_install_right {
    padding: 0;
}

@media (max-width: 480px) {
    .setup-page .ms_cards {
        gap: 12px;
    }
    
    .setup-page .ms_card {
        max-width: none;
        min-height: 200px;
        padding: 20px 16px;
    }
    
    .setup-page .ms_card svg {
        width: 56px;
        height: 56px;
        margin: 12px 0;
    }
    
    .setup-page .ms_card p {
        font-size: 16px;
        margin: 10px 0 6px 0;
    }
    
    .setup-page .ms_card:hover a {
        padding: 7px 18px;
        font-size: 11px;
    }
}
