/**
 * VPN Service - Clean Auth Interface
 * Минималистичный iOS дизайн только для авторизации
 */

/* Modern iOS Variables */
:root {
	/* iOS Colors */
	--ios-primary: #007AFF;
	--ios-success: #30D158;
	--ios-error: #FF453A;
	
	/* Backgrounds */
	--bg-primary: #000000;
	--bg-secondary: #1C1C1E;
	--bg-system-grouped-secondary: #1C1C1E;
	
	/* Text Colors */
	--label-primary: #FFFFFF;
	--label-secondary: #EBEBF5;
	--label-tertiary: rgba(235, 235, 245, 0.6);
	
	/* Fill Colors */
	--fill-primary: rgba(120, 120, 128, 0.36);
	--separator: rgba(84, 84, 88, 0.65);
	
	/* Typography */
	--text-largeTitle: 2.125rem;
	--text-title3: 1.25rem;
	--text-headline: 1.0625rem;
	--text-body: 1.0625rem;
	--text-footnote: 0.8125rem;
	
	/* Spacing */
	--spacing-xs: 0.25rem;
	--spacing-sm: 0.5rem;
	--spacing-md: 0.75rem;
	--spacing-lg: 1rem;
	--spacing-xl: 1.25rem;
	--spacing-2xl: 1.5rem;
	--spacing-3xl: 2rem;
	--spacing-4xl: 2.5rem;
	--spacing-5xl: 3rem;
	
	/* Effects */
	--radius-lg: 0.75rem;
	--radius-xl: 1rem;
	--radius-2xl: 1.25rem;
	--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
	--blur-light: blur(20px);
	--transition-normal: all 0.2s ease;

	/* Общий отступ от верха (все экраны пользовательского приложения) */
	--page-top-inset: 35px;
}

/* Base Reset */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
	font-size: var(--text-body);
	font-weight: 400;
	line-height: 1.47;
	color: var(--label-primary);
	background: var(--bg-primary);
	min-height: 100vh;
	min-height: 100dvh;
	overflow-x: hidden;
	margin: 0;
	padding: 0;
	padding-top: var(--page-top-inset);
}

/* App Container - Full Width */
.app {
	position: relative;
	min-height: calc(100vh - var(--page-top-inset));
	min-height: calc(100dvh - var(--page-top-inset));
	width: 100vw;
	display: flex;
	flex-direction: column;
	background: var(--bg-primary);
}

/* Main Content */
.main {
	flex: 1;
	width: 100%;
	position: relative;
}

/* Auth Section - Full Width */
.auth-section {
	min-height: calc(100vh - var(--page-top-inset));
	min-height: calc(100dvh - var(--page-top-inset));
	width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: var(--spacing-4xl) var(--spacing-3xl);
	box-sizing: border-box;
}

/* Welcome Content */
.welcome-content {
	text-align: center;
	margin-bottom: var(--spacing-5xl);
	width: 100%;
}

.welcome-title {
	font-size: var(--text-largeTitle);
	font-weight: 700;
	color: var(--label-primary);
	margin-bottom: var(--spacing-xl);
	letter-spacing: -0.025em;
	line-height: 1.1;
}

.welcome-subtitle {
	font-size: var(--text-title3);
	font-weight: 400;
	color: var(--label-secondary);
	line-height: 1.25;
}

/* Forms */
.auth-form {
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	gap: var(--spacing-3xl);
}

.form-section {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-lg);
}

.form-label {
	font-size: var(--text-headline);
	font-weight: 600;
	color: var(--label-primary);
	letter-spacing: -0.022em;
}

/* Input Fields */
.input-group {
	position: relative;
}

.input-field {
	width: 100%;
	padding: var(--spacing-xl);
	background: var(--bg-system-grouped-secondary);
	border: 1px solid var(--separator);
	border-radius: var(--radius-xl);
	color: var(--label-primary);
	font-size: var(--text-body);
	font-weight: 400;
	outline: none;
	transition: var(--transition-normal);
	-webkit-appearance: none;
}

.input-field::placeholder {
	color: var(--label-tertiary);
}

