/* ========================================
   JUST VPN - Telegram WebApp Styles
   ======================================== */

:root {
    /* Telegram Theme Variables */
    --tg-theme-bg-color: var(--tg-theme-bg-color, #ffffff);
    --tg-theme-text-color: var(--tg-theme-text-color, #000000);
    --tg-theme-hint-color: var(--tg-theme-hint-color, #999999);
    --tg-theme-link-color: var(--tg-theme-link-color, #2481cc);
    --tg-theme-button-color: var(--tg-theme-button-color, #2481cc);
    --tg-theme-button-text-color: var(--tg-theme-button-text-color, #ffffff);
    --tg-theme-secondary-bg-color: var(--tg-theme-secondary-bg-color, #f0f0f0);
    
    /* Custom Variables */
    /* main page gradient: dark blue/purple to cyan/pink matching logo (VPNUS style) */
    --bg-gradient: linear-gradient(135deg, #0a0e1a 0%, #1a1040 35%, #2a4060 70%, #3d5f7f 100%);
    --card-bg: rgba(8,10,20,0.45);
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --shadow: 0 8px 30px rgba(12, 10, 30, 0.6);
    --transition: all 0.2s ease;
    
    /* Status Colors */
    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;
}

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

:root {
    --vh: 1vh;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center top;
    color: #eef2ff;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 100%;
    min-height: 100vh;
}

/* ========================================
   Screens
   ======================================== */

.screen {
    display: none;
    min-height: 100vh;
    padding-top: 60px;
    padding-bottom: 20px;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Loading Screen
   ======================================== */

#loading-screen {
    align-items: center;
    justify-content: center;
}

#loading-screen.active {
    display: flex;
}

.loader {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tg-theme-secondary-bg-color);
    border-top-color: var(--tg-theme-button-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Анимация для экрана успешной оплаты */
@keyframes successPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px 10px rgba(0, 255, 136, 0.2); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
}

@keyframes checkmark {
    0% { stroke-dashoffset: 50; }
    100% { stroke-dashoffset: 0; }
}

#payment-success-screen .success-icon {
    animation: successPulse 2s ease-in-out infinite;
}

#payment-success-screen .success-icon svg polyline {
    stroke-dasharray: 50;
    stroke-dashoffset: 0;
    animation: checkmark 0.6s ease-out forwards;
}

.loader p {
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

/* ========================================
   Header
   ======================================== */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-logo {
    width: 64px;
    height: 64px;
    display: inline-block;
    object-fit: contain;
    margin-right: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--tg-theme-secondary-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
}

.user-status {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
}

.balance-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    color: #fff;
    padding: 10px 16px;
    border-radius: 22px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.06);
}

.balance-badge:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0.08));
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(187,134,252,0.15);
}

.balance-badge:active {
    transform: scale(0.95);
}

/* ========================================
   Subscription Card
   ======================================== */

.subscription-card {
    margin: 16px;
    padding: 22px;
    background: rgba(6, 8, 20, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 18px;
    color: #fff;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.05);
}

.sub-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
    animation: pulse 2s infinite;
}

.status-indicator.active {
    background: var(--success);
}

.status-indicator.expired {
    background: var(--danger);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Success screen animations */
@keyframes successPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 60px rgba(0, 212, 255, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 80px rgba(0, 255, 136, 0.5);
    }
}

.status-text {
    font-weight: 600;
    font-size: 18px;
}

.sub-expiry {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.sub-devices {
    font-size: 13px;
    opacity: 0.8;
}

/* ========================================
   Quick Actions
   ======================================== */

.quick-actions {
    display: flex;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 20px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn.primary {
    background: linear-gradient(90deg, #00d4ff 0%, #bb86fc 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(187,134,252,0.24);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(124,58,237,0.35);
}

.action-btn.secondary {
    background: transparent;
    color: #e6eefc;
    border: 1px solid rgba(255,255,255,0.06);
}

.action-btn.secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(100,150,255,0.15);
}

.action-btn:active {
    transform: scale(0.97);
}

/* ========================================
   Menu Grid
   ======================================== */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px;
}

.menu-item {
    background: rgba(255,255,255,0.03);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.menu-item:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 28px rgba(124,58,237,0.25);
    border: 1px solid rgba(255,255,255,0.1);
}

.menu-item:active {
    transform: scale(0.97);
    opacity: 0.8;
}

.menu-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.menu-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.menu-desc {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

/* ========================================
   Screen Header
   ======================================== */

.screen-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--tg-theme-bg-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
}

.screen-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.content {
    padding: 16px;
}

/* ========================================
   Info Card
   ======================================== */

.info-card {
    background: rgba(255,255,255,0.03);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

.info-value {
    font-weight: 600;
    font-size: 14px;
}

/* ========================================
   Key Section
   ======================================== */

.key-section {
    background: rgba(255,255,255,0.03);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 20px;
}

.key-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-section h3 i {
    font-size: 18px;
}

.key-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.key-container input {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius-sm);
    background: var(--tg-theme-bg-color);
    font-size: 12px;
    font-family: monospace;
    color: var(--tg-theme-text-color);
}

.copy-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(90deg, #00d4ff 0%, #bb86fc 100%);
    border-radius: var(--border-radius-sm);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: 2px;
}

.copy-btn i {
    font-size: 18px;
}

.copy-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(124,58,237,0.28);
}

.copy-btn:active {
    transform: scale(0.95);
}
.btn-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    width: 100%;
}

