/* ============================================================
   Cloud OTP — Premium Theme
   Palette: Primary Blue #2563EB, Secondary Blue #3B82F6, Light Blue #EFF6FF,
   Background #F8FAFC, Dark Text #0F172A, Secondary Text #64748B, Border #E2E8F0
   ============================================================ */

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --secondary: #3B82F6;
  --light-blue: #EFF6FF;
  --bg: #F8FAFC;
  --text-dark: #0F172A;
  --text-secondary: #64748B;
  --border: #E2E8F0;
  --success: #16A34A;
  --danger: #DC2626;
  --warning: #D97706;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html { overflow-x: hidden; width: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  margin: 0;
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: antialiased;
}

/* Any element that would otherwise force the page wider than the viewport (long
   unbreakable strings like API keys, long phone numbers, etc.) wraps instead. */
.card-custom, .stat-card, .otp-order-card, pre, code {
  max-width: 100%;
  overflow-wrap: break-word;
}
pre { overflow-x: auto; }

a { text-decoration: none; }

/* ---------- Buttons ---------- */
.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  font-size: 0.925rem;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-primary-custom:hover { background: var(--primary-dark); color: #fff; }
.btn-primary-custom:active { transform: scale(0.98); }

.btn-outline-custom {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  font-size: 0.925rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-outline-custom:hover { border-color: var(--primary); background: var(--light-blue); color: var(--primary); }

.btn-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1.6rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-gradient:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: #fff; }

/* ---------- Cards ---------- */
.card-custom {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-custom:hover { box-shadow: var(--shadow-md); }

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.8rem; font-weight: 500; }
.stat-card .stat-value { font-size: 1.65rem; font-weight: 700; color: var(--text-dark); margin-top: 0.25rem; }

/* ---------- Admin dashboard: welcome banner + quick actions ---------- */
.welcome-banner {
  background: linear-gradient(120deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-md);
}
.welcome-banner-right { text-align: right; }
.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
  height: 100%;
}
.quick-action-btn:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }

