/* RAJ PREMIUM PANEL — final layer v8 (loaded after v7 on every shell).
   1. Login / Register card: the pulse glow is removed. A thicker light line now travels smoothly
      around the card border at medium speed (one lap every 4.5s).
   2. Every other card: a larger and stronger border glow pulse. Glow reach is matched to the space
      between neighbouring cards, so two cards' glows never overlap.
   Only borders / glow / the gap between cards are touched. No colours of content, no layout of the
   forms, no scripts and no application behaviour change. */

/* =====================================================================
   1. LOGIN / REGISTER CARD — travelling border line (no pulse glow)
   Speed knob: --rv8-orbit-time. Thickness knob: --rv8-line.
   ===================================================================== */
:root {
  --rv8-orbit-time: 4.5s;
  --rv8-line: 3px;
}

@property --rv8-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes rajV8Orbit { to { --rv8-angle: 360deg; } }

html body:not(#rajx) .auth-container,
html body:not(#rajx) #login-ui.auth-container {
  /* quiet static border underneath the moving line; no glow / no pulse */
  border: 1.5px solid rgba(78, 153, 220, .38) !important;   /* site sapphire (same blue as every other card) */
  background: #0d1420 !important;
  box-shadow: none !important;
  animation: none !important;
}

html body:not(#rajx) .auth-container::before,
html body:not(#rajx) #login-ui.auth-container::before {
  content: "" !important;
  display: block !important;
  visibility: visible !important;
  position: absolute !important;
  top: -1.5px !important; right: -1.5px !important; bottom: -1.5px !important; left: -1.5px !important; /* sit exactly on the card border box */
  width: auto !important;                   /* header.php's legacy ::before had width/height 200% */
  height: auto !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 0 !important;
  box-sizing: border-box !important;
  padding: var(--rv8-line) !important;      /* ring thickness */
  border: 0 !important;
  border-radius: inherit !important;
  pointer-events: none !important;
  background: conic-gradient(
    from var(--rv8-angle),
    rgba(84, 207, 223, 0)    0deg,
    rgba(84, 207, 223, 0)    235deg,
    rgba(47, 112, 191, .55)  288deg,   /* sapphire tail */
    rgba(84, 207, 223, .95)  340deg,   /* site cyan */
    #eaf6ff                  358deg,   /* ice-white head */
    rgba(84, 207, 223, 0)    360deg
  ) !important;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0) !important;
  -webkit-mask-composite: xor !important;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0) !important;
  mask-composite: exclude !important;
  opacity: 1 !important;
  box-shadow: none !important;
  filter: none !important;
  animation: rajV8Orbit var(--rv8-orbit-time) linear infinite !important;
}
html body:not(#rajx) .auth-container::after,
html body:not(#rajx) #login-ui.auth-container::after {
  content: none !important;
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html body:not(#rajx) .auth-container::before,
  html body:not(#rajx) #login-ui.auth-container::before { animation: none !important; --rv8-angle: 0deg; }
}

/* =====================================================================
   2. ALL OTHER CARDS — bigger + stronger glow pulse, no overlap
   The shared keyframes below replace the v4/v7 ones of the same name (last definition wins), so every
   card that already used the shared pulse gets the new size without touching its selector.
   --rv8-k scales the glow reach for tightly packed cards (default 1).
   Reach at peak (k = 1): ~6px solid glow + ~12px soft halo, peak alpha 1 / .60
   (previous: ~3px / ~6px, peak alpha .95 / .42).
   ===================================================================== */
@keyframes rajBuyKeysSharedPulseV4 {
  0%, 100% {
    --raj-v4-edge-alpha: .55;
    --raj-v4-near-radius: calc(2px * var(--rv8-k, 1));
    --raj-v4-near-alpha: .34;
    --raj-v4-far-radius: calc(4px * var(--rv8-k, 1));
    --raj-v4-far-alpha: .12;
  }
  50% {
    --raj-v4-edge-alpha: 1;
    --raj-v4-near-radius: calc(6px * var(--rv8-k, 1));
    --raj-v4-near-alpha: 1;
    --raj-v4-far-radius: calc(12px * var(--rv8-k, 1));
    --raj-v4-far-alpha: .60;
  }
}

/* Buy Keys video card (companion glow, half a cycle out of phase) — same larger area */
@keyframes rajV7VideoPulse {
  0%, 100% { --rv7-va: .55; --rv7-vg: .16; --rv7-vr: 2px; }
  50%      { --rv7-va: 1;   --rv7-vg: 1;   --rv7-vr: 8px; }
}

/* ---- Space between cards: at least twice the glow reach, so glows stay separate ---- */
/* Dashboard stacks and grids */
html body:not(#rajx) .dstack { gap: 18px !important; }
html body:not(#rajx) .dgrid  { gap: 18px !important; }
html body:not(#rajx) .qgrid  { gap: 14px !important; }
html body:not(#rajx) .qgrid > .qt { --rv8-k: .7; }
html body:not(#rajx) .ra-stats { gap: 14px !important; }
html body:not(#rajx) .ra-stats > div { --rv8-k: .7; }

/* Dashboard stack: spacing comes from the gap only (same rule as dash.css), so margins below never double up */
html body:not(#rajx) .dstack > * { margin: 0 !important; }

/* Stand-alone cards stacked vertically */
html body:not(#rajx) .panel   { margin-top: 20px !important; }
html body:not(#rajx) .upd     { margin-top: 22px !important; }
html body:not(#rajx) .top5    { margin-top: 22px !important; }
html body:not(#rajx) .kcard   { margin-top: 20px !important; }
html body:not(#rajx) .pc      { margin-top: 20px !important; }
html body:not(#rajx) .pcard   { margin-top: 18px !important; }
html body:not(#rajx) .tk-card { margin-top: 18px !important; margin-bottom: 20px !important; }
html body:not(#rajx) .pf-card { margin-bottom: 20px !important; }
html body:not(#rajx) .rs-card { margin-bottom: 20px !important; }
html body:not(#rajx) .ra-card { margin-bottom: 20px !important; }
html body:not(#rajx) .ra-pn   { margin-bottom: 18px !important; }
html body:not(#rajx) .pn      { margin-top: 20px !important; margin-bottom: 20px !important; }

/* Small cards that sit close together: slightly smaller reach + a little more gap */
html body:not(#rajx) .dp-stat { --rv8-k: .7; margin-bottom: 14px !important; }
html body:not(#rajx) .ra-pl   { --rv8-k: .6; margin-bottom: 12px !important; }

/* Cards nested inside another card must keep their glow inside the parent's padding */
html body:not(#rajx) :is(.ra-card, .rs-card, .pf-card) :is(.ra-pn, .ra-pl, .dp-stat) { --rv8-k: .6; }

/* =====================================================================
   3. BRANDING UNDER THE SOCIAL ICONS
   - more space between the social icons and the brand name
   - less space between the brand name and the "SECURE • year" line
   - brand name slightly larger
   ===================================================================== */
html body:not(#rajx) .raj-brand-sign {
  margin-top: 16px;            /* was 4px (collapsed with the icon strip's 8px) → icons ↔ branding gap doubles */
  row-gap: 3px;                /* was 8px → brand name ↔ SECURE line closer */
}
html body:not(#rajx) .raj-brand-sign .rbs-name { font-size: 14.5px; }   /* was 12.5px */
html body:not(#rajx) .raj-brand-sign .rbs-sub  { margin-top: 0; }       /* was 1px */
@media (max-width: 380px) {
  html body:not(#rajx) .raj-brand-sign .rbs-name { font-size: 12.5px; } /* was 11px */
}

/* =====================================================================
   4. WHOLE SITE +4% SIZE
   One knob (defined in v7 as .92). .92 × 1.04 = .9568 → every card, text, button and icon on user,
   reseller and admin pages and the login / register card grows by exactly 4% from its current size.
   ===================================================================== */
:root { --raj-ui-scale: .9568; }

/* ====================================================================================================
   Equal card spacing inside one page (final layer).
   Each page keeps ONE gap for its cards; different pages may still use different gaps.
   ==================================================================================================== */
/* User dashboard: the update-group card and the Top 5 card no longer add an extra 22px (gap stays 18px like every other card) */
html body:not(#rajx) .dstack > .upd,
html body:not(#rajx) .dstack > .top5 { margin-top: 0 !important; }
/* User dashboard: live chart cards use the same 18px gap */
html body:not(#rajx) .dstack .live-charts { gap: 18px !important; }
/* Reseller page: cards are 20px apart, so the charts and the currency card follow the same 20px */
html body:not(#rajx) .rs ~ .live-charts { gap: 20px !important; }
html body:not(#rajx) .rs > .currency-switcher-card { margin-bottom: 20px !important; }
/* Refer page: info card, stat tiles, code card and claim card all 14px apart */
html body:not(#rajx) .rgrid { margin-top: 14px !important; }
/* Admin dashboard: stat boxes and chart cards use the same 14px as the gap between those blocks */
html body:not(#rajx) .grid { gap: 14px !important; }
html body:not(#rajx) .admin-live-charts { gap: 14px !important; }

/* "JOIN NOW" button of the All Update Group card: clearly visible, still follows the selected theme colour */
html body:not(#rajx) .nc.upd .jn {
  border: 1px solid rgba(var(--rp-a), .95) !important;
  background: linear-gradient(135deg, rgba(var(--rp-a), .62), rgba(var(--rp-a), .34)) !important;
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(var(--rp-a), .9), 0 1px 2px rgba(0, 0, 0, .55) !important;
  box-shadow: 0 0 16px rgba(var(--rp-a), .5), inset 0 0 14px rgba(var(--rp-a), .25) !important;
}
html body:not(#rajx) .nc.upd .jn:active {
  background: linear-gradient(135deg, rgba(var(--rp-a), .8), rgba(var(--rp-a), .5)) !important;
}

/* Product reference table: product card and duration cards get their own colours */
html body:not(#rajx) .ra-pn { --raj-v4-edge-rgb: 139, 92, 246; --raj-v4-alt-rgb: 99, 102, 241; }
html body:not(#rajx) .ra-pl { --raj-v4-edge-rgb: 245, 158, 11; --raj-v4-alt-rgb: 251, 191, 36; }
html body:not(#rajx) .ra-pno { display:inline-flex; align-items:center; justify-content:center; vertical-align:middle; min-width:26px; height:26px; padding:0 7px; margin-right:10px; border-radius:8px; font-size:13px; font-weight:800; line-height:1; color:#fff; background:linear-gradient(135deg,#8b5cf6,#6366f1); box-shadow:0 0 10px rgba(139,92,246,.55); }

/* Buy Keys: the glow of the image/video card is drawn ABOVE the text block under it, so its bottom edge glows like the other three sides */
html body:not(#rajx) .pn .pn-video-card { position: relative; z-index: 2; }
