/* ═══════════════ FlyVPN Mini App — Premium Dark Theme ═══════════════ */

:root {
  --bg: #0a0a0c;
  --bg-secondary: #111114;
  --bg-card: #16161a;
  --bg-card-hover: #1c1c21;
  --bg-input: #0e0e11;
  --accent: #d4a574;
  --accent-light: #e8c9a0;
  --accent-dim: rgba(212, 165, 116, 0.12);
  --accent-glow: rgba(212, 165, 116, 0.06);
  --gold: #c9956b;
  --gold-dim: rgba(201, 149, 107, 0.1);
  --green: #6bcf7f;
  --green-dim: rgba(107, 207, 127, 0.1);
  --orange: #e8a45c;
  --orange-dim: rgba(232, 164, 92, 0.1);
  --red: #e85c5c;
  --text: #f5f0eb;
  --text-secondary: #9a9498;
  --text-tertiary: #5c5558;
  --border: rgba(212, 165, 116, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border);
  --shadow-glow: 0 4px 24px rgba(212, 165, 116, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background:
    linear-gradient(180deg, rgba(212, 165, 116, 0.08) 0%, transparent 240px),
    linear-gradient(135deg, #0a0a0c 0%, #121116 48%, #0c0b0e 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Loading ─────────────────────────────────────────── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  flex-direction: column;
  gap: 16px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

/* ─── App Layout ──────────────────────────────────────── */

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  padding: 0 20px 110px;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ─── Header ──────────────────────────────────────────── */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 16px;
  position: relative;
  background: transparent;
  z-index: 10;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #0a0a0c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(212, 165, 116, 0.2);
}

.header-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.header-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.back-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  transition: background 0.2s;
}

.back-btn:active {
  background: var(--bg-card-hover);
}

/* ─── Status Card ─────────────────────────────────────── */

.status-card {
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.09), var(--bg-card) 52%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
}

.status-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.status-badge.active {
  color: var(--green);
}

.status-badge.inactive {
  color: var(--accent);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px currentColor;
}

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

.status-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.status-btn {
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #0a0a0c;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(212, 165, 116, 0.25);
}

.status-btn:active {
  transform: scale(0.96);
}

/* ─── Section ─────────────────────────────────────────── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: opacity 0.2s;
}

.link-btn:active {
  opacity: 0.7;
}

/* ─── VPN Card ────────────────────────────────────────── */

.vpn-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.vpn-key {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
}

.vpn-key-text {
  flex: 1;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  background: var(--accent-dim);
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  transition: background 0.2s;
}

.copy-btn:active {
  background: rgba(212, 165, 116, 0.2);
}

.vpn-meta {
  display: flex;
  justify-content: space-between;
}

.vpn-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vpn-meta-item.right {
  text-align: right;
}

.vpn-meta-value {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.vpn-meta-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.vpn-meta-label.status-active {
  color: var(--green);
}

/* ─── Buttons ─────────────────────────────────────────── */

.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #0a0a0c;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(212, 165, 116, 0.25);
  letter-spacing: -0.2px;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 12px rgba(212, 165, 116, 0.2);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  padding: 16px;
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
}

.btn-secondary:active {
  transform: scale(0.97);
  background: var(--accent-dim);
}

.quick-help {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 22px;
}

.quick-help-btn {
  min-height: 44px;
  padding: 0 12px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.quick-help-btn:active {
  background: var(--bg-card-hover);
  transform: scale(0.97);
}

.devices-header {
  margin-top: 4px;
}

/* ─── Devices Card ────────────────────────────────────── */

.devices-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.devices-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.devices-text strong {
  color: var(--text);
}

/* ─── No Subscription ─────────────────────────────────── */

.no-sub-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
}

.no-sub-icon {
  margin-bottom: 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 32px rgba(212, 165, 116, 0.1);
}

.no-sub-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.no-sub-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 280px;
  line-height: 1.5;
}

