/* ============================================
   MODERN VPN DASHBOARD - Commercial Quality v3
   ============================================ */

/* ========== LOADING ANIMATIONS ========== */
@keyframes skeleton-loading {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes fade-slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

:root {
  --bg: #0d1925;
  --surface: #122537;
  --surface-elevated: #193146;
  --surface-hover: #23435c;
  --ink: #fae8c1;
  --muted: rgba(250, 232, 193, 0.72);
  --line: rgba(244, 174, 87, 0.22);
  --accent: #f4ae57;
  --accent-hover: #e5901c;
  --accent-light: rgba(244, 174, 87, 0.16);
  --accent-contrast: #0d1925;
  --accent-soft: #fae8c1;
  --cream: #fee6b6;
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #97220c;
  --danger-light: rgba(151, 34, 12, 0.16);
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.42);
  --shadow-success: 0 0 20px rgba(16, 185, 129, 0.3);
  --shadow-glow: 0 0 28px rgba(244, 174, 87, 0.22);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-xs: 4px;

  /* Status colors */
  --status-online: #10b981;
  --status-degraded: #f59e0b;
  --status-offline: #b23a2b;
  --status-checking: #6b7280;
}

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

body {
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(244, 174, 87, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(151, 34, 12, 0.18), transparent 22%),
    linear-gradient(180deg, #112131 0%, #0d1925 100%);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: "Montserrat", "Lato", sans-serif;
  letter-spacing: 0.01em;
}

.site-shell {
  padding: 22px 16px 48px;
}

.site-brandbar {
  max-width: 720px;
  margin: 0 auto 18px;
}

.site-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.site-brand-logo {
  width: 88px;
  min-width: 88px;
  height: auto;
  display: block;
}

.site-brand-copy {
  display: grid;
  gap: 2px;
}

.site-brand-name {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.site-brand-tagline {
  font-family: "Oswald", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface-elevated);
  color: var(--ink);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface-hover);
  color: var(--muted);
  box-shadow: none;
}

.btn.primary:disabled {
  background: var(--surface-hover);
  color: var(--muted);
  box-shadow: none;
}

.btn.primary:disabled:hover {
  transform: none;
}

.btn svg {
  flex-shrink: 0;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-glow);
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.34);
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.btn.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--ink);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.btn.text {
  background: transparent;
  color: var(--accent);
  padding: 8px 12px;
  font-weight: 500;
}

.btn.text:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.btn.large {
  padding: 14px 24px;
  font-size: 1rem;
  width: 100%;
  border-radius: var(--radius);
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]),
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  color: var(--ink);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"])::placeholder,
textarea::placeholder {
  color: #afb0b1;
}

input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ========== SECTIONS ========== */
.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.section-title.small {
  font-size: 1rem;
}

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

.section-subtitle {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 24px;
}

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

.section-header {
  margin-bottom: 20px;
}

.section-hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* ========== AUTH ========== */
.auth-card {
  max-width: 460px;
  margin: 8vh auto 0;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(25, 49, 70, 0.96) 0%, rgba(18, 37, 55, 0.98) 100%);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 1.8rem;
  line-height: 1.2;
  margin-bottom: 10px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.auth-brand-logo {
  width: 96px;
  min-width: 96px;
  display: block;
}

.auth-brand-copy {
  display: grid;
  gap: 4px;
}

.auth-brand-tagline {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-family: "Oswald", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.lead {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.stack {
  display: grid;
}

.gap-md {
  gap: 14px;
}

.legacy-auth {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.small-link {
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
}

.small-link:hover {
  text-decoration: underline;
}

.help-text {
  font-size: 0.78rem;
  color: var(--muted);
}

.error,
.success {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
}

.error {
  border: 1px solid rgba(178, 58, 43, 0.5);
  background: rgba(178, 58, 43, 0.15);
  color: #d98a80;
}

.success {
  border: 1px solid rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.12);
  color: #76dfbc;
}

/* ========== HEADER ========== */
.dashboard-header {
  margin-bottom: 24px;
}

.header-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.header-copy {
  max-width: 480px;
}

.dashboard-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 0.98;
  color: var(--accent-soft);
}

.dashboard-subtitle {
  margin-top: 10px;
  color: var(--muted);
  max-width: 420px;
}

@media (max-width: 640px) {
  .site-brand-link,
  .auth-brand {
    align-items: flex-start;
  }

  .site-brand-logo,
  .auth-brand-logo {
    width: 80px;
    min-width: 80px;
  }

  .site-brand-tagline {
    font-size: 0.82rem;
  }
}

.back-link {
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--ink);
}

