/* Vinipux Cabinet Styles */

:root {
	--vc-bg:            #0d0d1a;
	--vc-bg-secondary:  #1a1a2e;
	--vc-text:          #e5e5e5;
	--vc-text-hint:     rgba(255,255,255,0.5);
	--vc-text-link:     #a5b4fc;
	--vc-border:        rgba(255,255,255,0.08);
	--vc-card-bg:       rgba(255,255,255,0.03);
	--vc-input-bg:      rgba(255,255,255,0.05);
	--vc-input-border:  rgba(255,255,255,0.1);
	--vc-accent:        #6366f1;
	--vc-accent-end:    #8b5cf6;
	--vc-btn-text:      #ffffff;
	--vc-accent-muted:  rgba(99,102,241,0.12);
	--vc-accent-border: rgba(99,102,241,0.25);
}

/* Full-page layout */
.vc-page {
	background: var(--vc-bg);
	color: var(--vc-text);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.vc-page-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(13, 13, 26, 0.9);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--vc-border);
}

.vc-page-header__inner {
	max-width: 720px;
	margin: 0 auto;
	padding: 0 1rem;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.vc-page-header__logo {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	color: inherit;
	font-weight: 800;
	font-size: 1.15rem;
}

.vc-page-header__logo i,
.vc-page-header__logo svg {
	color: #d97706;
}

.vc-page-header__right {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.vc-page-header__email {
	font-size: 0.85rem;
	opacity: 0.7;
}

.vc-page-main {
	flex: 1;
	padding: 1.5rem 1rem 3rem;
}

@media (max-width: 600px) {
	.vc-page-header__email {
		display: none;
	}
}

.vc-login-wrap {
	display: flex;
	justify-content: center;
	padding: 2rem 1rem;
}

.vc-login-card {
	max-width: 420px;
	width: 100%;
	background: var(--vc-bg-secondary);
	border: 1px solid var(--vc-border);
	border-radius: 16px;
	padding: 2rem;
	text-align: center;
}

.vc-login-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 1rem;
	background: linear-gradient(135deg, var(--vc-accent), var(--vc-accent-end));
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}

.vc-login-title {
	font-size: 1.35rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
}

.vc-login-subtitle {
	font-size: 0.875rem;
	opacity: 0.6;
	margin-bottom: 1.5rem;
}

.vc-login-form {
	text-align: left;
}

.vc-form-group {
	margin-bottom: 1rem;
}

.vc-form-group label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 0.4rem;
	opacity: 0.8;
}

.vc-form-group input {
	width: 100%;
	padding: 0.65rem 0.85rem;
	background: var(--vc-input-bg);
	border: 1px solid var(--vc-input-border);
	border-radius: 10px;
	color: inherit;
	font-size: 0.95rem;
	outline: none;
	transition: border-color 0.2s;
}

.vc-form-group input:focus {
	border-color: var(--vc-accent);
}

.vc-login-divider {
	display: flex;
	align-items: center;
	margin: 1.25rem 0;
	gap: 0.75rem;
}

.vc-login-divider::before,
.vc-login-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--vc-input-border);
}

.vc-login-divider span {
	font-size: 0.8rem;
	opacity: 0.5;
}

.vc-telegram-login {
	display: flex;
	justify-content: center;
}

/* Alerts */
.vc-alert {
	padding: 0.75rem 1rem;
	border-radius: 10px;
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

.vc-alert-error {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.3);
	color: #fca5a5;
}

.vc-alert-success {
	background: rgba(34, 197, 94, 0.1);
	border: 1px solid rgba(34, 197, 94, 0.3);
	color: #86efac;
}

.vc-alert-warning {
	background: rgba(234, 179, 8, 0.1);
	border: 1px solid rgba(234, 179, 8, 0.3);
	color: #fde047;
}

/* Toast notifications */
.vc-toast {
	position: fixed;
	bottom: 1.5rem;
	left: 50%;
	transform: translateX(-50%) translateY(1rem);
	opacity: 0;
	z-index: 10000;
	padding: 0.75rem 1.25rem;
	max-width: min(90vw, 400px);
	text-align: center;
	transition: opacity 0.3s, transform 0.3s;
	pointer-events: none;
}

.vc-toast--visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Buttons */
.vc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.65rem 1.25rem;
	border-radius: 10px;
	font-size: 0.875rem;
	font-weight: 600;
	border: none;
	cursor: pointer;
	transition: all 0.2s;
	text-decoration: none;
}