/* ─── Plans Grid ──────────────────────────────────────── */

.plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.plan-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  min-height: 198px;
  padding: 26px 14px 18px;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.15s, box-shadow 0.25s, background 0.25s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.plan-card:active {
  transform: scale(0.97);
}

.plan-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: var(--shadow-glow);
}

.plan-card.is-best-value {
  border-color: rgba(232, 201, 160, 0.34);
  background:
    linear-gradient(180deg, rgba(212, 165, 116, 0.10), transparent 58%),
    var(--bg-card);
  box-shadow: 0 8px 26px rgba(212, 165, 116, 0.12), 0 0 0 1px rgba(212, 165, 116, 0.08);
}

.plan-card.is-best-value.selected {
  box-shadow: 0 10px 32px rgba(212, 165, 116, 0.2), 0 0 0 1px rgba(232, 201, 160, 0.3);
}

.plan-card .plan-badge {
  position: absolute;
  top: -12px;
  right: 10px;
  max-width: calc(100% - 20px);
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #0a0a0c;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(212, 165, 116, 0.28);
  white-space: nowrap;
}

.plan-card.is-best-value .plan-badge {
  left: 10px;
  right: 10px;
  width: auto;
  font-size: 11px;
}

.plan-duration {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}

.plan-duration-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: -4px;
}

.plan-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-light);
  margin-top: 6px;
  letter-spacing: -0.4px;
}

.plan-per-month {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 650;
}

.plan-savings {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-dim);
  padding: 4px 8px;
  border-radius: 999px;
  margin-top: 4px;
  white-space: nowrap;
}

.checkout-selected {
  margin-top: 18px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.checkout-selected > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkout-selected strong {
  color: var(--text);
  font-size: 15px;
}

.summary-card {
  margin-top: 18px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.08), var(--bg-card) 58%);
  border: 1px solid rgba(212, 165, 116, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.summary-total {
  margin-top: 8px;
  font-size: 36px;
  font-weight: 800;
  color: var(--accent-light);
  letter-spacing: -1px;
}

.summary-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.summary-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-lines span {
  font-size: 13px;
  color: var(--text-secondary);
}

.summary-lines strong {
  font-size: 13px;
  color: var(--text);
  text-align: right;
}

.summary-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

/* ─── Payment Methods ─────────────────────────────────── */

.payment-methods {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 20px;
}

.method-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.25s, background 0.2s, box-shadow 0.25s;
}

.method-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: var(--shadow-glow);
}

.method-btn:active {
  transform: scale(0.96);
}

.method-icon {
  font-size: 22px;
}