/* ========== SUBSCRIPTION CARD ========== */
.subscription-prominent {
  margin-bottom: 20px;
}

.subscription-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: start;
}

.subscription-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  opacity: 0;
  transition: opacity 0.3s;
}

.subscription-card.active {
  border-color: rgba(244, 174, 87, 0.42);
  box-shadow: var(--shadow), 0 0 24px rgba(244, 174, 87, 0.14);
}

.subscription-card.active::before {
  opacity: 1;
}

.subscription-card.expired {
  border-color: var(--danger);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(178, 58, 43, 0.2) 100%);
  opacity: 0.95;
}

.sub-status-large {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  grid-column: 1;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(244, 174, 87, 0.65);
  animation: pulse 2s infinite;
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(244, 174, 87, 0.65);
  opacity: 0;
  animation: pulse-ring 2s infinite;
}

.subscription-card.expired .status-dot {
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
  animation: none;
}

.subscription-card.expired .status-dot::after {
  display: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.status-text-large {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.sub-days-remaining {
  display: flex;
  align-items: baseline;
  gap: 10px;
  grid-column: 1;
}

.sub-user-summary {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 230px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.2);
  background: rgba(13, 25, 37, 0.28);
}

.sub-user-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sub-user-label {
  color: var(--muted);
  font-size: 0.75rem;
}

.sub-user-value {
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.days-number {
  font-family: "Oswald", "Montserrat", sans-serif;
  font-size: 3rem;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.days-label {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.sub-warning {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--danger-light);
  border: 1px solid rgba(178, 58, 43, 0.4);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: #d98a80;
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}

.sub-warning a {
  color: var(--accent);
  text-decoration: underline;
}

.sub-message {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 8px 0;
  grid-column: 1 / -1;
}

.subscription-overview {
  margin-bottom: 20px;
}

.subscription-overview-card {
  background: linear-gradient(135deg, rgba(12, 31, 51, 0.92) 0%, rgba(16, 44, 71, 0.9) 100%);
  border: 1px solid rgba(244, 174, 87, 0.34);
  border-radius: var(--radius);
  padding: 16px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}

.overview-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.overview-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.overview-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.overview-hint {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ========== CONNECTION STATUS ========== */
.connection-status {
  margin-bottom: 28px;
}

.connection-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.connection-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(212, 175, 55, 0.2));
}

.conn-header {
  text-align: center;
  margin-bottom: 24px;
}

.conn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(244, 174, 87, 0.35);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.conn-protocol-main {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ink) 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.conn-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.conn-flag {
  background: var(--surface-hover);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 700;
  color: var(--muted);
}

.conn-server {
  color: var(--muted);
  font-size: 1rem;
}

.conn-endpoint-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.conn-endpoint-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.conn-endpoint-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.conn-endpoint-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.conn-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

@media (max-width: 500px) {
  .conn-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .conn-endpoint-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}

.conn-qr {
  appearance: none;
  background: white;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.28);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.conn-qr:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.conn-qr svg {
  width: 120px;
  height: 120px;
  display: block;
}

.conn-qr img {
  width: 120px;
  height: 120px;
  display: block;
}

.qr-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 18, 28, 0.82);
  z-index: 1100;
}

.qr-modal-card {
  position: relative;
  width: min(92vw, 560px);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow-lg);
}

.qr-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(13, 25, 37, 0.08);
  color: #0d1925;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.qr-modal-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Instructions Tabs */
