/* =============================================
   VolynVPN — Styles
   Theme: Dark + Blue accent
   ============================================= */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg-0: #0a1020;
  --bg-1: #0f1729;
  --bg-2: #161f36;
  --bg-3: #1f2a44;
  --line: #263253;
  --text: #e6edf7;
  --text-dim: #9aa7c2;
  --text-muted: #6b7799;

  --primary: #2b7fff;
  --primary-600: #1f6ae0;
  --primary-700: #1855b8;
  --primary-glow: rgba(43, 127, 255, 0.25);

  --success: #22c55e;
  --warning: #f59e0b;
  --danger:  #ef4444;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --shadow-1: 0 2px 6px rgba(0,0,0,0.25);
  --shadow-2: 0 8px 32px rgba(0,0,0,0.35);

  --nav-h: 64px;
  --hdr-h: 56px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(43,127,255,0.18), transparent 60%),
    radial-gradient(900px 600px at 110% 20%, rgba(120,80,255,0.12), transparent 60%),
    linear-gradient(180deg, #0a1020 0%, #070c1a 100%);
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.mono { font-family: "SF Mono", "Monaco", "Menlo", "Consolas", "Liberation Mono", monospace; }

/* =========  SPLASH  ========= */
.splash {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  background: var(--bg-0);
  animation: fadein 0.3s ease;
}
.splash.hiding { animation: fadeout 0.35s ease forwards; }
.splash-inner { text-align: center; color: var(--primary); }
.splash-logo { filter: drop-shadow(0 0 16px var(--primary-glow)); }
.splash-title {
  margin-top: 12px;
  font-size: 22px; font-weight: 700;
  color: var(--text); letter-spacing: 0.3px;
}
.splash-spinner {
  margin: 18px auto 0;
  width: 26px; height: 26px;
  border: 2.5px solid rgba(43,127,255,0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { to { opacity: 0; visibility: hidden; } }

/* =========  AUTH SCREEN  ========= */
.screen-auth {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-box {
  max-width: 380px; width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-2);
}
.auth-logo { color: var(--primary); filter: drop-shadow(0 0 20px var(--primary-glow)); }
.auth-box h1 { margin: 12px 0 8px; font-size: 26px; }
.auth-box p { color: var(--text-dim); margin: 0 0 24px; }

/* =========  APP LAYOUT  ========= */
.app { min-height: 100vh; min-height: 100dvh; padding-bottom: var(--nav-h); }

.app-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--hdr-h);
  background: rgba(10, 16, 32, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 720px; height: 100%;
  margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo { color: var(--primary); filter: drop-shadow(0 0 12px var(--primary-glow)); }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.header-actions { display: flex; gap: 6px; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: transparent; border: none;
  color: var(--text); display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg-2); }
.icon-btn:active { transform: scale(0.94); }
.bell-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}

.app-main { max-width: 720px; margin: 0 auto; padding: 16px; }
.view { min-height: calc(100vh - var(--hdr-h) - var(--nav-h) - 32px); }

/* =========  BOTTOM NAV  ========= */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(10, 16, 32, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; background: none; border: none;
  color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; font-weight: 500;
  transition: color 0.15s;
}
.nav-item:hover { color: var(--text-dim); }
.nav-item.active { color: var(--primary); }

/* =========  CARDS  ========= */
.card {
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-1);
}
.card-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.6px; text-transform: uppercase;
  margin: 0 0 12px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}

/* Status pill */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.status-pill.active   { background: rgba(34,197,94,0.12);  color: var(--success); }
.status-pill.expired  { background: rgba(239,68,68,0.12);  color: var(--danger); }
.status-pill.warning  { background: rgba(245,158,11,0.12); color: var(--warning); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

/* Home — Days */
.days-big {
  font-size: 48px; font-weight: 700; line-height: 1;
  background: linear-gradient(180deg, #fff 0%, #c9d5ec 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.days-sub { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

/* Section title */
.section-title {
  font-size: 18px; font-weight: 700;
  margin: 20px 0 12px; padding: 0 4px;
}
.section-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 12px; padding: 0 4px; }

/* =========  BUTTONS  ========= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 15px; font-weight: 600;
  background: var(--bg-3); color: var(--text);
  transition: background 0.15s, transform 0.08s;
  min-height: 44px;
}
.btn:hover  { background: #26325a; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; }

.btn-primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-600) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(43,127,255,0.35);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--primary-600) 0%, var(--primary-700) 100%); }

.btn-success { background: linear-gradient(180deg, #2ecf6a 0%, #22a354 100%); color: #fff; }
.btn-danger  { background: #3b2230; color: #ff8c9b; }
.btn-danger:hover { background: #4a2a3a; }
.btn-outline {
  background: transparent; border: 1px solid var(--line);
}
.btn-outline:hover { background: var(--bg-2); }

.btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; }
.btn-xs { padding: 6px 10px; font-size: 12px; min-height: 30px; }

.btns-row { display: flex; gap: 10px; }
.btns-row > .btn { flex: 1; }

/* =========  KEYS  ========= */
.key-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.key-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.key-name { font-weight: 600; }
.key-port { color: var(--text-muted); font-size: 12px; }
.key-link {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: "SF Mono", "Monaco", "Menlo", "Consolas", monospace;
  font-size: 11.5px;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.key-actions { display: flex; gap: 8px; margin-top: 8px; }
.key-actions .btn { flex: 1; }

/* =========  PLANS (SHOP)  ========= */
.plan {
  position: relative;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.plan.popular {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 10px 30px var(--primary-glow);
}
.plan-badge {
  position: absolute; top: -10px; right: 14px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.plan-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 10px; }
.plan-title { font-size: 16px; font-weight: 700; }
.plan-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.plan-price { font-size: 24px; font-weight: 700; color: var(--text); }
.plan-per-month { color: var(--text-muted); font-size: 12px; text-align: right; margin-top: 2px; }

/* =========  LIST ROWS  ========= */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--text-dim); font-size: 12.5px; }
.row-right { color: var(--text-dim); font-size: 12px; text-align: right; flex-shrink: 0; }
.row-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); border-radius: 50%; color: var(--primary);
}