.input-field:focus {
	border-color: var(--ios-primary);
	background: var(--bg-secondary);
	box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Buttons */
.btn-primary, .btn-secondary {
	position: relative;
	width: 100%;
	padding: var(--spacing-lg) var(--spacing-xl);
	border: none;
	border-radius: var(--radius-xl);
	font-size: var(--text-body);
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition-normal);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-md);
	min-height: 40px;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.btn-primary {
	background: var(--ios-primary);
	color: white;
	box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
	background: #0056CC;
	transform: translateY(-1px);
}

.btn-primary:active {
	transform: scale(0.98);
}

.btn-secondary {
	background: transparent;
	color: var(--ios-primary);
	border: 1px solid var(--separator);
}

.btn-secondary:hover {
	background: var(--bg-secondary);
}

.btn-secondary:active {
	transform: scale(0.98);
}

.btn-text {
	display: block;
}

.btn-spinner {
	display: none;
	width: 20px;
	height: 20px;
	border: 2px solid transparent;
	border-top: 2px solid currentColor;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

.loading .btn-text {
	display: none;
}

.loading .btn-spinner {
	display: block;
}

/* Стили для кнопок предустановленных сумм */
.preset-amounts {
	margin: 12px 0;
}

.amount-buttons-container {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 4px 2px 8px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.amount-buttons-container::-webkit-scrollbar {
	display: none;
}

.amount-preset-btn {
	flex-shrink: 0;
	background: rgba(120, 120, 128, 0.12);
	border: 1px solid rgba(120, 120, 128, 0.16);
	border-radius: 8px;
	color: var(--text-primary);
	font-size: 13px;
	font-weight: 500;
	padding: 8px 12px;
	transition: all 0.2s ease-in-out;
	white-space: nowrap;
	cursor: pointer;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	position: relative;
	overflow: hidden;
}

.amount-preset-btn:hover {
	background: rgba(120, 120, 128, 0.18);
	border-color: rgba(120, 120, 128, 0.24);
	transform: scale(0.95);
}

.amount-preset-btn:active,
.amount-preset-btn.selected {
	background: rgba(0, 122, 255, 0.15);
	border-color: var(--ios-primary);
	color: var(--ios-primary);
	transform: scale(0.92);
}

/* Плавная анимация при выборе */
.amount-preset-btn.pulse {
	animation: preset-pulse 0.3s ease-out;
}

@keyframes preset-pulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.08); }
	100% { transform: scale(1); }
}

/* Code hint (email reminder) */
.code-hint {
	font-size: var(--text-footnote);
	color: var(--label-tertiary);
	margin: 0;
}

/* Countdown Timer */
.countdown-container {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-sm);
	padding: var(--spacing-md) var(--spacing-xl);
	background: rgba(120, 120, 128, 0.08);
	border-radius: var(--radius-lg);
	border: 1px solid var(--separator);
}

.countdown-label {
	font-size: var(--text-footnote);
	color: var(--label-tertiary);
}

.countdown-timer {
	font-size: var(--text-headline);
	font-weight: 700;
	color: var(--ios-primary);
	font-variant-numeric: tabular-nums;
	transition: color 0.3s ease;
	min-width: 3rem;
	text-align: center;
}

.countdown-timer.countdown-urgent {
	color: var(--ios-error);
	animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.5; }
}

/* User email in dashboard */
/* Email row: email + inline logout */
.user-email-row {
	display: flex;
	align-items: center;
	gap: 8px;
	overflow: hidden;
}

.user-email {
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--label-primary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1;
	min-width: 0;
}

.logout-inline {
	background: none;
	border: 1px solid rgba(255, 69, 58, 0.4);
	color: var(--ios-error);
	font-size: 0.6875rem;
	font-weight: 500;
	cursor: pointer;
	padding: 2px 8px;
	border-radius: 10px;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background 0.15s;
	line-height: 1.6;
}

.logout-inline:active {
	background: rgba(255, 69, 58, 0.1);
}


/* Code Input */
.code-section {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-3xl);
	align-items: center;
}

.code-inputs {
	display: flex;
	gap: var(--spacing-lg);
	justify-content: center;
	margin: var(--spacing-2xl) 0;
}