.conn-instructions {
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.instr-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.instr-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.instr-tab:hover {
  color: var(--ink);
}

.instr-tab.active {
  background: var(--surface-elevated);
  color: var(--ink);
}

.instr-content {
  min-height: 120px;
  display: block;
  visibility: visible;
  opacity: 1;
}

.instr-content:empty::before {
  content: 'Загрузка инструкции...';
  color: var(--muted);
  font-size: 0.875rem;
  display: block;
  text-align: center;
  padding: 24px;
}

.instr-loading {
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 24px;
}

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

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

.instr-app-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.instr-app-link:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

.instr-steps {
  list-style: none;
}

.instr-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.875rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.instr-steps li:last-child {
  border-bottom: none;
}

.step-num {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.instr-error {
  color: var(--danger);
  text-align: center;
  padding: 24px;
}

.conn-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ========== SERVER SELECTION ========== */
.server-selection {
  margin-bottom: 32px;
}

/* Server Search */
.server-search-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-container {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-input-container .search-input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9375rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.search-input-container .search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light), 0 2px 8px rgba(212, 175, 55, 0.22);
  background: var(--surface);
}

.search-input-container .search-input::placeholder {
  color: var(--muted);
}

.search-input.searching {
  background-image: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.08) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  border: none;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.search-clear:hover {
  background: var(--danger);
  color: #f6d7d2;
}

.btn-best-server {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: var(--accent-contrast);
  border: none;
  padding: 12px 20px;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-best-server::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-best-server:hover::before {
  opacity: 1;
}

.btn-best-server:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.38);
  transform: translateY(-1px);
}

.btn-best-server svg {
  width: 18px;
  height: 18px;
}

/* Best Server sparkle animation */
.btn-best-server.sparking::after {
  content: '✨';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.5; transform: translateY(-50%) scale(0.9); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.1); }
}

/* Server List Container */
.server-list-container {
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

@media (max-width: 480px) {
  .server-grid {
    grid-template-columns: 1fr;
  }
}

/* Server Card - Enhanced */
.server-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.server-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s;
}

.server-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.server-card:hover::before {
  background: linear-gradient(135deg, var(--accent) 0%, transparent 50%);
  opacity: 0.5;
}

/* Selected State */
.server-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(212, 175, 55, 0.07) 100%);
  box-shadow: 0 0 0 2px var(--accent), 0 8px 32px rgba(212, 175, 55, 0.18);
}

.server-card.current {
  border-color: rgba(212, 175, 55, 0.5);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(212, 175, 55, 0.08) 100%);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.45), 0 0 24px rgba(212, 175, 55, 0.14);
}

.server-card.current:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px rgba(212, 175, 55, 0.25);
}

.server-card.hidden {
  display: none;
}

.server-card.highlighted {
  animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-light); }
  50% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 8px var(--accent-light); }
}

.server-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.server-location {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.server-flag {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface-hover) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.server-name-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.server-city {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.3;
}

.server-country {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* Server Badges */
.server-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-current {
  justify-content: center;
  gap: 0;
  min-width: 42px;
  padding: 5px 10px;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-recommended {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(212, 175, 55, 0.28);
}

.badge-new {
  background: rgba(212, 175, 55, 0.1);
  color: var(--accent);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Server Status Row */
.server-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-pill.status-online,
.status-pill.status-low {
  background: var(--success-light);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.25);
}

.status-pill.status-degraded,
.status-pill.status-medium {
  background: var(--warning-light);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.25);
}

.status-pill.status-offline,
.status-pill.status-high {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(178, 58, 43, 0.36);
}

.status-pill.status-checking {
  background: var(--surface-elevated);
  color: var(--muted);
  border-color: var(--line);
}

.status-pill.status-unknown {
  background: var(--surface-elevated);
  color: var(--muted);
  border-color: var(--line);
}

.status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: none;
  animation: none;
}

.status-pill.status-online .status-dot,
.status-pill.status-low .status-dot {
  box-shadow: 0 0 6px currentColor;
}

.status-pill.status-checking .status-dot.pulse {
  animation: statusPulse 1.5s infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.status-pill .status-value {
  font-weight: 700;
}

.status-pill .status-label {
  font-weight: 500;
  opacity: 0.9;
}

/* Protocol Chips - Enhanced Grid */
.server-protocols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

@media (max-width: 479px) {
  .server-protocols {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 480px) {
  .server-protocols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .server-protocols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .server-protocols {
    grid-template-columns: repeat(3, 1fr);
  }
}

.protocol-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  cursor: pointer;
}

.protocol-chip:hover:not(.disabled):not(.unavailable) {
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.08);
  transform: translateY(-1px);
}

.protocol-chip:active:not(.disabled):not(.unavailable) {
  transform: translateY(0);
}

/* Selected Protocol State */
.protocol-chip.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-light) 0%, rgba(212, 175, 55, 0.09) 100%);
  box-shadow: 0 0 0 1px var(--accent);
}

.protocol-chip.active {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--success-light) 0%, rgba(16, 185, 129, 0.08) 100%);
}

.protocol-chip.active.selected {
  box-shadow: 0 0 0 2px var(--success);
}

