/* ================================================================
   VIT-VPN Cabinet — Dark Theme (vit-ai.ru unified style)
   Design tokens: #0a0a0f bg, #00d4aa→#0099ff gradient, Segoe UI
   Min-width: 360px (mobile)  |  Desktop: 1024px+
   ================================================================ */

/* ── Reset & Base ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Dark palette — vit-ai.ru */
  --color-bg: #0a0a0f;
  --color-surface: rgba(255, 255, 255, 0.04);
  --color-surface-2: rgba(255, 255, 255, 0.08);
  --color-surface-hover: rgba(255, 255, 255, 0.08);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(0, 212, 170, 0.3);
  --color-text: #e0e0e0;
  --color-text-muted: #888;

  /* Accent — vit-ai.ru gradient */
  --color-accent: #00d4aa;
  --color-accent-2: #0099ff;
  --color-accent-hover: #00e6b8;
  --color-primary: #00d4aa;
  --color-primary-hover: #00e6b8;

  /* Semantic */
  --color-success: #34d399;
  --color-warning: #fbbf24;
  --color-danger: #f87171;
  --color-danger-hover: #ef4444;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Typography — vit-ai.ru font stack */
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* Layout */
  --header-height: 104px;
  --sidebar-width: 260px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-width: 360px;
  min-height: 100vh;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Utility Classes ──────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

/* ── Header / Navbar ──────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  padding: var(--space-sm) 0;
}

.site-header .container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.site-header nav {
  width: 100%;
}

/* Gradient logo — vit-ai.ru style */
.site-logo {
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #00d4aa, #0099ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.site-logo:hover {
  text-decoration: none;
  filter: brightness(1.15);
}

/* Hamburger toggle (mobile) */
.nav-toggle {
  position: absolute;
  top: 0;
  right: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  position: relative;
  transition: background 0.2s;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.2s;
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 6px;
}

/* Nav menu */
.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-xs);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition: background 0.15s, color 0.15s;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: var(--color-surface-2);
  color: var(--color-accent);
  text-decoration: none;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.5rem 1.25rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-family);
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #00d4aa, #0099ff);
  color: #0a0a0f;
  border-color: transparent;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #00e6b8, #1a8cff);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.25);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
  color: var(--color-accent);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--color-danger);
  border-color: rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.5);
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ── Cards — vit-ai.ru service-card style ────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-lg);
  transition: all 0.3s ease;
}

.card:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
}

.card-header {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.card-body {
  font-size: var(--font-size-base);
}

/* ── Dashboard Layout ─────────────────────────────────────────── */
.dashboard {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-height));
}

.dashboard-content {
  flex: 1;
  padding: var(--space-lg) var(--space-md);
}

.dashboard-welcome {
  margin-bottom: var(--space-xl);
}