.btn-pill.primary {
    background: linear-gradient(90deg, #00d4ff 0%, #bb86fc 100%);
    color: #021024;
    box-shadow: 0 12px 28px rgba(187,134,252,0.18);
}

.btn-pill.primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 50px rgba(124,58,237,0.42);
}

.btn-pill.primary:active {
    transform: scale(0.97);
}

.btn-pill.primary:active {
    transform: scale(0.98);
}

.btn-pill.outlined {
    background: transparent;
    color: #e6eefc;
    border: 1.5px solid rgba(255,255,255,0.15);
}

.btn-pill.outlined:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 24px rgba(100,150,255,0.15);
}

.btn-pill.outlined:active {
    transform: scale(0.95);
}

.copy-btn:active {
    transform: scale(0.95);
}

/* ========================================
   Buttons
   ======================================== */

.btn-full {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-full svg {
    flex-shrink: 0;
}

.btn-full.primary {
    background: linear-gradient(90deg, #00d4ff 0%, #bb86fc 100%);
    color: #fff;
    box-shadow: 0 12px 30px rgba(187,134,252,0.35);
}

.btn-full.primary:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 20px 50px rgba(124,58,237,0.42);
}

.btn-full.secondary {
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

.btn-full.secondary:hover {
    opacity: 0.85;
    transform: translateY(-2px) scale(1.02);
    background: rgba(255,255,255,0.08);
}

.btn-full.success {
    background: var(--success);
    color: #fff;
}

.btn-full.success:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px rgba(52, 199, 89, 0.35);
}

.btn-full:active {
    transform: scale(0.98);
}

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

/* ========================================
   Section Title
   ======================================== */

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 8px;
}

/* ========================================
   Plans Grid
   ======================================== */

.plans-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.plan-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 12px 32px rgba(124,58,237,0.2);
}

.plan-card:active {
    transform: scale(0.98);
}

.plan-card.popular {
    border-color: rgba(255,255,255,0.06);
    background: linear-gradient(135deg, rgba(124,58,237,0.08) 0%, rgba(6,182,212,0.04) 100%);
}

.plan-card.popular::before {
    content: 'Выгодно';
    position: absolute;
    top: -10px;
    right: 16px;
    background: var(--tg-theme-button-color);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 600;
}

.plan-card {
    position: relative;
}

.plan-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-name {
    font-weight: 600;
    font-size: 16px;
}

.plan-desc {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
}

.plan-price {
    text-align: right;
}

.plan-price .price {
    font-weight: 700;
    font-size: 20px;
}

.plan-price .old-price {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    text-decoration: line-through;
}

/* ========================================
   Trial Section
   ======================================== */

.trial-section {
    margin-top: 20px;
}

.trial-card {
    background: linear-gradient(135deg, var(--success) 0%, #2db04c 100%);
    border-radius: var(--border-radius);
    padding: 20px;
    color: #fff;
    text-align: center;
}

.trial-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.trial-card p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.trial-card .btn-full.success {
    background: #fff;
    color: var(--success);
}

/* ========================================
   Payment Methods
   ======================================== */

.payment-summary {
    text-align: center;
    padding: 24px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.payment-plan {
    font-size: 16px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 8px;
}

.payment-price {
    font-size: 36px;
    font-weight: 700;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--card-bg);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

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

.pm-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-theme-bg-color);
    border-radius: 12px;
    font-size: 24px;
}

.pm-name {
    font-weight: 600;
    font-size: 15px;
    display: block;
    color: #fff;
}

.pm-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.promo-section {
    display: flex;
    gap: 8px;
}

.promo-section input {
    flex: 1;
    padding: 14px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius-sm);
    background: var(--card-bg);
    font-size: 14px;
    color: var(--tg-theme-text-color);
}