.vc-btn-primary {
	width: 100%;
	background: linear-gradient(135deg, var(--vc-accent), var(--vc-accent-end));
	color: #fff;
}

.vc-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.vc-btn .vc-spinner {
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: vc-spin 0.6s linear infinite;
	vertical-align: middle;
	margin-right: 0.5em;
}

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

.vc-btn-outline {
	background: transparent;
	border: 1px solid var(--vc-input-border);
	color: inherit;
}

.vc-btn-outline:hover {
	background: var(--vc-input-bg);
}

.vc-btn-danger {
	background: rgba(239, 68, 68, 0.15);
	color: #fca5a5;
	border: 1px solid rgba(239, 68, 68, 0.3);
}

.vc-btn-danger:hover {
	background: rgba(239, 68, 68, 0.25);
}

.vc-btn-sm {
	padding: 0.4rem 0.85rem;
	font-size: 0.8rem;
}

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

/* Dashboard */
.vc-dashboard {
	max-width: 720px;
	margin: 0 auto;
	padding: 1rem 0;
}

.vc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 0 1.5rem;
	border-bottom: 1px solid var(--vc-border);
	margin-bottom: 1.5rem;
}

.vc-user-email {
	font-weight: 500;
	font-size: 0.95rem;
}

.vc-section {
	margin-bottom: 2rem;
}

.vc-section-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 1rem;
}

.vc-section-title svg {
	opacity: 0.6;
}

.vc-card {
	background: var(--vc-card-bg);
	border: 1px solid var(--vc-border);
	border-radius: 12px;
	padding: 1.25rem;
	margin-bottom: 0.75rem;
}

.vc-empty {
	font-size: 0.875rem;
	opacity: 0.5;
}

/* VPN info */
.vc-vpn-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0;
	overflow: hidden;
	min-width: 0;
}

.vc-vpn-row + .vc-vpn-row {
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.vc-label {
	font-size: 0.85rem;
	opacity: 0.6;
}

.vc-code {
	font-family: monospace;
	font-size: 0.8rem;
	background: var(--vc-input-bg);
	padding: 0.2rem 0.5rem;
	border-radius: 6px;
	word-break: break-all;
	max-width: 100%;
}

/* Badges */
.vc-badge {
	display: inline-flex;
	padding: 0.2rem 0.65rem;
	border-radius: 20px;
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
}

.vc-badge-success {
	background: rgba(34, 197, 94, 0.15);
	color: #86efac;
}

.vc-badge-warning {
	background: rgba(234, 179, 8, 0.15);
	color: #fde047;
}

.vc-badge-error {
	background: rgba(239, 68, 68, 0.15);
	color: #fca5a5;
}

.vc-badge-info {
	background: rgba(41, 128, 185, 0.15);
	color: #7ec8e3;
}

.vc-badge-refund {
	background: rgba(139, 92, 246, 0.15);
	color: #c4b5fd;
}

.vc-badge-muted {
	background: var(--vc-border);
	color: var(--vc-text-hint);
}

/* Subscription */
.vc-sub-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.vc-sub-amount {
	margin-left: 0.5rem;
	font-size: 0.85rem;
	opacity: 0.6;
}

.vc-sub-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.vc-muted {
	font-size: 0.85rem;
	opacity: 0.5;
}

/* Cards list */
.vc-cards-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.vc-card-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem;
	background: var(--vc-card-bg);
	border-radius: 8px;
}