/* ---------- Badges ---------- */
.badge-status { padding: 0.3rem 0.7rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-waiting_otp { background: #DBEAFE; color: #1E40AF; }

/* ---------- Buy Number: active order cards ---------- */
.otp-order-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #fff;
}
.otp-order-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.otp-phone { font-size: 1.05rem; }
.copy-icon-btn { background: none; border: none; color: var(--primary); padding: 2px 6px; }
.copy-icon-btn:hover { color: var(--primary-dark); }
.otp-wait-box {
  background: var(--light-blue);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
}
.otp-code-box {
  background: #DCFCE7;
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}
.badge-completed { background: #DCFCE7; color: #166534; }
.badge-cancelled { background: #F1F5F9; color: #475569; }
.badge-expired { background: #FEE2E2; color: #991B1B; }
.badge-refunded { background: #F1F5F9; color: #475569; }
.badge-active { background: #DCFCE7; color: #166534; }
.badge-inactive { background: #F1F5F9; color: #475569; }

/* ---------- Navbar (public) ---------- */
.navbar-premium {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
}
.navbar-premium .navbar-brand { font-weight: 800; font-size: 1.3rem; color: var(--text-dark); }
.navbar-premium .nav-link { color: var(--text-secondary); font-weight: 500; margin: 0 0.6rem; }
.navbar-premium .nav-link:hover { color: var(--primary); }

/* ---------- Hero ---------- */
.hero-section {
  background: radial-gradient(circle at 80% 20%, var(--light-blue) 0%, transparent 50%), var(--bg);
  padding: 5rem 0 4rem;
}
.hero-section h1 { font-size: 2.75rem; font-weight: 800; color: var(--text-dark); line-height: 1.15; }
.hero-section p.lead { color: var(--text-secondary); font-size: 1.1rem; max-width: 560px; }

@media (max-width: 768px) {
  .hero-section h1 { font-size: 1.9rem; }
  .hero-section { padding: 3rem 0 2rem; }
}

/* ---------- Step cards (How it Works) ---------- */
.step-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  height: 100%;
}
.step-number {
  width: 40px; height: 40px;
  background: var(--light-blue);
  color: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ---------- FAQ accordion ---------- */
.accordion-item { border: 1px solid var(--border) !important; border-radius: 10px !important; margin-bottom: 0.6rem; overflow: hidden; }
.accordion-button { font-weight: 600; color: var(--text-dark); }
.accordion-button:not(.collapsed) { background: var(--light-blue); color: var(--primary); box-shadow: none; }
.accordion-button:focus { box-shadow: none; }

/* ---------- Footer ---------- */
.footer-premium { background: var(--text-dark); color: #CBD5E1; padding: 3rem 0 1.5rem; }
.footer-premium a { color: #CBD5E1; }
.footer-premium a:hover { color: #fff; }

/* ============================================================
   DASHBOARD LAYOUT (user + admin share this structure)
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 260px;
  background: #fff;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  z-index: 1040;
  transition: transform 0.25s ease;
}
.app-sidebar .sidebar-brand {
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 1.1rem;
}
.app-sidebar .nav-group-title {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text-secondary); text-transform: uppercase;
  padding: 1rem 1.25rem 0.4rem;
}
.app-sidebar .nav-link-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}
.app-sidebar .nav-link-item:hover { background: var(--light-blue); color: var(--primary); }
.app-sidebar .nav-link-item.active {
  background: var(--light-blue); color: var(--primary); border-left-color: var(--primary); font-weight: 600;
}
.app-sidebar .nav-link-item i { width: 18px; text-align: center; }

.app-main { flex: 1; margin-left: 260px; display: flex; flex-direction: column; min-height: 100vh; }

.app-topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky; top: 0; z-index: 1030;
}
.hamburger-btn {
  display: none;
  background: none; border: none; font-size: 1.4rem; color: var(--text-dark);
}

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 1035;
}

@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .hamburger-btn { display: inline-block; }
  .sidebar-backdrop.open { display: block; }
}

.app-content { padding: 1.25rem; flex: 1; }
@media (min-width: 768px) { .app-content { padding: 1.75rem; } }

.balance-pill {
  background: var(--light-blue); color: var(--primary);
  border-radius: 999px; padding: 0.4rem 0.9rem; font-weight: 700; font-size: 0.85rem;
}

/* ---------- Announcement banner ---------- */
.announcement-bar { background: var(--primary); color: #fff; text-align: center; padding: 0.5rem 1rem; font-size: 0.85rem; }

/* ---------- Skeleton loaders ---------- */
.skeleton {
  background: linear-gradient(90deg, #E2E8F0 25%, #EDF2F7 37%, #E2E8F0 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Live chat widget ---------- */
.chat-fab {
  position: fixed; bottom: 20px; right: 20px; z-index: 1050;
  background: var(--primary); color: #fff; border: none;
  width: 56px; height: 56px; border-radius: 50%;
  box-shadow: var(--shadow-lg);
  font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
}
.chat-window {
  position: fixed; bottom: 90px; right: 20px; z-index: 1050;
  width: 340px; max-width: calc(100vw - 40px);
  height: 460px; max-height: calc(100vh - 140px);
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; overflow: hidden; border: 1px solid var(--border);
}
.chat-window.open { display: flex; }
.chat-header { background: var(--primary); color: #fff; padding: 0.9rem 1rem; font-weight: 600; }
.chat-messages { flex: 1; overflow-y: auto; padding: 0.9rem; background: var(--bg); }
.chat-bubble { max-width: 80%; padding: 0.5rem 0.8rem; border-radius: 12px; margin-bottom: 0.5rem; font-size: 0.875rem; }
.chat-bubble.user { background: var(--primary); color: #fff; margin-left: auto; border-bottom-right-radius: 3px; }
.chat-bubble.admin { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.chat-input-row { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.875rem; }

/* ---------- Auth pages ---------- */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, var(--light-blue) 0%, transparent 45%), var(--bg);
  padding: 2rem 1rem;
}
.auth-card {
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 2.25rem; width: 100%; max-width: 420px;
  animation: fade-in-up 0.35s ease;
}
@keyframes fade-in-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.form-control-custom {
  border: 1px solid var(--border); border-radius: 10px; padding: 0.65rem 0.9rem; font-size: 0.925rem;
  width: 100%;
}
.form-control-custom:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--light-blue); }

/* ---------- Utility ---------- */
.text-muted-custom { color: var(--text-secondary); }
.fade-in { animation: fade-in-up 0.3s ease; }

/* ============================================================
   4K PREMIUM POLISH — visual-only upgrade (no content changes)
   Applies to: landing, auth pages, user dashboard, admin panel
   ============================================================ */
html { scroll-behavior: smooth; }
img { max-width: 100%; height: auto; }

/* ---------- Landing: premium dark hero ---------- */
.hero-premium {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1000px 520px at 85% 8%, rgba(59,130,246,.30), transparent 60%),
    radial-gradient(820px 460px at 8% 95%, rgba(37,99,235,.22), transparent 60%),
    linear-gradient(180deg, #0A1428 0%, #0E1E42 60%, #16294f 100%);
  padding: 6.5rem 0 6rem;
  isolation: isolate;
}
.hero-premium::before { /* faint tech grid */
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: .5;
  background-image: linear-gradient(rgba(147,197,253,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(147,197,253,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 30%, #000 30%, transparent 75%);
}
.hero-aurora { position: absolute; border-radius: 50%; filter: blur(90px); z-index: 0; pointer-events: none; }
.hero-aurora.a1 { width: 480px; height: 480px; left: -140px; top: -120px;
  background: radial-gradient(circle, rgba(37,99,235,.55), transparent 65%);
  animation: aurora-drift 14s ease-in-out infinite alternate; }
.hero-aurora.a2 { width: 560px; height: 560px; right: -160px; top: 10%;
  background: radial-gradient(circle, rgba(56,189,248,.42), transparent 65%);
  animation: aurora-drift 18s ease-in-out infinite alternate-reverse; }
.hero-aurora.a3 { width: 380px; height: 380px; left: 38%; bottom: -160px;
  background: radial-gradient(circle, rgba(99,102,241,.38), transparent 65%);
  animation: aurora-drift 16s ease-in-out infinite alternate; }
@keyframes aurora-drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(60px,40px) scale(1.12); }
}
#hero-particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-premium .container { position: relative; z-index: 2; }

.hero-premium h1 { color: #fff; font-size: 3.1rem; letter-spacing: -0.02em;
  text-shadow: 0 2px 30px rgba(37,99,235,.45); }
.hero-premium p.lead { color: #C7D6F5; }
.grad-text {
  background: linear-gradient(100deg, #93C5FD 0%, #38BDF8 45%, #A5B4FC 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(147,197,253,.10); border: 1px solid rgba(147,197,253,.28);
  color: #DBEAFE; font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  padding: .45rem 1rem; border-radius: 999px; margin-bottom: 1.25rem;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-badge .pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80;
  box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: pulse-ring 2s infinite; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.55); }
  70% { box-shadow: 0 0 0 10px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.hero-premium .btn-outline-custom {
  background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(147,197,253,.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-premium .btn-outline-custom:hover { background: rgba(147,197,253,.16); border-color: #93C5FD; color: #fff; }

/* Hero visual: image + floating glass card */
.hero-visual { position: relative; max-width: 520px; margin-left: auto; }
.hero-img-wrap { position: relative; border-radius: 26px; overflow: hidden;
  border: 1px solid rgba(147,197,253,.30);
  box-shadow: 0 30px 80px rgba(2,8,30,.55), 0 0 60px rgba(59,130,246,.35);
  animation: float-y 7s ease-in-out infinite; transform-style: preserve-3d; }
.hero-img { display: block; width: 100%; border-radius: 26px; }
.hero-img-wrap::after { content: ""; position: absolute; inset: 0; border-radius: 26px;
  background: linear-gradient(180deg, transparent 55%, rgba(10,20,40,.45)); pointer-events: none; }
@keyframes float-y { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.hero-float-card {
  position: absolute; left: -34px; bottom: -26px; z-index: 3; width: min(360px, 88%);
  background: rgba(255,255,255,.94) !important;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.7) !important;
  box-shadow: 0 24px 60px rgba(2,8,30,.45), 0 0 40px rgba(59,130,246,.25) !important;
  animation: float-y 8s ease-in-out infinite; animation-delay: 1.2s;
}
.hero-float-card .badge-completed { animation: badge-blink 2.4s ease-in-out infinite; }
@keyframes badge-blink { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

@media (max-width: 991px) {
  .hero-premium { padding: 4rem 0 4.5rem; }
  .hero-premium h1 { font-size: 2.1rem; }
  .hero-visual { margin: 2.5rem auto 0; }
  .hero-float-card { position: relative; left: auto; bottom: auto; margin: -46px auto 0; }
}

/* ---------- Scroll reveal (JS-gated so content never hides without JS) ---------- */
html.has-js .reveal { opacity: 0; transform: translateY(28px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.16,1,.3,1); }
html.has-js .reveal.revealed { opacity: 1; transform: none; }
html.has-js .reveal-d1 { transition-delay: .08s; } html.has-js .reveal-d2 { transition-delay: .16s; }
html.has-js .reveal-d3 { transition-delay: .24s; } html.has-js .reveal-d4 { transition-delay: .32s; }
html.has-js .reveal-d5 { transition-delay: .40s; } html.has-js .reveal-d6 { transition-delay: .48s; }

/* ---------- Section heading accent (visual only) ---------- */
.sec-head { position: relative; padding-bottom: 1rem; }
.sec-head::after { content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 72px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), #A5B4FC); }

/* ---------- Step cards: premium ---------- */
.step-card { position: relative; overflow: hidden;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease; }
.step-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary)); opacity: 0; transition: opacity .3s ease; }
.step-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.step-card:hover::before { opacity: 1; }
.step-number { background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.35); }

/* ---------- Feature cards: premium ---------- */
#features .card-custom { position: relative; overflow: hidden;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease; }
#features .card-custom::after { content: ""; position: absolute; width: 220px; height: 220px;
  right: -70px; top: -70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.14), transparent 70%);
  opacity: 0; transition: opacity .35s ease; pointer-events: none; }
#features .card-custom:hover { transform: translateY(-8px) scale(1.01);
  box-shadow: 0 18px 44px rgba(37,99,235,.16); border-color: #BFDBFE; }
#features .card-custom:hover::after { opacity: 1; }
#features .card-custom h5 { position: relative; z-index: 1; }

/* ---------- Why-choose visual ---------- */
.why-visual { position: relative; border-radius: 24px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(15,23,42,.14), 0 0 50px rgba(59,130,246,.12);
  transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s ease; }
.why-visual:hover { transform: translateY(-6px) scale(1.01);
  box-shadow: 0 30px 70px rgba(15,23,42,.18), 0 0 60px rgba(59,130,246,.22); }
.why-img { display: block; width: 100%; }
.stat-card { transition: box-shadow .3s ease, transform .3s ease; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-value { background: linear-gradient(120deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-value.text-primary { -webkit-text-fill-color: transparent; }

/* ---------- Buttons: sheen sweep ---------- */
.btn-gradient, .btn-primary-custom, .quick-action-btn { position: relative; overflow: hidden; }
.btn-gradient::after { content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .6s ease; }
.btn-gradient:hover::after { left: 130%; }

/* ---------- Navbar: glassy sticky ---------- */
.navbar-premium { position: sticky; top: 0; z-index: 1020;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: box-shadow .25s ease; }
.navbar-premium.scrolled { box-shadow: 0 6px 24px rgba(15,23,42,.10); }
.navbar-premium .nav-link { position: relative; }
.navbar-premium .nav-link::after { content: ""; position: absolute; left: .6rem; right: .6rem; bottom: -2px;
  height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.navbar-premium .nav-link:hover::after { transform: scaleX(1); }

/* ---------- Footer: gradient top edge ---------- */
.footer-premium { position: relative; }
.footer-premium::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), #38BDF8, var(--secondary), #A5B4FC); }

/* ---------- Global app polish (dashboards, admin, auth) ---------- */
.app-content { animation: app-fade .45s ease; }
@keyframes app-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.app-topbar { background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.app-sidebar .nav-link-item { transition: background .18s ease, color .18s ease, border-color .18s ease; }
.app-sidebar .nav-link-item.active { box-shadow: inset 0 0 0 1px rgba(37,99,235,.12), 0 4px 14px rgba(37,99,235,.14); }
.card-custom:hover { transform: translateY(-2px); }
.auth-card { position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), #A5B4FC); }
.announcement-bar { background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--secondary)); }
.chat-fab { transition: transform .2s ease, box-shadow .2s ease; }
.chat-fab:hover { transform: scale(1.08) rotate(6deg); box-shadow: 0 12px 32px rgba(37,99,235,.45); }
.accordion-item { transition: box-shadow .25s ease; }
.accordion-item:has(.accordion-button:not(.collapsed)) { box-shadow: 0 10px 28px rgba(37,99,235,.12); border-color: #BFDBFE !important; }
.form-control-custom, .otp-order-card { transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease; }
.otp-order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  html.has-js .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   MOBILE HARDENING — dashboard + admin + landing (visual only)
   Fixes: zoomed-out pages (horizontal overflow), scroll lag,
   cramped topbar / stat cards on small phones.
   ============================================================ */
.app-main, .app-content, .app-sidebar, .card-custom, .stat-card { min-width: 0; }
.app-content img, .app-content canvas, .app-content table { max-width: 100%; }
.stat-value, .otp-phone { overflow-wrap: anywhere; }
.hero-premium .d-flex { flex-wrap: wrap; }

@media (max-width: 767px) {
  /* perf: backdrop blur + big animated blurs are the main scroll-lag
     culprits on low-end phones — use solid surfaces instead */
  .app-topbar { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .navbar-premium { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .app-content { animation: none; padding: 0.9rem; }
  .card-custom:hover { transform: none; }
  .hero-aurora { animation: none; filter: blur(60px); opacity: .7; }
  .hero-aurora.a1 { width: 300px; height: 300px; }
  .hero-aurora.a2 { width: 340px; height: 340px; }
  .hero-aurora.a3 { display: none; }

  /* topbar never overflows a 360px screen */
  .app-topbar { padding: 0 .7rem; }
  .app-topbar .ms-auto { min-width: 0; }
  .balance-pill { font-size: .72rem; padding: .3rem .65rem; max-width: 38vw;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* stat cards: money values must fit half-width columns */
  .stat-card { padding: .85rem .8rem; }
  .stat-value { font-size: 1.2rem; line-height: 1.25; }
  .stat-label { font-size: .72rem; }

  .quick-action-btn { font-size: .78rem; padding: .7rem .4rem; }
  .welcome-banner { padding: 1.2rem 1.25rem; }
  .welcome-banner h3 { font-size: 1.2rem; }
  .welcome-banner .fs-3 { font-size: 1.3rem !important; }

  /* compact tables on phones */
  .table { font-size: .8rem; }
  .table > :not(caption) > * > * { padding: .45rem .4rem; }

  .app-content h3 { font-size: 1.3rem; }
  .app-content h5 { font-size: 1rem; }
  .btn { font-size: .85rem; }

  /* chat widget fits small screens */
  .chat-window { width: calc(100vw - 32px); right: 16px; bottom: 84px; }
  .auth-card { padding: 1.6rem 1.25rem; }

  /* dropdowns never overflow the viewport */
  .dropdown-menu { max-width: calc(100vw - 24px); }
}

@media (max-width: 480px) {
  /* hide the admin username text in the topbar on tiny screens (bell + balance stay) */
  .app-topbar span.fw-semibold { display: none; }
  .stat-value { font-size: 1.05rem; }
  .stat-card { padding: .7rem .6rem; }
}

/* ============================================================
   V3 — overflow lockdown + tables + brand mark (visual only)
   Fixes: any horizontal overflow that caused mobile zoom-out,
   wide tables on phones, broken image permissions handled at
   package level (all files 644 / dirs 755).
   ============================================================ */
html, body { overflow-x: hidden; }
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}
img { max-width: 100%; height: auto; }
svg { max-width: 100%; }

/* tables can never push the page wider than the screen (alignment-safe) */
.app-content table { width: 100%; max-width: 100%; }
@media (max-width: 767px) {
  .app-content table { table-layout: fixed; }
  .app-content table td, .app-content table th { overflow-wrap: anywhere; }
}

/* long strings (order ids, hashes, api keys) wrap instead of overflow */
.app-content td, .app-content th, .card-custom { overflow-wrap: anywhere; }

/* brand mark: gradient shield */
.brand-mark { display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; vertical-align: -8px; margin-right: .45rem;
  background: linear-gradient(135deg, #2563EB, #38BDF8);
  box-shadow: 0 4px 14px rgba(37,99,235,.4); }
.brand-mark svg { width: 20px; height: 20px; }
.navbar-brand { font-weight: 800; letter-spacing: -.01em; }