.btn-apply {
    padding: 14px 20px;
    background: var(--tg-theme-secondary-bg-color);
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

/* ========================================
   Devices
   ======================================== */

.devices-info {
    text-align: center;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 16px;
}

.devices-info span {
    font-weight: 700;
}

.devices-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
}

.device-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-icon {
    font-size: 24px;
}

.device-name {
    font-weight: 600;
    font-size: 15px;
}

.device-status {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.device-status.online {
    color: var(--success);
}

.device-delete {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 59, 48, 0.1);
    border-radius: 50%;
    color: var(--danger);
    font-size: 16px;
    cursor: pointer;
}

.extra-devices-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
}

.extra-devices-section h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.extra-devices-section p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 12px;
}

/* ========================================
   Referrals
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    text-align: center;
}

.stat-card.accent {
    background: linear-gradient(135deg, var(--success) 0%, #2db04c 100%);
    color: #fff;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
}

.stat-label {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    margin-top: 4px;
}

.stat-card.accent .stat-label {
    color: rgba(255,255,255,0.8);
}

.referral-link-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.referral-link-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.link-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.link-container input {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius-sm);
    background: var(--tg-theme-bg-color);
    font-size: 13px;
    color: var(--tg-theme-text-color);
}

.withdraw-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.withdraw-section h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.withdraw-info {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 12px;
}

.referral-terms {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px;
}

.referral-terms h4 {
    font-size: 15px;
    margin-bottom: 12px;
}

.referral-terms ul {
    list-style: none;
}

.referral-terms li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

/* ========================================
   Instructions
   ======================================== */

.platform-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.tab {
    padding: 10px 16px;
    background: var(--card-bg);
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.tab.active {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

.platform-content {
    animation: fadeIn 0.3s ease;
}

.instruction-step {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
}

.instruction-step:last-child {
    border-bottom: none;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 15px;
    margin-bottom: 6px;
}

.step-content p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    line-height: 1.5;
    margin-bottom: 10px;
}

.download-btn {
    display: inline-block;
    padding: 10px 16px;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-right: 8px;
    margin-top: 4px;
}

/* ========================================
   Support
   ======================================== */

.support-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.support-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.support-icon i {
    font-size: 48px;
}

.support-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.support-card p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 16px;
}

/* ========================================
   FAQ
   ======================================== */

.faq-preview, .faq-list {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.faq-preview h3 {
    padding: 16px;
    font-size: 16px;
}

.faq-item {
    border-top: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
}

.faq-question {
    padding: 16px;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-question::after {
    content: '▼';
    font-size: 10px;
    color: var(--tg-theme-hint-color);
    transition: var(--transition);
}

.faq-item.open .faq-question::after {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 16px 16px;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    line-height: 1.5;
    display: none;
}

.faq-item.open .faq-answer {
    display: block;
}

/* ========================================
   Modal
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--tg-theme-bg-color);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 16px;
}

/* ========================================
   Toast
   ======================================== */

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* ========================================
   Responsive
   ======================================== */

@media (min-width: 400px) {
    .stats-grid {
        gap: 16px;
    }
    
    .stat-value {
        font-size: 26px;
    }
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
    .info-row {
        border-color: rgba(255,255,255,0.1);
    }
    
    .key-container input,
    .link-container input,
    .promo-section input {
        border-color: rgba(255,255,255,0.1);
    }
}

/* ========================================
   Profile Screen Styles
   ======================================== */

.profile-user-card {
    background: rgba(255,255,255,0.03);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.profile-user-name {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.profile-user-id-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-user-id {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-id-copy-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: rgba(255,255,255,0.7);
}

.profile-id-copy-btn:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.3);
    color: #00d4ff;
    transform: scale(1.05);
}

.profile-id-copy-btn:active {
    transform: scale(0.95);
}

.profile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.profile-menu-item {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.05);
}

.profile-menu-item:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(4px);
    border-color: rgba(255,255,255,0.12);
}

.profile-menu-item:active {
    transform: scale(0.98);
}

.profile-menu-item-highlighted {
    background: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.2);
}

.profile-menu-item-highlighted:hover {
    background: rgba(0, 212, 255, 0.18);
    border-color: rgba(0, 212, 255, 0.3);
}

.profile-item-left {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}

.profile-item-left svg {
    flex-shrink: 0;
}

.profile-item-left i {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.profile-referral-section {
    background: rgba(255,255,255,0.03);
    border-radius: var(--border-radius);
    padding: 18px;
    margin-bottom: 16px;
}

.profile-referral-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: rgba(255,255,255,0.8);
}