.method-name {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.method-btn.active .method-name {
  color: var(--accent-light);
}

.cta-plans {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ─── Devices Selector ────────────────────────────────── */

.devices-selector {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.devices-selector .section-label {
  margin-bottom: 12px;
}

.devices-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.devices-minus,
.devices-plus {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.devices-minus:active,
.devices-plus:active {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.devices-picker-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  min-width: 40px;
  text-align: center;
}

.devices-price-hint {
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ─── Profile ─────────────────────────────────────────── */

.profile-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 28px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #0a0a0c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(212, 165, 116, 0.25);
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.profile-sub-date {
  font-size: 13px;
  color: var(--accent);
  margin-top: 6px;
  font-weight: 500;
}

/* ─── Profile Card ────────────────────────────────────── */

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.profile-card.highlight {
  border-color: rgba(212, 165, 116, 0.15);
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.04), rgba(201, 149, 107, 0.02));
}

.ref-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.ref-link-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  outline: none;
}

.ref-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.ref-title {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.ref-title strong {
  color: var(--accent);
  font-weight: 700;
}

.ref-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ref-stats {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ref-stat {
  font-size: 13px;
  color: var(--text-secondary);
}

.ref-stat strong {
  color: var(--text);
  font-weight: 600;
}

/* ─── Traffic Block ───────────────────────────────────── */

.traffic-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.traffic-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* ─── Profile Menu ────────────────────────────────────── */

.profile-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  text-align: left;
}

.menu-item:active {
  background: var(--bg-card-hover);
}

.menu-item + .menu-item {
  border-top: 1px solid var(--border-subtle);
}

.menu-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.menu-text {
  flex: 1;
  font-weight: 500;
}

.menu-arrow {
  color: var(--text-tertiary);
}

/* ─── Tab Bar ─────────────────────────────────────────── */

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(16, 16, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: calc(8px + var(--safe-bottom));
  z-index: 100;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 20px;
  transition: color 0.25s;
  position: relative;
}

.tab.active {
  color: var(--accent);
}

.tab.active::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.tab svg {
  stroke: currentColor;
}

/* ─── Toast ───────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

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

.empty-state,
.fatal-error {
  margin: 32px 0;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.fatal-error {
  margin: 80px 24px 0;
}

/* Embedded Admin */

.admin-screen {
  padding-bottom: 36px;
}

.admin-tabs,
.admin-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.admin-filters {
  grid-template-columns: repeat(3, 1fr);
}

.admin-tab,
.admin-filter {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  padding: 11px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.admin-tab.active,
.admin-filter.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent-light);
}

.admin-panel {
  animation: fadeIn 0.2s ease;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.admin-stat {
  min-height: 92px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.admin-stat-value {
  color: var(--accent-light);
  font-size: 24px;
  font-weight: 800;
}

.admin-stat-label {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

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

.admin-list-item {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.admin-list-item.static {
  cursor: default;
}

.admin-list-item div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-list-item strong {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-list-item span {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-status {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.admin-status.new {
  color: var(--orange);
  background: var(--orange-dim);
}

.admin-status.in_progress {
  color: var(--green);
  background: var(--green-dim);
}

.admin-status.closed {
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.05);
}

.admin-chat-back {
  margin-bottom: 14px;
}

.admin-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-chat-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chat-head span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.admin-chat-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-auto-btn {
  border: 1px solid var(--border);
  background: var(--green-dim);
  color: var(--green);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.admin-auto-btn.disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-tertiary);
}

.admin-chat-messages {
  min-height: 260px;
  max-height: 42vh;
  overflow-y: auto;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-chat-message {
  max-width: 86%;
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-chat-message.user {
  align-self: flex-start;
  background: var(--bg-card-hover);
  color: var(--text);
}

.admin-chat-message.admin {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #0a0a0c;
  font-weight: 600;
}

.admin-chat-message.bot {
  align-self: center;
  background: var(--accent-dim);
  color: var(--accent-light);
}

.admin-reply-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.admin-reply-input,
.admin-search {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  border-radius: var(--radius-xs);
  padding: 13px 14px;
  font-size: 14px;
  outline: none;
}

.admin-search {
  margin-bottom: 14px;
}

.admin-reply-input:focus,
.admin-search:focus {
  border-color: var(--accent);
}

.admin-send-btn {
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-xs);
  padding: 0 14px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #0a0a0c;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.admin-send-btn:disabled,
.admin-reply-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.admin-close-ticket {
  display: block;
  margin: 14px auto 0;
}

/* ─── Features List ───────────────────────────────────── */

.features-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 8px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

/* ─── Hint text ───────────────────────────────────────── */

.hint-text {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 12px;
}

/* ─── Balance Button ──────────────────────────────────── */

.balance-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 12px 8px 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.balance-btn:active {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.balance-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.balance-plus {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #0a0a0c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* ─── Brand Block ─────────────────────────────────────── */

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 0 30px;
}

.brand-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.18), rgba(201, 149, 107, 0.06));
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 0 40px rgba(212, 165, 116, 0.1), 0 0 0 1px var(--border);
}

.brand-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 260px;
  line-height: 1.4;
}

/* ─── Trial Section ───────────────────────────────────── */

.trial-section {
  margin-top: 8px;
}

.trial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.trial-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.trial-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.trial-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.trial-btn {
  position: relative;
  overflow: hidden;
}

.trial-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ─── Devices Card (updated) ──────────────────────────── */

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

.devices-hint {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Install VPN */

.install-screen {
  padding-bottom: 36px;
}

.install-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 0 22px;
}

.install-hero-icon {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 44%, rgba(200, 170, 120, 0.9), rgba(160, 130, 80, 0.92)),
    var(--bg-card);
  color: #fff8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 0 0 10px rgba(200, 170, 120, 0.08), 0 18px 34px rgba(0, 0, 0, 0.34);
}

.install-hero h1 {
  font-size: 25px;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.install-hero p {
  max-width: 320px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.install-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 8px;
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.install-section-head strong {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.install-device-list {
  background: transparent;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.install-device-option {
  width: 100%;
  min-height: 40px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.install-device-option:last-child {
  border-bottom: 0;
}

.install-device-option.active {
  color: var(--text);
}

.install-device-check {
  color: var(--text);
  opacity: 0;
  font-size: 18px;
}

.install-device-option.active .install-device-check {
  opacity: 1;
}

.install-app-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.install-app-option {
  min-height: 44px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.install-app-option:active {
  transform: scale(0.97);
}

.install-app-option.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(200, 170, 120, 0.08);
}

.install-key-card {
  margin-top: 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.install-key-text {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-steps {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.install-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(200, 170, 120, 0.55);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
}

.install-step-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.install-step-copy strong {
  font-size: 14px;
  color: var(--accent);
}

.install-step-copy span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.38;
}

.install-note {
  margin-top: 12px;
  color: var(--accent-light);
  background: var(--accent-dim);
  border: 1px solid rgba(212, 165, 116, 0.16);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.4;
}

.install-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.install-actions.primary-actions {
  margin-top: 12px;
}

@media (max-width: 380px) {
  .quick-help {
    grid-template-columns: 1fr;
  }

  .install-app-list {
    grid-template-columns: 1fr;
  }

  .install-hero-icon {
    width: 76px;
    height: 76px;
  }

  .install-hero h1 {
    font-size: 23px;
  }
}

/* ─── Top-up Screen ───────────────────────────────────── */

.topup-amount-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
  gap: 8px;
}

.topup-label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.topup-amount-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.topup-amount-value {
  font-size: 48px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -2px;
}

.topup-amount-currency {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-secondary);
}

.topup-hint {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  min-height: 16px;
}

/* Quick amounts */

.topup-quick {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.topup-quick-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: center;
}

.topup-quick-btn:active {
  transform: scale(0.96);
}

.topup-quick-btn.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent-light);
}

/* Top-up methods */

.topup-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.topup-method {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
  text-align: left;
}

.topup-method:active {
  background: var(--bg-card-hover);
}

.topup-method.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.topup-method-icon {
  font-size: 24px;
  width: 32px;
  text-align: center;
}

.topup-method-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topup-method-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.topup-method-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.topup-method-check {
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.topup-method.active .topup-method-check {
  opacity: 1;
}

/* ─── Responsive ──────────────────────────────────────── */

@media (max-width: 360px) {
  .plans-grid {
    gap: 8px;
  }
  .plan-card {
    min-height: 190px;
    padding: 24px 9px 16px;
  }
  .plan-card .plan-badge,
  .plan-card.is-best-value .plan-badge {
    left: 8px;
    right: 8px;
    font-size: 10px;
    padding: 5px 7px;
  }
  .plan-duration {
    font-size: 26px;
  }
  .plan-price {
    font-size: 18px;
  }
  .plan-per-month,
  .plan-savings {
    font-size: 10px;
  }
  .screen {
    padding: 0 16px 110px;
  }
  .topup-quick {
    gap: 8px;
  }
  .topup-amount-value {
    font-size: 40px;
  }
}
