/* ==================== VARIABLES ==================== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #161616;
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-card-hover: rgba(255, 255, 255, 0.04);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-tertiary: rgba(255, 255, 255, 0.3);
    
    --accent: #ffffff;
    --accent-dim: rgba(255, 255, 255, 0.1);
    
    --success: #22c55e;
    --warning: #eab308;
    --error: #ef4444;
    --info: #6b7280;
    
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    --transition: 0.2s ease;
    --transition-slow: 0.4s ease;
}

/* ==================== RESET ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==================== BACKGROUND ==================== */
.bg-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255,255,255,0.03), transparent);
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px 16px 100px;
}

/* ==================== HEADER ==================== */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 24px;
}

.header__logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    color: var(--text-primary);
    opacity: 0.9;
}

.header__logo svg {
    width: 100%;
    height: 100%;
}

.header__title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.header__subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 12px;
    transition: all var(--transition);
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card__title {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.card__badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--success);
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 20px;
}

.card__badge--warning {
    color: var(--warning);
    background: rgba(234, 179, 8, 0.1);
}

.card__badge--error {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* ==================== STATUS ==================== */
.status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status__text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.status--loading .status__dot {
    background: var(--text-secondary);
    animation: pulse 1.5s ease-in-out infinite;
}

.status--success {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.1);
}

.status--success .status__dot {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status--success .status__text {
    color: var(--success);
}

.status--warning {
    background: rgba(234, 179, 8, 0.05);
    border: 1px solid rgba(234, 179, 8, 0.1);
}

.status--warning .status__dot {
    background: var(--warning);
}

.status--warning .status__text {
    color: var(--warning);
}

.status--error {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.status--error .status__dot {
    background: var(--error);
}

.status--error .status__text {
    color: var(--error);
}

.status--info .status__dot {
    background: var(--info);
}

.status--info .status__text {
    color: var(--text-secondary);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ==================== BUTTONS ==================== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn--primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn--primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn--ghost:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

.btn__arrow {
    width: 18px;
    height: 18px;
    transition: transform var(--transition);
}

.btn:hover .btn__arrow {
    transform: translateX(3px);
}

.btn__loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: var(--bg-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== VPN LINK ==================== */
.vpn-link {
    margin-top: 16px;
}

.vpn-link__label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.vpn-link__code {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: 'SF Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    word-break: break-all;
    margin-bottom: 12px;
    max-height: 70px;
    overflow-y: auto;
}

/* ==================== STATS ROW ==================== */
.stats-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ==================== CIRCLE PROGRESS ==================== */
.circle-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.circle-progress {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.circle-progress__bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.circle-progress__fill {
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease;
}

.circle-progress__fill--warning {
    stroke: var(--warning);
}

.circle-progress__fill--danger {
    stroke: var(--error);
}

.circle-stat__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.circle-stat__value {
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.circle-stat__separator {
    width: 24px;
    height: 1px;
    background: var(--border-hover);
    margin: 4px 0;
}

.circle-stat__limit {
    font-size: 12px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.circle-stat__label {
    margin-top: 12px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* ==================== SIMPLE STAT ==================== */
.simple-stat {
    flex: 1;
    text-align: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.simple-stat__value {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.simple-stat__label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* ==================== PLANS ==================== */
.plans {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plan {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.plan:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.plan:active {
    transform: translateX(2px);
}

.plan--featured {
    border-color: var(--border-hover);
}

.plan--featured::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--text-primary);
}

.plan__badge {
    position: absolute;
    top: -1px;
    right: 16px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bg-primary);
    background: var(--text-primary);
    padding: 4px 8px;
    border-radius: 0 0 6px 6px;
}

.plan__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan__name {
    font-size: 15px;
    font-weight: 600;
}

.plan__price {
    font-size: 18px;
    font-weight: 600;
}

.plan__period {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-tertiary);
}

.plan__features {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.plan__dot {
    width: 3px;
    height: 3px;
    background: var(--text-tertiary);
    border-radius: 50%;
}

/* ==================== ANIMATIONS ==================== */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-1 { animation-delay: 0.05s; opacity: 0; }
.delay-2 { animation-delay: 0.1s; opacity: 0; }
.delay-3 { animation-delay: 0.15s; opacity: 0; }
.delay-4 { animation-delay: 0.2s; opacity: 0; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 380px) {
    .container {
        padding: 16px 14px 80px;
    }
    
    .header__title {
        font-size: 20px;
        letter-spacing: 3px;
    }
    
    .card {
        padding: 20px;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .simple-stat {
        width: 100%;
    }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .container {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== DISCOUNT BANNER ==================== */
.discount-banner {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.discount-banner__icon {
    width: 40px;
    height: 40px;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.discount-banner__content {
    flex: 1;
}

.discount-banner__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 2px;
}

.discount-banner__text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== PRICE WITH DISCOUNT ==================== */
.plan__price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.plan__price--original {
    font-size: 13px;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.plan__price--discounted {
    font-size: 18px;
    font-weight: 600;
    color: var(--success);
}