.vc-card-info {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.vc-card-type {
	font-weight: 600;
	font-size: 0.85rem;
	text-transform: capitalize;
}

.vc-card-number {
	font-family: monospace;
	font-size: 0.9rem;
}

.vc-card-expiry {
	font-size: 0.8rem;
	opacity: 0.5;
}

/* Copy button */
.vc-copy-wrap {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	max-width: 100%;
}

.vc-copy-wrap .vc-code {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vc-copy-btn {
	flex-shrink: 0;
	padding: 0.3rem 0.5rem !important;
}

.vc-copy-btn.vc-copied {
	color: #86efac;
	border-color: rgba(34, 197, 94, 0.3);
}

/* Subscription link copy button */
.vc-sub-link {
	padding: 0.75rem 0;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.vc-btn-copy-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.75rem 1rem;
	background: var(--vc-accent-muted);
	border: 1px solid var(--vc-accent-border);
	border-radius: 10px;
	color: var(--vc-text-link);
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
}

.vc-btn-copy-link:hover {
	background: rgba(99, 102, 241, 0.22);
}

.vc-btn-copy-link:active {
	transform: scale(0.97);
}

.vc-btn-copy-link svg {
	flex-shrink: 0;
	opacity: 0.8;
}

.vc-btn-copy-link.vc-copied {
	background: rgba(34, 197, 94, 0.15);
	border-color: rgba(34, 197, 94, 0.3);
	color: #86efac;
}

/* Payment History Table */
.vc-history-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	table-layout: auto;
}

.vc-history-table td:last-child {
	white-space: nowrap;
}

.vc-history-table th {
	text-align: left;
	font-weight: 600;
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--vc-input-border);
	opacity: 0.7;
	font-size: 0.8rem;
}

.vc-history-table td {
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.vc-history-table tbody tr:last-child td {
	border-bottom: none;
}

/* Sync Footer */
.vc-sync-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 0;
	margin-top: 0.5rem;
	border-top: 1px solid var(--vc-border);
}

.vc-refresh-btn svg {
	margin-right: 0.35rem;
}

.vc-refresh-btn.vc-loading svg {
	animation: vc-spin 0.8s linear infinite;
}

@keyframes vc-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* Traffic info & progress bar */
.vc-traffic-info {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.35rem;
	min-width: 180px;
}

.vc-progress {
	width: 100%;
	height: 6px;
	background: var(--vc-border);
	border-radius: 3px;
	overflow: hidden;
}

.vc-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #6366f1, #8b5cf6);
	border-radius: 3px;
	transition: width 0.4s ease;
}

.vc-progress-bar.vc-progress-warning {
	background: linear-gradient(90deg, #eab308, #f59e0b);
}

.vc-progress-bar.vc-progress-danger {
	background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Connect buttons (deep links) */
.vc-connect {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.vc-connect-title {
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 0.6rem;
	opacity: 0.8;
}

.vc-connect-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.5rem;
}

.vc-connect-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.6rem 0.5rem;
	background: var(--vc-accent-muted);
	border: 1px solid var(--vc-accent-border);
	border-radius: 10px;
	color: var(--vc-text-link);
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.2s;
}

.vc-connect-btn svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.vc-connect-btn:hover {
	background: rgba(99, 102, 241, 0.22);
	border-color: var(--vc-accent-border);
	transform: translateY(-1px);
}

/* QR code */
.vc-vpn-qr {
	margin-top: 0.75rem;
	display: flex;
	justify-content: center;
}

.vc-vpn-qr canvas {
	border-radius: 8px;
}

/* Download apps grid */
.vc-apps-card {
	margin-top: 0.5rem;
}

.vc-apps-title {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.9rem;
	font-weight: 600;
	margin-bottom: 0.75rem;
}

.vc-apps-title svg {
	opacity: 0.6;
	flex-shrink: 0;
}

.vc-apps-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.5rem;
}

.vc-app-link {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 0.85rem;
	background: var(--vc-card-bg);
	border: 1px solid var(--vc-input-border);
	border-radius: 10px;
	color: var(--vc-text);
	font-size: 0.85rem;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s;
}

.vc-app-link svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	opacity: 0.7;
}

.vc-app-link:hover {
	background: var(--vc-input-bg);
	border-color: var(--vc-input-border);
}

/* Manual steps */
.vc-manual-steps {
	margin-top: 1rem;
	padding-top: 0.75rem;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	font-size: 0.825rem;
	opacity: 0.7;
}

.vc-manual-steps p {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 0.4rem;
}

.vc-manual-steps p svg {
	opacity: 0.6;
	flex-shrink: 0;
}

.vc-manual-steps ol {
	margin: 0;
	padding-left: 1.25rem;
	list-style: decimal;
}

.vc-manual-steps li {
	margin-bottom: 0.2rem;
}

/* Devices */
.vc-device-count {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	font-size: 0.875rem;
}

.vc-devices-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.vc-device-card {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem;
	background: var(--vc-card-bg);
	border-radius: 8px;
}

.vc-device-icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--vc-accent-muted);
	border-radius: 10px;
	color: var(--vc-text-link);
}

.vc-device-icon svg {
	width: 22px;
	height: 22px;
}