.profile-referral-link {
    display: flex;
    gap: 8px;
}

.profile-referral-link input {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    font-size: 13px;
    color: #fff;
    font-family: monospace;
}

.profile-copy-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(90deg, #00d4ff 0%, #bb86fc 100%);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-copy-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(124,58,237,0.3);
}

.profile-copy-btn:active {
    transform: scale(0.95);
}

.profile-devices-section {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.05);
}

.profile-devices-section:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(4px);
    border-color: rgba(255,255,255,0.12);
}

.profile-devices-section:active {
    transform: scale(0.98);
}

.profile-devices-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.profile-devices-left svg {
    flex-shrink: 0;
}

#profile-devices-count {
    color: rgba(255,255,255,0.7);
    font-weight: 600;
}

/* ========================================
   Main Screen New Design
   ======================================== */

.main-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px 30px;
}

.main-logo {
    width: auto;
    height: 80px;
    max-width: 140px;
    margin-bottom: 16px;
    object-fit: contain;
}

.app-name {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.main-subscription-status {
    margin: 0 16px 24px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.04);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}

.main-subscription-status .subscription-text {
    font-size: 16px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
}

.main-subscription-status .subscription-text.active {
    color: rgba(255,255,255,0.9);
}

.main-subscription-status .subscription-text.active .status-active {
    color: #4caf50;
}

.main-subscription-status .subscription-text.expired {
    color: #ffa726;
}

/* Контейнер для кнопок */
.main-actions-container {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 20px 16px;
    margin: 0 16px 20px;
}

.main-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.main-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 14px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.main-btn svg:first-child {
    flex-shrink: 0;
}

.main-btn span {
    flex: 1;
    text-align: left;
}

.main-btn svg:last-child {
    flex-shrink: 0;
    opacity: 0.6;
}

.main-btn.primary {
    background: linear-gradient(90deg, #00d4ff 0%, #00b8d4 100%);
    color: #0a1929;
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

.main-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.4);
}

.main-btn.secondary {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.2);
}

.main-btn.secondary:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.main-btn:active {
    transform: scale(0.98);
}

.main-bottom-actions {
    display: flex;
    gap: 12px;
}

.main-bottom-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.main-bottom-btn svg,
.main-bottom-btn i {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.main-bottom-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

.main-bottom-btn:active {
    transform: scale(0.98);
}

/* ========================================
   Setup Flow Styles
   ======================================== */

.setup-flow-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    padding: 20px;
}

.setup-step {
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.setup-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(187, 134, 252, 0.15));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.2);
    position: relative;
}

.setup-icon i {
    color: #00d4ff;
    background: linear-gradient(135deg, #00d4ff, #bb86fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.setup-icon.success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(102, 187, 106, 0.15));
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.2);
}

.setup-icon svg {
    color: #00d4ff;
    display: block;
    margin: 0 auto;
}

.setup-icon i {
    color: #00d4ff;
    background: linear-gradient(135deg, #00d4ff, #bb86fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 0;
    display: block;
}

.setup-icon.success svg {
    color: #4caf50;
}

.setup-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.setup-description {
    font-size: 15px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 32px;
    line-height: 1.5;
}

.setup-btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 12px;
}

.setup-btn.primary {
    background: linear-gradient(90deg, #00d4ff 0%, #00b8d4 100%);
    color: #0a1929;
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

.setup-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.4);
}

.setup-btn.secondary {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.2);
}

.setup-btn.secondary:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.3);
}

.setup-btn:active {
    transform: scale(0.98);
}

.setup-link-box {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255,255,255,0.04);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.setup-link-box input {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    font-family: monospace;
}

.setup-copy-btn {
    padding: 12px 16px;
    background: rgba(0, 212, 255, 0.15);
    border: none;
    border-radius: 8px;
    color: #00d4ff;
    cursor: pointer;
    transition: var(--transition);
}

.setup-copy-btn:hover {
    background: rgba(0, 212, 255, 0.25);
    transform: scale(1.05);
}

.setup-copy-btn:active {
    transform: scale(0.95);
}

.device-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.device-selector-content {
    background: rgba(15, 23, 41, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.1);
}

.device-selector-content h3 {
    font-size: 22px;
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
}

.device-option {
    width: 100%;
    padding: 16px;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-option i {
    font-size: 28px;
    color: #fff;
    flex-shrink: 0;
    opacity: 0.9;
}

.device-option span {
    flex: 1;
    text-align: left;
}

.device-option:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.25);
    transform: translateX(4px);
}

.device-option:hover i {
    opacity: 1;
}

.device-option:active {
    transform: scale(0.98);
}