/* Connected State */
.protocol-chip.connected {
  border-color: var(--success);
  background: var(--success-light);
}

.protocol-chip.connected .protocol-chip-name {
  color: var(--success);
}

/* Disabled/Unavailable States */
.protocol-chip.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface);
}

.protocol-chip.unavailable {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--surface);
  border-style: dashed;
}

.protocol-chip.not-installed {
  display: none;
}

.protocol-chip.full {
  border-color: var(--warning);
  background: var(--warning-light);
  cursor: not-allowed;
}

.protocol-chip.full .protocol-chip-slots {
  color: var(--warning);
  font-weight: 600;
}

.protocol-chip-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  padding-right: 6px;
}

.protocol-chip-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.protocol-chip-slots {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.protocol-chip-endpoint {
  font-size: 0.6875rem;
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.protocol-chip-slots-full-msg {
  font-size: 0.6875rem;
  color: var(--warning);
  font-weight: 500;
}

.slots-available {
  color: var(--success);
  font-weight: 600;
}

.slots-full {
  color: var(--warning);
  font-weight: 600;
}

.slots-unavailable {
  color: var(--danger);
}

.protocol-chip-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  position: relative;
  z-index: 1;
}

.protocol-chip-submit {
  display: flex;
  align-items: center;
  justify-content: center;
}

.protocol-chip-check {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  min-width: 30px;
  min-height: 30px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--surface-hover);
  color: var(--muted);
  font: inherit;
  line-height: 1;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  z-index: 2;
  touch-action: manipulation;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.protocol-chip-check:hover:not(:disabled) {
  transform: translateY(-1px);
}

.protocol-chip-check:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.45);
  outline-offset: 2px;
}

.protocol-chip-check:disabled {
  cursor: not-allowed;
}

.protocol-chip.selected .protocol-chip-check,
.protocol-chip.active .protocol-chip-check,
.protocol-chip-check.on {
  border-color: rgba(16, 185, 129, 0.5);
  background: var(--success);
  color: #09231c;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.6;
}

.instruction-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(7, 18, 28, 0.72);
  z-index: 1000;
}

.instruction-modal-card {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px;
}

.instruction-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.instruction-modal-steps {
  margin-left: 18px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Empty State */
/* Hidden attribute support - must override all display rules */
[hidden] {
  display: none !important;
}

/* Loading overlay hidden state */
#loading-overlay[hidden] {
  display: none !important;
}

.empty-state-block {
  text-align: center;
  padding: 64px 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.empty-state-icon {
  margin-bottom: 24px;
  color: var(--muted);
  opacity: 0.4;
  width: 64px;
  height: 64px;
}

.empty-state-icon svg {
  width: 100%;
  height: 100%;
}

.empty-state-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.empty-state-subtitle {
  font-size: 0.9375rem;
  margin-bottom: 28px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

#server-offline-state .empty-state-icon {
  color: var(--warning);
  opacity: 0.7;
}

#server-offline-state .empty-state-title {
  color: var(--ink);
}

/* Price display fix - prevent broken layout */
.price-value, .price-total {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-amount {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.price-currency {
  font-size: 0.75em;
  font-weight: 500;
  opacity: 0.8;
  white-space: nowrap;
}

/* Payment unavailable - hide billing section */
.billing-section.hidden {
  display: none;
}

.billing-disabled {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  text-align: center;
}

.billing-disabled .section-title {
  margin-bottom: 12px;
}

.billing-disabled .disabled-message {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 8px;
}

/* ========== BILLING ========== */
.billing-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
}

.billing-section.prominent {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-light) 100%);
}

.plan-slider-container {
  margin-bottom: 20px;
}

.plan-slider-container input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 0%, var(--surface-elevated) 0%, var(--surface-elevated) 100%);
  border-radius: 3px;
  outline: none;
  margin-bottom: 12px;
}

.plan-slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45);
  transition: transform 0.2s;
}

.plan-slider-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.plan-marks {
  display: flex;
  justify-content: space-between;
}