.vc-device-body {
	flex: 1;
	min-width: 0;
}

.vc-device-info {
	font-size: 0.875rem;
	font-weight: 500;
}

.vc-device-meta {
	font-size: 0.8rem;
	opacity: 0.5;
	margin-top: 0.15rem;
}

/* Responsive */
@media (max-width: 600px) {
	.vc-header {
		flex-direction: column;
		gap: 0.75rem;
		text-align: center;
	}

	.vc-sub-footer {
		flex-direction: column;
		gap: 0.5rem;
		align-items: flex-start;
	}

	.vc-card-row {
		flex-direction: column;
		gap: 0.5rem;
		align-items: flex-start;
	}

	.vc-copy-wrap {
		flex-direction: column;
		align-items: flex-start;
	}

	.vc-history-table th:nth-child(2),
	.vc-history-table td:nth-child(2) {
		display: none;
	}

	.vc-sync-footer {
		flex-direction: column;
		gap: 0.75rem;
		text-align: center;
	}

	.vc-traffic-info {
		min-width: 0;
		width: 100%;
	}

	.vc-progress {
		max-width: 200px;
	}

	.vc-connect-grid {
		grid-template-columns: 1fr;
	}

	.vc-apps-grid {
		grid-template-columns: 1fr;
	}

	.vc-device-card {
		flex-wrap: wrap;
	}

	.vc-device-card .vc-btn {
		margin-left: auto;
	}
}

/* Confirm bottom sheet */
.vc-confirm-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(0, 0, 0, 0);
	-webkit-backdrop-filter: blur(0);
	backdrop-filter: blur(0);
	transition: background 0.25s ease, -webkit-backdrop-filter 0.25s ease, backdrop-filter 0.25s ease;
}
.vc-confirm-overlay.vc-confirm-visible {
	background: rgba(0, 0, 0, 0.5);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.vc-confirm-sheet {
	background: var(--vc-bg-secondary, #1a1a2e);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 1rem 1rem 0 0;
	padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
	width: 100%;
	max-width: 28rem;
	transform: translateY(100%);
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.vc-confirm-visible .vc-confirm-sheet {
	transform: translateY(0);
}

.vc-confirm-text {
	color: #fff;
	font-size: 1rem;
	margin: 0 0 1.25rem;
	text-align: center;
	line-height: 1.5;
}

.vc-confirm-actions {
	display: flex;
	gap: 0.75rem;
}

.vc-confirm-actions .vc-btn {
	flex: 1;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	border-radius: 0.625rem;
	cursor: pointer;
	font-weight: 500;
	transition: background 0.15s ease;
}

.vc-btn-secondary {
	background: rgba(255, 255, 255, 0.08);
	color: #ccc;
	border: 1px solid rgba(255, 255, 255, 0.12);
}
.vc-btn-secondary:hover { background: rgba(255, 255, 255, 0.14); }

.vc-confirm-actions .vc-btn-danger {
	background: #e74c3c;
	color: #fff;
	border: none;
}
.vc-confirm-actions .vc-btn-danger:hover { background: #c0392b; }

/* Telegram WebApp loading indicator */
.vc-webapp-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 4rem 1rem;
	gap: 1rem;
}

.vc-webapp-loading__spinner {
	width: 36px;
	height: 36px;
	border: 3px solid var(--vc-border);
	border-top-color: var(--vc-accent);
	border-radius: 50%;
	animation: vc-spin 0.7s linear infinite;
}

.vc-webapp-loading__text {
	font-size: 0.9rem;
	opacity: 0.6;
}

/* Telegram WebApp mode */
body.vc-telegram .vc-page-header { display: none; }
body.vc-telegram .vc-page-main { padding-top: 0.5rem; }
body.vc-telegram .vc-login-divider,
body.vc-telegram .vc-telegram-login { display: none; }
body.vc-telegram .vc-vpn-qr { display: none; }

/* Useful links */
.vc-links-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

a.vc-link-row,
.vc-link-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-radius: 10px;
	background: var(--vc-accent-muted);
	border: 1px solid var(--vc-accent-border);
	color: var(--vc-text-link);
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}

.vc-link-row:hover {
	background: rgba(99, 102, 241, 0.2);
	border-color: rgba(99, 102, 241, 0.4);
}

.vc-link-row svg {
	opacity: 0.7;
	flex-shrink: 0;
}
