/* =============================================
   MYVPN DASHBOARD — STYLE.CSS
   Design: Dark Terminal / Secure Minimal
   ============================================= */

/* --- RESET & BASE --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #07080d;
  --surface: #0e0f16;
  --surface-2: #13141e;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(108, 110, 255, 0.3);
  --accent: #6c6eff;
  --accent-dim: rgba(108, 110, 255, 0.12);
  --accent-glow: rgba(108, 110, 255, 0.2);
  --cyan: #00e0c6;
  --cyan-dim: rgba(0, 224, 198, 0.1);
  --text-primary: #eeeef5;
  --text-secondary: #7878a0;
  --text-muted: #44445a;
  --success: #00c896;
  --success-dim: rgba(0, 200, 150, 0.1);
  --danger: #ff5c7c;
  --danger-dim: rgba(255, 92, 124, 0.1);
  --warn: #f0a030;
  --warn-dim: rgba(240, 160, 48, 0.1);
  --phone-width: 390px;
  --font-display: 'Space Mono', monospace;
  --font-body: 'DM Sans', sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
}

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

/* Subtle grid texture on body */
body {
  background-image:
    linear-gradient(rgba(108, 110, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 110, 255, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* --- LAYOUT: SIDE FILLS + PHONE SHELL --- */
.side-fill {
  flex: 1;
  min-height: 100vh;
  background: var(--bg);
}

.phone-shell {
  width: 100%;
  max-width: var(--phone-width);
  min-height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Subtle top accent line */
.phone-shell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

/* --- HEADER --- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(7, 8, 13, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-glyph {
  font-size: 18px;
  color: var(--accent);
  line-height: 1;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

/* --- HEADER USER --- */
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(108, 110, 255, 0.3);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-display);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color .2s, background .2s;
  line-height: 1;
}

.logout-btn:hover {
  color: var(--danger);
  background: var(--danger-dim);
}

/* --- TRIAL SECTION --- */
.trial-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 20px 0;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(0, 224, 198, 0.06) 0%, rgba(108, 110, 255, 0.06) 100%);
  border: 1px solid rgba(0, 224, 198, 0.2);
  border-radius: var(--radius);
}

.trial-badge {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

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

.trial-btn {
  background: var(--cyan);
  border: none;
  border-radius: 50px;
  color: #07080d;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 9px 18px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity .2s, transform .15s;
}

.trial-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.trial-btn:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: default;
  transform: none;
  opacity: 1;
}

.back-btn {
  font-size: 14px;
  color: var(--accent);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  padding: 4px 0;
  min-width: 60px;
  display: block;
  transition: opacity .2s;
}

.back-btn:hover {
  opacity: 0.7;
}

/* --- BALANCE SECTION --- */
.balance-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px 28px;
  text-align: center;
  border-bottom: none;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

/* Radial glow behind balance */
.balance-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(108, 110, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.balance-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.balance-amount {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  line-height: 1;
  margin-bottom: 8px;
}

.balance-currency {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 10px;
}

.balance-number {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
}

.balance-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.topup-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: opacity .2s, transform .15s;
}

.topup-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.topup-plus {
  font-size: 18px;
  line-height: 1;
  font-weight: 300;
}

/* --- STATUS BAR --- */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  margin-top: 16px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
}

.status-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s ease-in-out infinite;
}

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

.status-text {
  font-size: 11px;
  color: var(--text-primary);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

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

/* --- SECTIONS --- */
.section {
  padding: 24px 20px 0;
}

.section-title {
  font-size: 11px;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* --- PLANS LIST --- */
.plans-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.plan-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  transition: border-color .2s;
}

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

.plan-row.featured {
  border-color: rgba(108, 110, 255, 0.35);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(108, 110, 255, 0.05) 100%);
}

.plan-badge {
  position: absolute;
  top: -1px;
  right: 14px;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 0 0 6px 6px;
}

.plan-info {
  flex: 1;
}

.plan-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

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