.code-digit {
	width: 3.5rem;
	height: 3.5rem;
	text-align: center;
	font-size: var(--text-title3);
	font-weight: 600;
	color: var(--label-primary);
	background: var(--bg-system-grouped-secondary);
	border: 1px solid var(--separator);
	border-radius: var(--radius-lg);
	outline: none;
	transition: var(--transition-normal);
	caret-color: var(--ios-primary);
}

.code-digit:focus {
	border-color: var(--ios-primary);
	background: var(--bg-secondary);
	box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Dashboard Section */
.dashboard-section {
	height: calc(100vh - var(--page-top-inset));
	height: calc(100dvh - var(--page-top-inset));
	width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	padding: var(--spacing-4xl) var(--spacing-3xl);
	box-sizing: border-box;
}

.dashboard-top {
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	gap: var(--spacing-5xl);
}

.dashboard-bottom {
	width: 100%;
	max-width: 400px;
}

/* Balance Info */
.balance-info {
	display: flex;
	align-items: flex-start;
	gap: var(--spacing-3xl);
	width: 100%;
	max-width: 400px;
}

.referral-qr {
	width: 128px;
	height: 128px;
	border-radius: var(--radius-lg);
	flex-shrink: 0;
	background: #fff;
	object-fit: contain;
}

.balance-details {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	flex: 1;
	min-width: 0;
	min-height: 128px;
}

.balance-title {
	font-size: 1.625rem;
	font-weight: 700;
	color: var(--label-primary);
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.referral-link-wrap {
	display: flex;
	align-items: center;
	gap: 0;
	background: rgba(0, 122, 255, 0.12);
	border: 1px solid rgba(0, 122, 255, 0.28);
	border-radius: 20px;
	padding: 4px 6px 4px 10px;
	overflow: hidden;
}

.referral-link {
	font-size: 10px;
	font-weight: 500;
	color: var(--ios-primary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1;
	min-width: 0;
	line-height: 1.4;
}

.referral-copy-btn {
	background: none;
	border: none;
	color: var(--ios-primary);
	cursor: pointer;
	padding: 2px 4px;
	font-size: 15px;
	line-height: 1;
	flex-shrink: 0;
	opacity: 0.7;
	transition: opacity 0.15s;
}

.referral-copy-btn:active {
	opacity: 1;
	color: var(--ios-success);
}

/* Dashboard Actions */
.dashboard-actions {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: var(--spacing-xl);
}

.dashboard-btn {
	position: relative;
	width: 100%;
	padding: var(--spacing-lg) var(--spacing-xl);
	border: none;
	border-radius: var(--radius-xl);
	font-size: var(--text-body);
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition-normal);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-md);
	min-height: 40px;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	background: var(--ios-primary);
	color: white;
	box-shadow: var(--shadow-lg);
}

.dashboard-btn.topup {
	background: var(--ios-success);
}

.dashboard-btn.topup:hover {
	background: #28B946;
}

.dashboard-btn:hover {
	background: #0056CC;
	transform: translateY(-1px);
}

.dashboard-btn:active {
	transform: scale(0.98);
}

.btn-spacer {
	height: var(--spacing-xl);
}

/* Topup Section */
.topup-section {
	height: calc(100vh - var(--page-top-inset));
	height: calc(100dvh - var(--page-top-inset));
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-sizing: border-box;
	overflow: hidden;
	padding: 0 var(--spacing-3xl);
}

.topup-body {
	flex: 1;
	overflow-y: auto;
	width: 100%;
	max-width: 400px;
	-webkit-overflow-scrolling: touch;
	padding-top: var(--spacing-xl);
}

.topup-form-inner {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-3xl);
}

.topup-actions {
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	gap: var(--spacing-xl);
	padding-bottom: var(--spacing-4xl);
	padding-top: var(--spacing-xl);
}


.hidden {
	display: none !important;
}

.text-center {
	text-align: center;
}