/* Notifications */
.notif-item { position: relative; }
.notif-item.unread { border-left: 3px solid var(--primary); padding-left: 12px; }
.notif-time { color: var(--text-muted); font-size: 11px; margin-top: 4px; }

/* =========  FORMS  ========= */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg-0); color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.textarea { resize: vertical; min-height: 80px; }
.label {
  display: block;
  color: var(--text-dim); font-size: 12px;
  margin-bottom: 6px; font-weight: 500;
}
.form-row { margin-bottom: 12px; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 14px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }

/* =========  MODAL  ========= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(3, 8, 20, 0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadein 0.2s ease;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-width: 540px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  padding: 20px;
  animation: slideup 0.25s ease;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
@keyframes slideup { from { transform: translateY(20%); } to { transform: translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1;
}
.modal-close:hover { background: var(--bg-2); color: var(--text); }
@media (min-width: 540px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: var(--radius-lg); margin: 20px; }
}

/* =========  TOAST  ========= */
#toastRoot {
  position: fixed; top: 16px; left: 0; right: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 16px;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-2);
  max-width: 420px; width: auto;
  animation: toastin 0.2s ease;
  pointer-events: auto;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.info    { border-color: var(--primary); }
@keyframes toastin { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* =========  EMPTY / LOADER  ========= */
.empty { text-align: center; color: var(--text-dim); padding: 32px 16px; }
.empty-icon { color: var(--text-muted); margin-bottom: 10px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-text { font-size: 13px; }

.loader-inline {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skeleton { to { background-position: -200% 0; } }

/* =========  TEXT HELPERS  ========= */
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mb-0 { margin-bottom: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-lg { font-size: 17px; }
.fw-bold { font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: none; }

/* =========  ADMIN  ========= */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px;
}
.stat-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 4px; }

.admin-tabs {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 4px; margin-bottom: 12px;
}
.admin-tab {
  flex-shrink: 0;
  padding: 8px 14px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text-dim); font-size: 13px; font-weight: 600;
}
.admin-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: background 0.12s;
}
.user-row:hover { background: var(--bg-3); }
.user-row.banned { opacity: 0.55; }
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-3); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.pagination { display: flex; gap: 6px; justify-content: center; padding: 12px 0; }

/* =========  INSTRUCTIONS  ========= */
.platform-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 16px;
}
.platform-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text); text-align: center;
}
.platform-card:hover { background: var(--bg-3); }
.platform-icon { font-size: 28px; }

.instr-step {
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 14px;
}
.instr-num {
  flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.instr-content { flex: 1; padding-top: 2px; }

/* =========  MEDIA QUERIES  ========= */
@media (max-width: 380px) {
  .days-big { font-size: 40px; }
  .plan-price { font-size: 20px; }
  .stat-grid { grid-template-columns: 1fr; }
}

@media (min-width: 720px) {
  body { font-size: 16px; }
  .platform-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* =========  GUEST LANDING  ========= */
.guest-header {
  padding: 20px 24px;
  max-width: 720px; margin: 0 auto;
}
.hero {
  max-width: 540px; margin: 0 auto;
  padding: 40px 24px 24px; text-align: center;
}
.hero-title {
  font-size: 42px; line-height: 1.1; font-weight: 800;
  background: linear-gradient(180deg, #fff 0%, #9aa7c2 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 16px;
}
.hero-sub {
  font-size: 17px; color: var(--text-dim);
  margin: 0 0 28px;
}
.hero-features {
  display: grid; gap: 12px;
  text-align: left;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px; margin: 0 auto 28px;
  max-width: 440px;
}
.feat { display: flex; align-items: center; gap: 12px; }
.feat-ico { font-size: 22px; flex-shrink: 0; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: 14px 28px; font-size: 16px; min-height: 52px; }
@media (max-width: 420px) {
  .hero-title { font-size: 32px; }
  .hero-actions .btn { flex: 1; min-width: 140px; }
}

/* Auth forms */
.auth-form {
  max-width: 420px; margin: 24px auto; padding: 0 20px;
}
.auth-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-2);
}
.auth-card h2 { margin: 0 0 6px; font-size: 22px; }
.auth-card .sub { color: var(--text-dim); margin: 0 0 20px; font-size: 14px; }
.auth-switch {
  text-align: center; margin-top: 16px;
  color: var(--text-dim); font-size: 14px;
}
.auth-switch a { color: var(--primary); cursor: pointer; }

/* Verification banner */
.verify-banner {
  background: linear-gradient(180deg, #2a1f0f, #1f1a0f);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex; gap: 12px; align-items: flex-start;
}
.verify-banner-ico { font-size: 22px; flex-shrink: 0; }
.verify-banner-text { flex: 1; font-size: 13.5px; color: var(--text); }
.verify-banner .btn-xs { margin-top: 6px; }