.plan-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.plan-price {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.plan-price span {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.plan-btn {
  background: var(--accent-dim);
  border: 1px solid rgba(108, 110, 255, 0.25);
  border-radius: 50px;
  color: var(--accent);
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 5px 14px;
  white-space: nowrap;
  transition: background .2s, opacity .2s;
}

.plan-btn:hover {
  background: rgba(108, 110, 255, 0.2);
}

.plan-btn.active-plan {
  background: var(--success-dim);
  border-color: rgba(0, 200, 150, 0.25);
  color: var(--success);
  cursor: default;
}

/* --- KEY BLOCK --- */
.key-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.key-protocol-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.key-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: color .2s, background .2s;
  border-bottom: 2px solid transparent;
}

.key-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-dim);
}

.key-content {
  padding: 14px 16px;
}

.key-string {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.7;
  word-break: break-all;
  white-space: pre-wrap;
}

.key-actions {
  display: flex;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
}

.key-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
  padding: 7px 14px;
  transition: border-color .2s, color .2s;
}

.key-action-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* --- QR MODAL --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}

.qr-placeholder {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
}

.modal-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-body);
  padding: 8px 24px;
  transition: border-color .2s;
}

.modal-close:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* --- NAV LINKS --- */
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
}

.nav-link-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, background .2s;
}

.nav-link-row:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

.nav-link-icon {
  width: 34px;
  height: 34px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.nav-link-body {
  flex: 1;
}

.nav-link-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

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

.nav-link-arrow {
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1;
}

/* --- FOOTER --- */
.app-footer {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-display);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  transition: color .2s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* --- PAYMENTS PAGE --- */
.payments-summary {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.pay-sum-item {
  flex: 1;
  padding: 16px 12px;
  text-align: center;
}

.pay-sum-val {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pay-sum-label {
  font-size: 11px;
  color: var(--text-muted);
}

.pay-sum-divider {
  width: 1px;
  background: var(--border);
  margin: 12px 0;
}

.pay-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
}

.pay-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pay-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.topup-icon {
  background: var(--success-dim);
  color: var(--success);
}

.sub-icon {
  background: var(--accent-dim);
  color: var(--accent);
}

.trial-icon {
  background: var(--warn-dim);
  color: var(--warn);
  font-size: 12px;
}

.pay-body {
  flex: 1;
}

.pay-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.pay-date {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-display);
}

.pay-amount {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.pay-amount.positive { color: var(--success); }
.pay-amount.negative { color: var(--text-secondary); }
.pay-amount.zero { color: var(--text-muted); }

/* --- SETUP PAGE --- */
.setup-note {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.platform-tabs {
  display: flex;
  padding: 0 20px;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.ptab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  transition: color .2s, border-color .2s;
}

.ptab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.platform-content {
  padding: 0 20px;
}

.dl-button {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  transition: border-color .2s;
}

.dl-button:hover {
  border-color: var(--border-hover);
}

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

.dl-btn-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
}

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

.steps-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.step-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.step-item:last-child {
  border-bottom: none;
}

.step-num {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.5;
  flex-shrink: 0;
  width: 24px;
  margin-top: 1px;
}

.step-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- TOPUP PAGE --- */
.balance-mini {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.mono {
  font-family: var(--font-display);
  color: var(--text-primary);
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.amount-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 13px;
  padding: 14px 8px;
  transition: border-color .2s, color .2s, background .2s;
}

.amount-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.amount-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.custom-input-row {
  margin-bottom: 16px;
}

.custom-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 18px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .2s;
}

.custom-input:focus {
  border-color: var(--accent);
}

.custom-input::placeholder {
  color: var(--text-muted);
  font-size: 13px;
}

.method-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.method-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .2s;
}

.method-row.active {
  border-color: rgba(108, 110, 255, 0.4);
}

.method-icon {
  width: 34px;
  height: 34px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.method-body { flex: 1; }

.method-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

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

.method-check {
  font-size: 14px;
  color: var(--text-muted);
}

.method-row.active .method-check {
  color: var(--accent);
}

.topup-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 32px;
}

.topup-confirm-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.topup-confirm-amount {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.topup-pay-btn {
  background: var(--accent);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 12px 22px;
  transition: opacity .2s, transform .15s;
}

.topup-pay-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* --- MOBILE: no side fills on small screens --- */
@media (max-width: 430px) {
  .side-fill { display: none; }
  .phone-shell { border-left: none; border-right: none; }
}
