:root {
  --bg: #0b1120;
  --bg-soft: #111a2e;
  --surface: #151f38;
  --surface-2: #1b2745;
  --border: #263356;
  --text: #eef1fb;
  --text-dim: #9aa5c4;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #22d3ee;
  --success: #34d399;
  --danger: #f87171;
  --radius: 14px;
  --shadow: 0 20px 45px -20px rgba(0, 0, 0, 0.55);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -10%, rgba(99, 102, 241, 0.28), transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(34, 211, 238, 0.18), transparent 40%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 17, 32, 0.75);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1080px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #0b1120;
}
.brand-mark-img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a, .nav-links span {
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.pill-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.7);
}
.pill-btn:hover { filter: brightness(1.08); }
.ghost-btn { border: 1px solid var(--border); }

/* Hero */
.hero {
  padding: 90px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* fades the site-wide 3D background into the page background at the hero's
   edges, keeping the headline/CTA readable instead of a hard cut */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 65% 55% at 50% 38%, transparent 30%, var(--bg) 90%);
  pointer-events: none;
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
}
@media (min-width: 900px) {
  .hero {
    min-height: 640px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  background: linear-gradient(135deg, #fff, #b7c0e6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 560px;
  margin: 0 auto 36px;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card-narrow { max-width: 480px; margin: 0 auto; }

/* Shorten form */
.shorten-form {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: 640px;
  margin: 0 auto;
}
.shorten-form input[type="url"], .shorten-form input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 14px 16px;
  font-size: 0.98rem;
  outline: none;
}
.shorten-form input::placeholder { color: var(--text-dim); }

.field-row { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  border: none;
  cursor: pointer;
  border-radius: 11px;
  padding: 13px 22px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(99, 102, 241, 0.8);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }

/* Forms (auth pages) */
.auth-wrap {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { margin: 0 0 6px; font-size: 1.5rem; letter-spacing: -0.02em; }
.auth-card .sub { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 26px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 7px;
  font-weight: 500;
}
.form-group input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.form-group input:focus { border-color: var(--primary); }
.form-foot {
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--text-dim);
  text-align: center;
}
.form-foot a { color: var(--accent); font-weight: 600; }

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}
.alert-error { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.3); }
.alert-success { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.3); }
.alert-pending { background: rgba(251, 191, 36, 0.12); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.3); }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 36px 0;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .num { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-card .label { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
/* On a narrow phone screen the table keeps its natural column widths and the
   wrapper above scrolls sideways, instead of every column getting squeezed
   and the whole page looking broken. */
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 0.9rem; }
thead th {
  text-align: left;
  padding: 14px 18px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
.truncate {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.85rem; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-admin { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.badge-user { background: rgba(255,255,255,0.06); color: var(--text-dim); }

.copy-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--primary); }

.icon-link { color: var(--danger); font-weight: 600; font-size: 0.85rem; }
.icon-link:hover { text-decoration: underline; }

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 44px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tabs a {
  padding: 10px 16px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.88rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.tabs a.active { color: var(--text); border-bottom-color: var(--primary); }

.result-url {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 10px;
  margin-top: 10px;
}
.result-url a { color: var(--accent); font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Plans page */
.plans-header { padding: 56px 24px 10px; text-align: center; }
.plans-header h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; }
.plans-header p { color: var(--text-dim); margin: 0; }

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin: 36px 0 70px;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.plan-card:hover { border-color: #33407a; transform: translateY(-2px); }
.plan-card.plan-free { border-color: rgba(52, 211, 153, 0.35); }
.plan-card.plan-unlimited { border-color: rgba(34, 211, 238, 0.3); }
.plan-icon { font-size: 1.4rem; margin-bottom: 6px; }
.plan-name { font-weight: 700; font-size: 1.02rem; margin-bottom: 4px; }
.plan-sub { color: var(--text-dim); font-size: 0.82rem; margin-bottom: 18px; min-height: 32px; }
.plan-price { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.plan-price .suffix { font-size: 0.78rem; color: var(--text-dim); font-weight: 500; }
.plan-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
  margin-bottom: 8px;
  width: fit-content;
}
.plan-card .btn { margin-top: auto; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}
.modal-box h3 { margin: 0 0 4px; font-size: 1.2rem; }
.modal-sub { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 20px; }
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
.method-toggle { display: flex; gap: 10px; margin-bottom: 18px; }
.method-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  font-size: 0.9rem;
}
.method-btn.active.method-bkash { border-color: #e2136e; color: #ff5fa2; background: rgba(226, 19, 110, 0.1); }
.method-btn.active.method-nagad { border-color: #f6921e; color: #ffb15e; background: rgba(246, 146, 30, 0.1); }
.pay-number-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.pay-number-box .num { font-family: 'SF Mono', 'Fira Code', monospace; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; }
.pay-instruction { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 18px; line-height: 1.5; }
.pay-instruction strong { color: var(--text); }

/* ---- New brand-styled payment modal ---- */
.pay-modal-box { max-width: 380px; }

.pay-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.pay-method-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
}
.pay-method-card:hover { transform: translateY(-2px); }
.pmc-logo { font-weight: 800; font-size: 0.95rem; }
.pmc-bkash .pmc-logo { color: #e2136e; }
.pmc-nagad .pmc-logo { color: #f6921e; }
.pmc-rocket .pmc-logo { color: #8c3494; }

.pay-back-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0 0 12px;
}
.pay-back-btn:hover { color: var(--text); }

.pay-brand-header {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 12px;
}
.pay-brand-header.brand-bkash { color: #e2136e; }
.pay-brand-header.brand-nagad { color: #f6921e; }
.pay-brand-header.brand-rocket { color: #8c3494; }

.pay-amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.pay-amount { font-weight: 700; color: var(--text); font-size: 1rem; }

.pay-instruction-block {
  border-radius: 12px;
  padding: 16px 16px 6px;
  color: #fff;
  margin-bottom: 14px;
}
.pay-instruction-block.brand-bkash { background: #97194f; }
.pay-instruction-block.brand-nagad { background: #e21f26; }
.pay-instruction-block.brand-rocket { background: #7b2d8e; }

.pay-instruction-title {
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.pay-trx-input {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.92rem;
  margin-bottom: 14px;
  outline: none;
  box-sizing: border-box;
}
.pay-steps {
  list-style: disc;
  margin: 0;
  padding: 0 0 8px 18px;
}
.pay-steps li {
  font-size: 0.82rem;
  line-height: 1.6;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 10px;
}
.pay-steps li:last-child { border-bottom: none; }
.pay-steps strong { color: #ffd23f; }
.pay-copy-btn {
  background: rgba(0,0,0,0.35);
  border: none;
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  margin-left: 6px;
}
.pay-verify-btn {
  background: #8a1010;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.pay-verify-btn:hover { background: #6e0c0c; }

@media (max-width: 600px) {
  .navbar-inner { padding: 14px 16px; }
  .nav-links { gap: 2px; }
  .nav-links a, .nav-links span { padding: 8px 10px; font-size: 0.85rem; }
  .shorten-form { flex-direction: column; border-radius: 14px; }
  .hero { padding: 60px 16px 40px; }
}

/* ---------- Sidebar app shell (logged-in area) ----------
   NOTE: deliberately NOT display:flex here. A fixed-position flex child is
   supposed to be excluded from the flex layout per spec, but several
   Android WebView / in-app browsers get this wrong and still reserve its
   space — which pushed all page content into the right half of the screen
   on some phones. Plain block layout + margin-left avoids that bug
   entirely and works the same everywhere. */
.app-shell {
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}
.sidebar .brand { padding: 0 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.68rem; color: var(--text-dim); font-weight: 500; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}
.sidebar-nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav a.active { background: var(--surface-2); color: var(--text); }
.badge-count {
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.sidebar-logout {
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.sidebar-logout:hover { color: var(--text); background: var(--surface-2); }

/* Sidebar is always position:fixed now (doesn't scroll with the page), so
   main-area just needs a left margin on desktop to sit next to it. */
.main-area { min-width: 0; margin-left: 240px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(11, 17, 32, 0.75);
  backdrop-filter: blur(10px);
  z-index: 15;
}
.menu-toggle {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.hi-user { color: var(--text-dim); font-size: 0.9rem; font-weight: 500; }

/* On phones/tablets the sidebar slides in as an overlay instead of sitting
   next to the content, so main-area drops the reserved left margin. */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .menu-toggle { display: inline-block; }
  .topbar { justify-content: space-between; }
}



/* ==========================================================================
   Live 3D background + site-wide motion system
   ========================================================================== */

/* Fixed, full-viewport 3D line canvas rendered behind every page. */
.site-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  pointer-events: none;
  z-index: -1;
}

/* Everything painted after the canvas (all real page content) sits above it
   automatically since it has default/positive stacking; this just makes sure
   surfaces that should be solid don't get see-through in a distracting way.
   NOTE: .sidebar is intentionally NOT listed here — it must stay
   `position: fixed` (set earlier in this file) so it sits correctly next to
   .main-area on every screen size. Overriding it back to `relative` here
   was the bug that broke the whole dashboard sidebar layout. */
.navbar, .topbar, .footer {
  position: relative;
}

/* --------------------------------------------------------------------
   Entrance animations: fade-in / slide-up / scale-in on page load,
   and on scroll into view for anything below the fold.
   -------------------------------------------------------------------- */
@keyframes revealFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes revealUpIn {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes revealScaleIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.reveal {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: both;
  animation-play-state: paused;
  animation-delay: var(--reveal-delay, 0ms);
}
.reveal-fade { animation-name: revealFadeIn; }
.reveal-up { animation-name: revealUpIn; }
.reveal-scale { animation-name: revealScaleIn; }
.reveal-in { animation-play-state: running; }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* --------------------------------------------------------------------
   Live button interactions: smooth hover lift + shadow expansion +
   color transition, plus a click "pulse" burst.
   -------------------------------------------------------------------- */
button,
.btn,
.pill-btn,
.ghost-btn,
.copy-btn,
.icon-link,
.method-btn,
.pay-method-card,
.modal-close,
.menu-toggle,
.sidebar-logout,
.pay-back-btn,
.pay-copy-btn,
.pay-verify-btn,
.nav-links a,
.sidebar-nav a {
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease,
              border-color 0.3s ease, color 0.3s ease, filter 0.3s ease;
  will-change: transform;
}

button:hover:not(:disabled),
.btn:hover:not(:disabled),
.pill-btn:hover,
.ghost-btn:hover:not(:disabled),
.copy-btn:hover,
.icon-link:hover,
.method-btn:hover,
.pay-method-card:hover,
.modal-close:hover,
.menu-toggle:hover,
.sidebar-logout:hover,
.pay-back-btn:hover,
.pay-copy-btn:hover,
.pay-verify-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -14px rgba(99, 102, 241, 0.55);
}

.nav-links a:hover,
.sidebar-nav a:hover {
  transform: translateY(-1px);
}

button:active:not(:disabled),
.btn:active:not(:disabled),
.pill-btn:active,
.ghost-btn:active:not(:disabled),
.copy-btn:active,
.icon-link:active,
.method-btn:active,
.pay-method-card:active {
  transform: translateY(-1px) scale(0.97);
}

@keyframes btnPulse {
  0%   { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.55), 0 16px 32px -14px rgba(99, 102, 241, 0.55); }
  60%  { box-shadow: 0 0 0 14px rgba(99, 102, 241, 0), 0 16px 32px -14px rgba(99, 102, 241, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(99, 102, 241, 0), 0 16px 32px -14px rgba(99, 102, 241, 0); }
}
.btn-pulse {
  animation: btnPulse 0.5s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  button, .btn, .pill-btn, .ghost-btn, .copy-btn, .icon-link, .method-btn,
  .pay-method-card, .modal-close, .menu-toggle, .sidebar-logout,
  .pay-back-btn, .pay-copy-btn, .pay-verify-btn, .nav-links a, .sidebar-nav a {
    transition: none;
  }
  .btn-pulse { animation: none; }
}

/* ==========================================================================
   Full responsive pass — every page now adapts to the device it's opened
   on: a phone gets a proper phone-sized layout, a desktop/laptop window
   gets a layout that fills that width, instead of a fixed desktop design
   being shrunk/squeezed onto a small screen.
   ========================================================================== */

/* Safety net: nothing on the page should ever force horizontal scrolling of
   the whole document — if it does, the page looks "zoomed out"/broken on a
   phone. This does not clip anything visually on desktop. */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
img, svg, canvas, video, iframe { max-width: 100%; }

/* Tablets and small laptops */
@media (max-width: 900px) {
  .container { padding: 0 18px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
  .plans-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* Phones */
@media (max-width: 640px) {
  .container { padding: 0 14px; }

  /* Hero */
  .hero { padding: 48px 16px 36px; }
  .hero p { font-size: 1rem; padding: 0 4px; }
  .shorten-form { max-width: 100%; }

  /* Stat cards: 2 per row instead of trying to fit 4 tiny columns */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 24px 0; }
  .stat-card { padding: 14px; }
  .stat-card .num { font-size: 1.5rem; }

  /* Plan cards: one per row, full width */
  .plans-grid { grid-template-columns: 1fr; gap: 14px; margin: 24px 0 40px; }
  .plans-header { padding: 40px 16px 6px; }
  .plans-header h1 { font-size: 1.6rem; }

  /* Cards / auth forms need less padding to leave room for content */
  .card { padding: 18px; }
  .auth-wrap { padding: 24px 12px; }
  .auth-card h2 { font-size: 1.3rem; }

  /* Section titles and tables */
  .section-title { font-size: 1.1rem; margin: 30px 0 12px; flex-wrap: wrap; gap: 8px; }
  thead th, tbody td { padding: 12px 14px; }
  .truncate { max-width: 160px; }

  /* Dashboard "current plan" card and similar flex rows stack cleanly */
  .stat-card, .plan-card { min-width: 0; }

  /* Payment modal: less outer padding so the content has room to breathe */
  .modal-box { padding: 20px 16px; max-width: 100%; }
  .pay-method-card { padding: 14px 4px; }
  .pay-instruction-block { padding: 14px 12px 4px; }

  /* Topbar: keep a long username from pushing the layout sideways */
  .hi-user {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Admin package edit/create form fields: stack instead of cramming
     three inputs into one row */
  #packages-section .form-group,
  #packages-section > .card form > div[style*="display:flex"] {
    flex-direction: column;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .pay-method-grid { gap: 6px; }
  .brand-sub { display: none; }
}

/* Large desktop / wide windows: let the page breathe instead of staying
   capped at the same width as a laptop */
@media (min-width: 1400px) {
  .container { max-width: 1240px; }
  .navbar-inner { max-width: 1240px; }
}