.dashboard-welcome h1 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
  background: linear-gradient(135deg, #00d4aa, #0099ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-welcome p {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

/* Middle service section switcher */
.service-section-card {
  order: 1;
}

.subscription-card {
  order: 2;
}

.account-card {
  order: 3;
}

.service-section-nav {
  border: 1px solid transparent;
}

.service-section-nav.active,
.service-section-nav[aria-current="page"] {
  border-color: rgba(0, 212, 170, 0.24);
  background: rgba(0, 212, 170, 0.09);
  color: var(--color-accent);
}

.service-section-card {
  min-height: 100%;
}

.service-card-header {
  align-items: flex-start;
}

.service-title-stack {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.25;
}

.service-title-main {
  font-size: var(--font-size-lg);
  color: var(--color-text);
}

.service-title-current {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

.service-section-panel[hidden] {
  display: none !important;
}

.service-section-panel.active {
  display: block;
}

.service-placeholder {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.service-placeholder .text-muted {
  max-width: 360px;
}

/* ── Mail service blocks ─────────────────────────────────────── */
.mail-credential,
.mail-settings-card,
.mail-inline-form {
  background: rgba(0, 153, 255, 0.06);
  border: 1px solid rgba(0, 153, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.mail-field,
.mail-settings-block {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

.mail-field:last-of-type,
.mail-settings-block:last-of-type {
  border-bottom: none;
}

.mail-field-label,
.mail-settings-label {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xs);
}

.mail-field-value,
.mail-settings-value {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: normal;
}

.mail-field-value code {
  display: inline-block;
  max-width: 100%;
  font-family: var(--mono);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.openwebui-credential {
  background: rgba(0, 212, 170, 0.06);
  border-color: rgba(0, 212, 170, 0.16);
}

.support-page {
  padding: var(--space-xl) 0;
}

.support-card {
  max-width: 720px;
  margin: 0 auto;
}

.support-email {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-top: var(--space-md);
  overflow-wrap: anywhere;
}

.mail-field-action {
  margin-top: var(--space-sm);
}

.mail-settings-section-title {
  margin: var(--space-md) 0 var(--space-sm);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text);
}

.cabinet-mail-modal {
  width: min(520px, 94vw);
}

.password-rules {
  margin-top: var(--space-xs);
  padding: var(--space-sm);
  border: 1px solid rgba(0, 212, 170, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(0, 212, 170, 0.07);
  color: var(--color-text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.password-rules ul {
  margin: var(--space-xs) 0 0 1.1rem;
  padding: 0;
}

.password-rules.compact {
  margin-bottom: var(--space-xs);
}

/* ── Status Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  line-height: 1.5;
}

.badge-success {
  background: rgba(52, 211, 153, 0.12);
  color: var(--color-success);
}

.badge-warning {
  background: rgba(251, 191, 36, 0.12);
  color: var(--color-warning);
}

.badge-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--color-danger);
}

.badge-secondary {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}

/* Pulsing dot for active badges */
.badge-success::before,
.badge-success .dot {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

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

/* ── Info Rows ────────────────────────────────────────────────── */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-sm);
  flex-wrap: wrap;
}

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

.info-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  min-width: 120px;
}

.info-value {
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

/* ── VPN Credential Block ─────────────────────────────────────── */
.vpn-credential {
  background: rgba(0, 212, 170, 0.06);
  border: 1px solid rgba(0, 212, 170, 0.15);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-top: var(--space-md);
  word-break: break-all;
}

.vpn-credential code {
  display: block;
  font-family: var(--mono);
  font-size: var(--font-size-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  color: var(--color-accent);
}

/* ── QR Code ──────────────────────────────────────────────────── */
.qr-code-wrapper {
  text-align: center;
  margin: var(--space-md) 0;
}

.qr-code-wrapper img,
.qr-code-wrapper canvas {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

/* ── Forms ────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: var(--font-size-base);
  line-height: 1.5;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font-family);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

.form-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.password-input-wrapper {
  position: relative;
}

.password-input-wrapper .form-input {
  padding-right: 3.25rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1.1rem;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--color-accent);
  background: rgba(0, 212, 170, 0.1);
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

select.form-input {
  color-scheme: dark;
  background-color: #11121a;
}

select.form-input option {
  color: var(--color-text);
  background-color: #11121a;
}

.device-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.device-help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 1.15rem;
  border: 1px solid var(--color-text-muted);
  border-radius: 50%;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.device-help-tooltip:hover,
.device-help-tooltip:focus {
  color: var(--color-accent);
  border-color: var(--color-accent);
  outline: none;
}

.device-help-tooltip-text {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.55rem);
  z-index: 1200;
  display: block;
  width: min(340px, calc(100vw - 48px));
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--color-border-hover);
  border-radius: var(--radius-xs);
  background: #11121a;
  color: var(--color-text);
  box-shadow: var(--shadow-md);
  font-size: var(--font-size-sm);
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.25rem);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.device-help-tooltip:hover .device-help-tooltip-text,
.device-help-tooltip:focus .device-help-tooltip-text,
.device-help-tooltip:focus-within .device-help-tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.form-error {
  font-size: var(--font-size-sm);
  color: var(--color-danger);
  margin-top: var(--space-xs);
}

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
  border: 1px solid;
}

.alert-info {
  background: rgba(0, 153, 255, 0.08);
  color: #4da6ff;
  border-color: rgba(0, 153, 255, 0.2);
}

.alert-warning {
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.2);
}

.alert-danger {
  background: rgba(248, 113, 113, 0.08);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.2);
}

.alert-success {
  background: rgba(52, 211, 153, 0.08);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.2);
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  font-size: var(--font-size-sm);
  color: #444;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

/* ── Auth Pages (login/register) ──────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height));
  padding: var(--space-lg) var(--space-md);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-xl);
}

.auth-card h2,
.auth-card .card-header h1 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-lg);
  text-align: center;
  background: linear-gradient(135deg, #00d4aa, #0099ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-footer,
.auth-links {
  text-align: center;
  margin-top: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.auth-links p {
  margin-bottom: var(--space-xs);
}

.auth-links a {
  color: var(--color-accent);
}

/* ── Loading / Empty States ───────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.empty-state p {
  font-size: var(--font-size-sm);
}

/* ── Mobile Nav Overlay ───────────────────────────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.nav-overlay.active {
  display: block;
}

/* ── Mobile Sidebar ───────────────────────────────────────────── */
.nav-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: var(--sidebar-width);
  max-width: 80vw;
  height: 100vh;
  background: #12121a;
  z-index: 110;
  padding: var(--space-lg) var(--space-md);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  transition: right 0.25s ease;
  overflow-y: auto;
}

.nav-sidebar.active {
  right: 0;
}

.nav-sidebar-close {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--space-md);
}

.nav-sidebar-close button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: var(--space-xs);
  line-height: 1;
  transition: color 0.2s;
}

.nav-sidebar-close button:hover {
  color: var(--color-danger);
}

/* ================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================ */

/* ── Mobile-first: 360px – 767px (default above) ──────────────── */
/* Styles above are the mobile baseline. */

/* ── Tablet: 768px+ ───────────────────────────────────────────── */
@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-toggle {
    display: none;
  }

  .nav-sidebar,
  .nav-overlay {
    display: none !important;
  }

  .nav-menu {
    flex-direction: row;
    gap: var(--space-sm);
  }

  .container {
    padding: 0 var(--space-lg);
  }

  .dashboard-content {
    padding: var(--space-xl) var(--space-lg);
  }
}

/* ── Desktop: 1024px+ ─────────────────────────────────────────── */
@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
  }

  .info-row {
    flex-wrap: nowrap;
  }

  .info-value {
    text-align: right;
  }
}

/* ── Small mobile: 360px (extra safety) ───────────────────────── */
@media (max-width: 375px) {
  :root {
    --space-md: 0.75rem;
    --space-lg: 1rem;
  }

  .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }

  .card {
    padding: var(--space-md);
  }

  .dashboard-welcome h1 {
    font-size: var(--font-size-lg);
  }

  .site-logo {
    font-size: var(--font-size-base);
  }
}

/* ── Print ────────────────────────────────────────────────────── */
@media print {
  .site-header,
  .nav-toggle,
  .nav-sidebar,
  .nav-overlay,
  .btn,
  .site-footer {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}


/* ── VIT-SERVICES / client download modal ─────────────────────── */
.vpn-client-intro {
  background: rgba(0, 153, 255, 0.06);
  border: 1px solid rgba(0, 153, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.btn-download-client {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
}

.cabinet-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.cabinet-modal-box {
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(0, 212, 170, 0.28);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: var(--space-lg);
}

.cabinet-download-modal {
  overflow-y: auto;
}

.cabinet-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.cabinet-modal-header h3 {
  margin: 0;
  color: var(--color-text);
}

.download-client-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-bottom: 1px solid var(--color-border);
  margin: 0 0 var(--space-md);
}

.download-client-tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.8rem;
}

.download-client-tab:hover,
.download-client-tab.active {
  color: var(--color-accent);
}

.download-client-tab.active {
  border-bottom-color: var(--color-accent);
}

.download-client-tab:disabled,
.download-client-tab[aria-disabled="true"] {
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.42;
  border-bottom-color: transparent;
}

.download-client-tab:disabled:hover {
  color: var(--color-text-muted);
}

.download-client-inline-link {
  appearance: none;
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.download-client-inline-link:hover,
.download-client-inline-link:focus-visible {
  color: var(--color-accent);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.cabinet-modal-close {
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.cabinet-modal-close:hover {
  color: var(--color-accent);
  border-color: var(--color-border-hover);
}

.download-client-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.download-client-card-primary {
  border-color: rgba(0, 212, 170, 0.24);
  background: rgba(0, 212, 170, 0.055);
}

.download-client-card h4 {
  margin: 0 0 var(--space-sm);
  font-size: var(--font-size-lg);
}

.download-warning {
  color: var(--color-warning);
  font-weight: 800;
  line-height: 1.45;
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-sm) 0 var(--space-md);
}

.download-subtitle {
  margin: var(--space-md) 0 var(--space-sm);
  color: var(--color-text);
  font-size: var(--font-size-base);
}

.publisher-download-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.hiddify-download-table {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(170px, 1.35fr);
  width: min(100%, 560px);
  border: 1px solid rgba(180, 200, 220, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.hiddify-download-row {
  display: contents;
}

.hiddify-download-row > div {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(180, 200, 220, 0.24);
}

.hiddify-download-row > div:nth-child(odd) {
  border-right: 1px solid rgba(180, 200, 220, 0.24);
}

.hiddify-download-row:last-child > div {
  border-bottom: none;
}

.hiddify-download-head > div {
  font-weight: 800;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.035);
}

.hiddify-os {
  display: flex;
  align-items: center;
  color: var(--color-text);
  font-weight: 600;
}

.hiddify-buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.hiddify-dl {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  border-radius: 4px;
  overflow: hidden;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.hiddify-dl:hover {
  color: #fff;
  text-decoration: none;
  filter: brightness(1.12);
}

.hiddify-dl span,
.hiddify-dl strong {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0 0.42rem;
}

.hiddify-dl span {
  background: #3f4650;
}

.hiddify-dl.android strong { background: #1c8f3c; }
.hiddify-dl.windows strong { background: #2f8bb9; }
.hiddify-dl.macos strong { background: #c91f5d; }
.hiddify-dl.linux strong { background: #f19a38; color: #181818; }

.hiddify-store-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(100%, 360px);
  margin: var(--space-sm) 0 var(--space-md);
}

.hiddify-store-button {
  justify-content: center;
}

.amnezia-download-details summary {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  color: var(--color-text);
  font-weight: 800;
  list-style: none;
}

.amnezia-download-details summary::-webkit-details-marker {
  display: none;
}

.details-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(0, 212, 170, 0.12);
  border: 1px solid rgba(0, 212, 170, 0.35);
  color: var(--color-accent);
  font-weight: 900;
}

.amnezia-download-details[open] .details-plus {
  transform: rotate(45deg);
}

.download-testing-note {
  margin: var(--space-sm) 0 0;
  color: var(--color-warning);
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: 1.45;
}

.download-frame {
  width: 100%;
  height: min(56vh, 620px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #0a0a0f;
}

@media (max-width: 560px) {
  .hiddify-download-table {
    grid-template-columns: minmax(92px, 0.72fr) minmax(0, 1.28fr);
    font-size: 0.9rem;
  }

  .hiddify-download-row > div {
    padding: 0.65rem 0.55rem;
  }

  .hiddify-dl {
    font-size: 0.68rem;
  }
}