.plan-marks .mark {
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.plan-marks .mark:hover,
.plan-marks .mark.active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.plan-card {
  background: var(--surface-elevated);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-card:hover {
  border-color: var(--line);
}

.plan-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.plan-duration {
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.plan-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  background: var(--success);
  color: #ecfff8;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 4px;
}

.price-summary {
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

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

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.price-row.small {
  font-size: 0.875rem;
  color: var(--success);
}

.price-label {
  color: var(--muted);
}

.price-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.price-total {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.network-select-row {
  margin-bottom: 20px;
}

.network-select-row label {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.network-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9375rem;
  cursor: pointer;
}

.network-select:focus {
  outline: none;
  border-color: var(--accent);
}

.payment-unavailable {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--danger-light);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 0.875rem;
  text-align: center;
}

/* ========== EMAIL ========== */
.email-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
}

.email-section.attached {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--surface) 0%, var(--success-light) 100%);
}

.email-form-compact {
  display: flex;
  gap: 12px;
}

.email-form-compact input {
  flex: 1;
  padding: 12px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9375rem;
}

.email-form-compact input:focus {
  outline: none;
  border-color: var(--accent);
}

.email-attached-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

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

.email-label {
  font-size: 0.8125rem;
  color: var(--muted);
}

.email-value {
  font-family: monospace;
  font-size: 0.9375rem;
}

.email-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.email-msg.success {
  background: var(--success-light);
  color: var(--success);
}

.email-msg.error {
  background: var(--danger-light);
  color: var(--danger);
}

/* ========== PAYMENTS ========== */
.payments-section {
  margin-bottom: 24px;
}

.payments-list-compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

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

.payment-plan {
  font-weight: 500;
}

.payment-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.payment-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.payment-status-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.payment-status-icon.success { background: var(--success); }
.payment-status-icon.pending { background: var(--warning); }
.payment-status-icon.expired { background: var(--danger); }

.empty-state-compact {
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface);
  color: var(--ink);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent);
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s ease;
  min-width: 280px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

/* ========== LOADING SKELETON CONTAINER ========== */
.loading-skeleton-container {
  padding: 24px 0;
}

.skeleton-header {
  margin-bottom: 20px;
}

.skeleton-title {
  height: 32px;
  width: 200px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
}

.skeleton-subtitle {
  height: 20px;
  width: 280px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
  opacity: 0.6;
}

.skeleton-search {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.skeleton-search-bar {
  flex: 1;
  height: 48px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-best-btn {
  width: 140px;
  height: 48px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

@media (max-width: 480px) {
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
}

.skeleton-card {
  height: 180px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-elevated) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-flag {
  width: 40px;
  height: 40px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

.skeleton-text {
  height: 20px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
  width: 60%;
}

.skeleton-status {
  height: 28px;
  width: 100px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 999px;
}

.skeleton-chips {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.skeleton-chip {
  height: 48px;
  flex: 1;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

.loading-spinner-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--surface-elevated);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* ========== LOADING STATES ========== */

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  margin-bottom: 0;
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: 0.75em;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius);
}

.skeleton-chip {
  height: 40px;
  border-radius: var(--radius-xs);
}

/* Pulse Loading */
.pulse-loading {
  animation: pulse-loading 1.5s ease-in-out infinite;
}

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

/* Checking Status Animation */
.checking-pulse {
  animation: checking-pulse 1.5s ease-in-out infinite;
}

@keyframes checking-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(107, 114, 128, 0.4);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 8px rgba(107, 114, 128, 0);
  }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 28, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--surface-elevated);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner.success {
  border-top-color: var(--success);
}

.loading-spinner.error {
  border-top-color: var(--danger);
}

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

.loading-text {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.loading-text::after {
  content: '...';
  animation: loading-dots 1.5s steps(4, end) infinite;
}

@keyframes loading-dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  .page-shell {
    padding: 16px 12px 32px;
  }

  /* Mobile Subscription Card */
  .subscription-card {
    padding: 20px;
    grid-template-columns: minmax(0, 1fr);
  }

  .sub-days-remaining {
    align-items: center;
    gap: 8px;
  }

  .sub-user-summary {
    grid-column: 1;
    grid-row: auto;
    min-width: 0;
  }

  .days-number {
    font-size: 2.2rem;
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Mobile Server Grid */
  .server-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .server-card {
    padding: 16px;
  }

  .server-card-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .server-badges {
    width: 100%;
    justify-content: flex-start;
  }

  /* Mobile Protocol Chips - Stack vertically */
  .server-protocols {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .protocol-chip {
    padding: 12px 14px;
  }

  .protocol-chip-name {
    font-size: 0.9375rem;
  }

  /* Mobile Connection Section */
  .conn-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .conn-protocol-main {
    font-size: 2rem;
  }

  /* Mobile Forms */
  .email-form-compact {
    flex-direction: column;
  }

  /* Mobile Search */
  .server-search-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-best-server {
    width: 100%;
    justify-content: center;
  }

  /* Mobile Status Row */
  .server-status-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Mobile Empty State */
  .empty-state-block {
    padding: 48px 20px;
  }

  .empty-state-icon {
    width: 48px;
    height: 48px;
  }

  .empty-state-title {
    font-size: 1.125rem;
  }
}

/* Tablet Adjustments */
@media (min-width: 641px) and (max-width: 1023px) {
  .server-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .server-protocols {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large Desktop */
@media (min-width: 1400px) {
  .page-shell {
    max-width: 900px;
  }

  .server-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== CONNECTED INDICATOR ========== */
.connected-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  color: var(--success);
  font-size: 0.8125rem;
  font-weight: 600;
}

.connected-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

/* ========== UTILITY CLASSES ========== */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }

.bg-success-light { background: var(--success-light); }
.bg-warning-light { background: var(--warning-light); }
.bg-danger-light { background: var(--danger-light); }
.bg-accent-light { background: var(--accent-light); }

/* Fade animations */
.fade-in {
  animation: fadeIn 0.3s ease;
}

.fade-slide-up {
  animation: fade-slide-up 0.4s ease;
}

/* Focus styles */
.focus-ring:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selection highlight */
::selection {
  background: var(--accent-light);
  color: var(--ink);
}

/* Scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--surface-hover);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ========== ADMIN UI ========== */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25, 49, 70, 0.96) 0%, rgba(18, 37, 55, 0.98) 100%);
  box-shadow: var(--shadow);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1;
  color: var(--accent-soft);
}

.cards-grid.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.slot-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25, 49, 70, 0.96) 0%, rgba(18, 37, 55, 0.98) 100%);
  box-shadow: var(--shadow);
}