/* Animations */
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes slide-up {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes bounce-in {
	0% {
		opacity: 0;
		transform: scale(0.9);
	}
	50% {
		transform: scale(1.02);
	}
	100% {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes slide-down {
	to {
		opacity: 0;
		transform: translateX(-50%) translateY(20px);
	}
}

@keyframes notification-in {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(-100%);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

@keyframes notification-out {
	to {
		opacity: 0;
		transform: translateX(-50%) translateY(-100%);
	}
}

.slide-up {
	animation: slide-up 0.35s ease-out;
}

.bounce-in {
	animation: bounce-in 0.35s ease-out;
}

.slide-down {
	animation: slide-down 0.35s ease-out;
}

/* Notification Styles */
.notification {
	position: fixed;
	top: var(--spacing-3xl);
	left: 50%;
	transform: translateX(-50%);
	z-index: 1000;
	padding: var(--spacing-lg) var(--spacing-2xl);
	border-radius: var(--radius-xl);
	font-size: var(--text-footnote);
	font-weight: 600;
	color: white;
	max-width: 90vw;
	text-align: center;
	backdrop-filter: var(--blur-light);
	-webkit-backdrop-filter: var(--blur-light);
	animation: notification-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.notification.success {
	background: rgba(48, 209, 88, 0.9);
}

.notification.error {
	background: rgba(255, 69, 58, 0.9);
}

.notification.info {
	background: rgba(0, 122, 255, 0.9);
}

/* Mobile Optimizations */
@media (max-width: 480px) {
	.auth-section {
		padding: var(--spacing-3xl) var(--spacing-2xl);
	}
	
	.welcome-title {
		font-size: 1.75rem;
	}
	
	.code-digit {
		width: 3rem;
		height: 3rem;
	}
	
	.code-inputs {
		gap: var(--spacing-md);
	}
}

/* Landscape Mobile */
@media (max-height: 600px) and (orientation: landscape) {
	.auth-section {
		min-height: auto;
		justify-content: flex-start;
		padding-top: var(--spacing-2xl);
	}
	
	.welcome-content {
		margin-bottom: var(--spacing-2xl);
	}
	
	.welcome-title {
		font-size: 1.5rem;
		margin-bottom: var(--spacing-md);
	}
}

/* ─── Connect / Server List Section ──────────────────────────────────────── */

.connect-section {
	height: calc(100vh - var(--page-top-inset));
	height: calc(100dvh - var(--page-top-inset));
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-sizing: border-box;
	overflow: hidden;
	padding: 0 var(--spacing-3xl);
}

/* Header — строго 400px как кнопки дашборда */
.connect-header {
	width: 100%;
	max-width: 400px;
	display: flex;
	align-items: center;
	gap: var(--spacing-lg);
	padding: var(--spacing-4xl) 0 var(--spacing-2xl);
	flex-shrink: 0;
	box-sizing: border-box;
}

.connect-back {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--bg-secondary);
	border: none;
	color: var(--ios-primary);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.15s;
}

.connect-back:active { background: var(--fill-primary); }

.connect-title {
	font-size: var(--text-title3);
	font-weight: 700;
	color: var(--label-primary);
	margin: 0 0 2px;
	line-height: 1.2;
}

.connect-subtitle {
	font-size: var(--text-footnote);
	color: var(--label-tertiary);
	margin: 0;
}

.connect-title--solo {
	margin-bottom: 0;
}

/* Скроллируемая область — строго 400px */
.server-list-wrap {
	flex: 1;
	overflow-y: auto;
	width: 100%;
	max-width: 400px;
	padding-bottom: var(--spacing-4xl);
	-webkit-overflow-scrolling: touch;
	box-sizing: border-box;
}

/* Стек кнопок — зазор как у кнопок дашборда */
.server-list {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: var(--spacing-xl);
}

/* ── Server card — размер как .dashboard-btn, цвет тёмно-серый ── */
.server-card {
	position: relative;
	width: 100%;
	min-height: 40px;
	padding: var(--spacing-lg) var(--spacing-xl);
	background: var(--bg-secondary);
	color: var(--label-primary);
	border: none;
	border-radius: var(--radius-xl);
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: var(--spacing-md);
	text-align: left;
	font-size: var(--text-body);
	font-weight: 600;
	transition: var(--transition-normal);
	-webkit-tap-highlight-color: transparent;
	box-sizing: border-box;
	outline: none;
}

.server-card:hover  { background: #2C2C2E; transform: translateY(-1px); }
.server-card:active { transform: scale(0.98); }

.server-card--full {
	cursor: default;
	opacity: 0.45;
}
.server-card--full:hover  { background: var(--bg-secondary); transform: none; }
.server-card--full:active { transform: none; }

/* Статус-точка */
.server-card-left { flex-shrink: 0; }

.server-card-dot {
	display: block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
}

.server-card-dot--online {
	background: var(--ios-success);
	box-shadow: 0 0 6px rgba(48, 209, 88, 0.65);
}

.server-card-dot--full { background: var(--label-tertiary); }

/* Название + полоса */
.server-card-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.server-card-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--spacing-md);
}

.server-card-name {
	font-size: var(--text-body);
	font-weight: 600;
	color: var(--label-primary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.server-card-price {
	font-size: var(--text-footnote);
	color: var(--label-tertiary);
	font-weight: 400;
	white-space: nowrap;
	flex-shrink: 0;
}

/* Полоска загрузки — на всю ширину тела карточки */
.server-load-bar {
	width: 100%;
	height: 3px;
	background: var(--fill-primary);
	border-radius: 2px;
	overflow: hidden;
}

.server-load-fill {
	display: block;
	height: 100%;
	border-radius: 2px;
	transition: width 0.5s ease, background 0.5s ease;
}

/* Правая часть */
.server-card-right { flex-shrink: 0; }

.server-chevron { color: var(--label-tertiary); display: block; }

.server-full-badge {
	font-size: 11px;
	font-weight: 600;
	color: var(--label-tertiary);
	background: var(--fill-primary);
	padding: 2px 8px;
	border-radius: 8px;
}

/* Skeleton loader — те же размеры и форма, что у реальных карточек */
.server-skeleton {
	height: 40px;
	background: var(--bg-secondary);
	border-radius: var(--radius-xl);
	overflow: hidden;
	position: relative;
	flex-shrink: 0;
}

.server-skeleton::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255,255,255,0.04) 40%,
		rgba(255,255,255,0.08) 50%,
		rgba(255,255,255,0.04) 60%,
		transparent 100%
	);
	background-size: 200% 100%;
	animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Empty state */
.server-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: var(--spacing-5xl) 0;
	gap: var(--spacing-md);
}

.server-empty-icon {
	font-size: 3rem;
	line-height: 1;
	opacity: 0.4;
}

.server-empty-text {
	font-size: var(--text-body);
	font-weight: 600;
	color: var(--label-secondary);
	margin: 0;
}

.server-empty-hint {
	font-size: var(--text-footnote);
	color: var(--label-tertiary);
	margin: 0;
}

/* ─── Server Detail View ─────────────────────────────────────────────────── */

.server-detail-wrap {
	flex: 1;
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	padding-bottom: var(--spacing-4xl);
	box-sizing: border-box;
	overflow: hidden;
	gap: var(--spacing-3xl);
}

/* Герой: круговой прогресс слева + инфо справа */
.server-detail-hero {
	display: flex;
	align-items: flex-start;
	gap: var(--spacing-3xl);
}

/* Круговой прогресс */
.server-progress-wrap {
	position: relative;
	width: 128px;
	height: 128px;
	flex-shrink: 0;
}

.server-progress-svg {
	width: 128px;
	height: 128px;
	transform: rotate(-90deg); /* начало дуги сверху */
}

.progress-track {
	fill: none;
	stroke: var(--fill-primary);
	stroke-width: 9;
}

.progress-arc {
	fill: none;
	stroke: var(--ios-success);
	stroke-width: 9;
	stroke-linecap: round;
	stroke-dasharray: 326.7;
	stroke-dashoffset: 326.7;
	transition: stroke-dashoffset 0.7s ease, stroke 0.7s ease;
}

/* Процент в центре круга */
.server-progress-pct {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--label-primary);
	letter-spacing: -0.02em;
}

/* Инфо-блок (правая часть) */
.server-detail-info {
	flex: 1;
	min-width: 0;
	min-height: 128px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.server-detail-name {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--label-primary);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.server-detail-row {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.server-detail-label {
	font-size: 10px;
	font-weight: 500;
	color: var(--label-tertiary);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.server-detail-value {
	font-size: var(--text-footnote);
	font-weight: 600;
	color: var(--label-primary);
}

/* Кнопки */
.server-detail-actions {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-xl);
}

.btn-gray {
	background: var(--bg-secondary);
	color: var(--label-primary);
	border: none;
}

.btn-gray:hover { background: #2C2C2E; }
.btn-gray:active { background: var(--fill-primary); }

/* ─── Dashboard bottom — multiple buttons ────────────────────────────────── */

.dashboard-bottom {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-xl);
}

/* ─── My VPNs list view ──────────────────────────────────────────────────── */

.my-vpns-list-view {
	flex: 1;
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	padding-bottom: var(--spacing-4xl);
	box-sizing: border-box;
	overflow: hidden;
	gap: var(--spacing-xl);
}

.my-vpns-scroll {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-direction: column;
	gap: var(--spacing-xl);
}

.my-vpns-balance-card {
	background: var(--bg-secondary);
	border-radius: var(--radius-xl);
	padding: var(--spacing-xl) var(--spacing-2xl);
	display: flex;
	flex-direction: column;
	gap: var(--spacing-md);
	flex-shrink: 0;
}

.my-vpns-balance-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.my-vpns-balance-label {
	font-size: var(--text-footnote);
	color: var(--label-tertiary);
	font-weight: 500;
}

.my-vpns-balance-value {
	font-size: var(--text-footnote);
	font-weight: 600;
	color: var(--label-primary);
}

/* ─── My VPN detail: QR full-height ─────────────────────────────────────── */

.my-vpn-detail-wrap {
	flex: 1;
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	padding-bottom: var(--spacing-4xl);
	box-sizing: border-box;
	overflow: hidden;
	gap: var(--spacing-xl);
}

.my-vpn-qr-area {
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-xl);
	overflow: hidden;
	background: var(--bg-secondary);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.my-vpn-qr-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: var(--radius-xl);
}

/* ─── Compact server card (VPN list inside server detail) ───────────────── */

.server-card--compact {
	min-height: 40px;
	padding: var(--spacing-md) var(--spacing-xl);
}

.server-card--compact .server-card-body {
	gap: 2px;
}

/* ─── My VPNs list inside server detail (scrollable) ────────────────────── */

.server-my-vpns {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: var(--spacing-md);
}

.server-my-vpns-title {
	font-size: var(--text-footnote);
	font-weight: 600;
	color: var(--label-tertiary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 0 2px;
	margin-bottom: 2px;
	flex-shrink: 0;
}

/* ─── Danger button ──────────────────────────────────────────────────────── */

.btn-danger {
	background: rgba(255, 69, 58, 0.15);
	color: var(--ios-error, #FF453A);
	border: 1px solid rgba(255, 69, 58, 0.35);
}

.btn-danger:hover  { background: rgba(255, 69, 58, 0.25); }
.btn-danger:active { background: rgba(255, 69, 58, 0.35); transform: scale(0.98); }

/* ─── Server card: "Мой VPN" badge ──────────────────────────────────────── */

.server-my-vpn-badge {
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--ios-primary);
	background: rgba(0, 122, 255, 0.15);
	border: 1px solid rgba(0, 122, 255, 0.3);
	border-radius: 8px;
	padding: 2px 7px;
	white-space: nowrap;
}

/* ─── VPN Success Screen ─────────────────────────────────────────────────── */

.vpn-success-wrap {
	flex: 1;
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding-bottom: var(--spacing-4xl);
	box-sizing: border-box;
	gap: var(--spacing-3xl);
	overflow: hidden;
}

.vpn-success-scroll {
	flex: 1;
	width: 100%;
	min-height: 0;
	display: flex;
	flex-direction: column;
	padding-top: var(--spacing-xl);
	overflow: hidden;
}

.vpn-success-qr-wrap {
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-xl);
	overflow: hidden;
	background: var(--bg-secondary);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.vpn-success-qr {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: var(--radius-xl);
}

.vpn-config-download {
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	gap: var(--spacing-md);
}

/* ─── Setup Guide Section ────────────────────────────────────────────────── */

.setup-section {
	height: calc(100vh - var(--page-top-inset));
	height: calc(100dvh - var(--page-top-inset));
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-sizing: border-box;
	overflow: hidden;
	padding: 0 var(--spacing-3xl);
}

.setup-platforms-wrap {
	flex: 1;
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding-bottom: var(--spacing-4xl);
	box-sizing: border-box;
	overflow: hidden;
	gap: var(--spacing-3xl);
}

.setup-platforms-scroll {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.setup-platforms-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--spacing-xl);
}

.setup-platform-btn {
	background: var(--bg-secondary);
	border: none;
	border-radius: var(--radius-xl);
	cursor: pointer;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: var(--spacing-xl);
	padding: var(--spacing-lg) var(--spacing-2xl);
	transition: var(--transition-normal);
	-webkit-tap-highlight-color: transparent;
	min-height: 40px;
	width: 100%;
	text-align: left;
}

.setup-platform-btn:hover  { background: #2C2C2E; }
.setup-platform-btn:active { background: var(--fill-primary); transform: scale(0.98); }

.setup-platform-icon {
	font-size: 1.5rem;
	line-height: 1;
	flex-shrink: 0;
}

.setup-platform-name {
	font-size: var(--text-body);
	font-weight: 600;
	color: var(--label-primary);
}

/* Панель инструкций */
.setup-detail-wrap {
	flex: 1;
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding-bottom: var(--spacing-4xl);
	box-sizing: border-box;
	gap: var(--spacing-3xl);
	overflow: hidden;
}

.setup-instructions {
	flex: 1;
	overflow-y: auto;
	background: var(--bg-secondary);
	border-radius: var(--radius-xl);
	padding: var(--spacing-2xl);
	font-size: var(--text-body);
	color: var(--label-primary);
	line-height: 1.7;
	-webkit-overflow-scrolling: touch;
}

.setup-instructions a {
	color: var(--ios-primary);
	text-decoration: none;
}

.setup-instructions a:hover { text-decoration: underline; }

.setup-instructions code {
	background: rgba(120, 120, 128, 0.2);
	border-radius: 4px;
	padding: 1px 5px;
	font-family: ui-monospace, monospace;
	font-size: 0.88em;
}

.setup-instructions strong { color: var(--label-primary); font-weight: 600; }

/* ── Секция «Пригласить» (как .topup-section) ───────────────── */
.invite-section {
	height: calc(100vh - var(--page-top-inset));
	height: calc(100dvh - var(--page-top-inset));
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-sizing: border-box;
	overflow: hidden;
	padding: 0 var(--spacing-3xl);
}

.invite-body {
	flex: 1;
	overflow-y: auto;
	width: 100%;
	max-width: 400px;
	-webkit-overflow-scrolling: touch;
	padding-top: var(--spacing-xl);
	padding-bottom: var(--spacing-2xl);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--spacing-3xl);
}

/* Компактный экран «Пригласить» — одна строка как .balance-info на дашборде */
.invite-body.invite-body--compact {
	padding-top: var(--spacing-md);
	padding-bottom: var(--spacing-lg);
	gap: 0;
}

.invite-overview {
	align-items: flex-start;
}

.invite-overview-details .invite-overview-meta {
	margin: 0;
	font-size: var(--text-footnote);
	color: var(--label-tertiary);
	line-height: 1.35;
}

.invite-overview-details .invite-overview-reward {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--label-secondary);
}

.invite-overview-details .invite-overview-reward strong {
	color: var(--label-primary);
	font-weight: 700;
}

/* ── Экран «Поддержка» (текст из menu_support) ───────────────── */
.support-message-text {
	width: 100%;
	font-size: var(--text-body);
	line-height: 1.55;
	color: var(--label-secondary);
	text-align: center;
}

.support-message-text strong {
	color: var(--label-primary);
	font-weight: 700;
}

a.dashboard-btn.support-tg-btn {
	text-decoration: none;
	color: inherit;
	box-sizing: border-box;
}

/* Disable Animations for Users Who Prefer Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}