.slot-card h2 {
  margin: 0 0 16px;
  color: var(--accent-soft);
  font-size: 1.25rem;
}

.slot-card .eyebrow {
  margin-bottom: 10px;
}

.slot-card form + form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.meta-grid div {
  padding: 14px;
  border: 1px solid rgba(244, 174, 87, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.meta-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-grid dd {
  margin: 0;
  color: var(--accent-soft);
  font-family: "Montserrat", "Lato", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.table-card {
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 20, 31, 0.3);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap thead {
  background: rgba(244, 174, 87, 0.08);
}

.table-wrap th,
.table-wrap td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(244, 174, 87, 0.1);
  vertical-align: middle;
}

.table-wrap th {
  color: var(--accent-soft);
  font-size: 0.78rem;
  font-family: "Montserrat", "Lato", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-wrap td {
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap tbody tr {
  transition: background 0.2s ease;
}

.table-wrap tbody tr:hover {
  background: rgba(244, 174, 87, 0.04);
}

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

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 10px 16px;
  border: 1px solid rgba(244, 174, 87, 0.24);
  border-radius: 999px;
  background: rgba(25, 49, 70, 0.72);
  color: var(--muted);
  text-decoration: none;
  font-family: "Montserrat", "Lato", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  color: var(--accent-soft);
  border-color: rgba(244, 174, 87, 0.5);
  background: rgba(244, 174, 87, 0.08);
}

.filter-tab.active {
  color: var(--accent-contrast);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(244, 174, 87, 0.24);
}

.server-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.server-status.online,
.server-status.degraded,
.server-status.unknown {
  background: rgba(16, 185, 129, 0.14);
  color: #55d6ae;
}

.server-status.offline {
  background: rgba(151, 34, 12, 0.18);
  color: #f2a38c;
}

.load-bar {
  width: 120px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.load-bar-fill {
  height: 100%;
  border-radius: inherit;
}

.load-bar-fill.low {
  background: linear-gradient(90deg, #22c55e 0%, #10b981 100%);
}

.load-bar-fill.medium {
  background: linear-gradient(90deg, #f59e0b 0%, #f4ae57 100%);
}

.load-bar-fill.high {
  background: linear-gradient(90deg, #e76f51 0%, #97220c 100%);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-active-badge {
  background: rgba(16, 185, 129, 0.14);
  color: #55d6ae;
}

.status-expired-badge {
  background: rgba(151, 34, 12, 0.18);
  color: #f2a38c;
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .filter-tabs {
    width: 100%;
  }

  .filter-tab {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 0;
  }
}
