/* ==========================================================================
   hoaxnet — Network Instrument
   ---------------------------------------------------------------------------
   Design system for a Persian (RTL) VPN storefront.

   The one rule that shapes everything: COLOR IS LOAD-BEARING. Violet is the
   brand and marks exactly one primary action per view. Every other hue means
   something specific — a protocol, a status. Nothing is tinted for decoration.
   Get this wrong and the page collapses back into a single-hue neon demo.

   Type carries the second rule: anything a customer compares — price, latency,
   stock, order id, protocol — is set in mono and aligned, so a column of plans
   reads as a readout rather than as prose.
   ========================================================================== */

:root {
  /* --- surface: four real elevation steps, not one translucent grey --- */
  --bg: #05010a;
  --bg-2: #060014;
  --bg-solid: #0b0416;
  --surface-1: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --bg-inset: rgba(3, 0, 9, 0.6);
  /* legacy aliases — older rules still reference these */
  --bg-elevated: var(--surface-2);
  --bg-elevated-2: var(--surface-3);

  /* --- ink --- */
  --text: #efecff;
  --text-muted: rgba(239, 236, 255, 0.72);
  --text-faint: rgba(239, 236, 255, 0.46);

  /* --- brand violet: the primary action, and nothing else --- */
  --accent: #bc13fe;
  --accent-soft: #d98cff;
  --accent-dim: rgba(188, 19, 254, 0.42);
  --accent-wash: rgba(188, 19, 254, 0.11);

  /* --- protocol hues: each one identifies a product, consistently,
         on filter tabs, card spines, badges and the tutorial guide --- */
  --p-wireguard: #00f0ff;   /* fastest — cyan reads as low-latency */
  --p-v2ray: #c86bff;       /* most flexible — closest to brand violet */
  --p-openvpn: #ffb020;     /* broadest compatibility — amber */
  --p-l2tp: #5ce0a0;        /* legacy, multi-device — mint */

  /* --- status: distinct from every protocol hue so state never reads
         as a product attribute --- */
  --ok: #3ddc97;
  --ok-wash: rgba(61, 220, 151, 0.12);
  --warn: #ffb020;
  --warn-wash: rgba(255, 176, 32, 0.12);
  --danger: #ff4d6d;
  --danger-wash: rgba(255, 77, 109, 0.12);
  --info: #00f0ff;
  --info-wash: rgba(0, 240, 255, 0.1);
  /* legacy aliases */
  --accent2: var(--info);
  --accent2-wash: var(--info-wash);
  --success: var(--ok);

  /* --- lines: neutral by default. A violet border is a deliberate signal,
         not the house style, otherwise everything glows and nothing reads --- */
  --border: rgba(239, 236, 255, 0.11);
  --border-quiet: rgba(239, 236, 255, 0.07);
  --border-loud: rgba(188, 19, 254, 0.42);

  /* --- depth --- */
  --glow: 0 0 24px rgba(188, 19, 254, 0.22);
  --glow-strong: 0 0 32px rgba(188, 19, 254, 0.4);
  --glow-cyan: 0 0 24px rgba(0, 240, 255, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --lift: 0 18px 40px -18px rgba(0, 0, 0, 0.85);
  --lift-lg: 0 28px 60px -24px rgba(0, 0, 0, 0.95);

  /* --- geometry --- */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --radius-pill: 999px;
  --blur: 14px;

  /* --- type --- */
  --font-body: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-latin: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  --step-micro: 0.68rem;
  --step-eyebrow: 0.72rem;
  --step-small: 0.84rem;
  --step-body: 0.95rem;
  --step-lede: 1.05rem;
  --step-h4: 1.02rem;
  --step-h3: 1.18rem;
  --step-h2: clamp(1.55rem, 3vw, 2rem);
  --step-h1: clamp(2.1rem, 5vw, 3.5rem);

  /* --- spacing scale: every margin/padding in the app comes from here --- */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 22px;
  --s6: 30px;
  --s7: 42px;
  --s8: 60px;

  /* --- rhythm --- */
  --gap: 18px;
  --section-y: clamp(52px, 7vw, 84px);
  --page-x: clamp(16px, 4vw, 32px);
  --measure: 62ch;

  /* Replaceable hero art. Swap for a real photo:
     --hero-photo: url('/img/your-photo.jpg'); */
  --hero-photo: url('/img/hero-keyboard.svg');
}

/* Protocol theming. Set --p on any container and its children inherit the
   right hue — that is how one card rule serves four products. Plans with no
   protocol (gift cards, stock items) fall back to a neutral steel so they
   never borrow a hue that would imply a product they are not. */
[data-protocol]             { --p: #8ea0c4; }
[data-protocol='WireGuard'] { --p: var(--p-wireguard); }
[data-protocol='V2Ray']     { --p: var(--p-v2ray); }
[data-protocol='OpenVPN']   { --p: var(--p-openvpn); }
[data-protocol='L2TP']      { --p: var(--p-l2tp); }

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

html {
  background:
    radial-gradient(1200px 700px at 80% -10%, #120326 0%, transparent 60%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.75;
  direction: rtl;
  /* کاربرها لینک کانفیگ و آدرس سرور رو بدون فاصله می‌چسبونن توی تیکت و فرم؛
     بدون این، همون یه رشته کل صفحه رو توی موبایل پهن می‌کنه. */
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
img { display: block; }

h1, h2, h3, h4 { line-height: 1.3; text-wrap: balance; }

p { text-wrap: pretty; }

code, .mono, [dir='ltr'] { font-family: var(--font-mono); }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Background system — aurora + grid + grain, fixed behind every page
   ========================================================================== */

.bg-layers {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-aurora { position: absolute; inset: -20%; filter: blur(100px); }

.bg-aurora span {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: 0.34;
  will-change: transform;
}

.bg-aurora span:nth-child(1) {
  width: 46vw; height: 46vw; top: -8%; right: -6%;
  background: radial-gradient(circle, rgba(188, 19, 254, 0.5), transparent 68%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
.bg-aurora span:nth-child(2) {
  width: 38vw; height: 38vw; bottom: -12%; left: -8%;
  background: radial-gradient(circle, rgba(124, 0, 200, 0.45), transparent 70%);
  animation: drift-b 32s ease-in-out infinite alternate;
}
.bg-aurora span:nth-child(3) {
  width: 26vw; height: 26vw; top: 42%; left: 34%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.18), transparent 72%);
  animation: drift-c 38s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-6vw, 8vh, 0) scale(1.18); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(7vw, -6vh, 0) scale(0.92); }
}
@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(0.9); }
  to   { transform: translate3d(-9vw, -10vh, 0) scale(1.25); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(188, 19, 254, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(188, 19, 254, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 15%, transparent 70%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 15%, transparent 70%);
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* Admin keeps the same world, dialled down so data stays legible */
.bg-layers.is-subtle .bg-aurora { opacity: 0.42; }
.bg-layers.is-subtle .bg-grid { opacity: 0.5; }
.bg-layers.is-subtle .bg-noise { opacity: 0.18; }

#matrix-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.05;
  pointer-events: none;
}

/* Background animation off — user toggle or OS preference */
body.motion-off .bg-aurora span,
body.motion-off .hero-pulse,
body.motion-off .mascot-wrap,
body.motion-off .mascot-flag { animation: none !important; }
body.motion-off #matrix-bg { display: none; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Primitives
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--page-x);
}

.glass {
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
}

.card,
.plan-card,
.purchase-card,
.admin-card,
.auth-wrap,
.result-wrap,
.stat-card,
.keyboard-fx {
  background: var(--surface-1);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--lift);
}

.grid { display: grid; gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }

.card-pad { padding: var(--s5); margin-bottom: var(--s5); }
.card-pad h3 { margin-top: 0; }
.text-muted { color: var(--text-muted); }
.sub-head { color: var(--text); margin: var(--s6) 0 0; font-size: var(--step-h4); font-weight: 700; }
.stack-head { margin: var(--s6) 0 var(--s4); font-size: var(--step-h3); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin-top: var(--s5); }

/* --- buttons -------------------------------------------------------------
   Three tiers, and the tier says how important the action is:
   primary (violet, one per view) · secondary (outlined) · quiet (text-weight).
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--step-body);
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: transform 0.14s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled,
.btn[disabled] { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.btn-primary {
  background: linear-gradient(135deg, #cf3bff 0%, var(--accent) 58%, #8d0bc4 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--glow);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: var(--glow-strong);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--border-loud);
  background: var(--surface-3);
  color: #fff;
}

/* Quiet tier — for repeated, low-stakes actions like a list of download links,
   where a row of outlined buttons would read as a row of primary CTAs. */
.btn-quiet {
  background: transparent;
  border-color: var(--border-quiet);
  color: var(--text-muted);
  font-weight: 500;
}
.btn-quiet:hover:not(:disabled) { color: var(--text); border-color: var(--border); background: var(--surface-1); }

.btn-cyan {
  background: transparent;
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--info);
}
.btn-cyan:hover { box-shadow: var(--glow-cyan); border-color: var(--info); }

.btn-sm { padding: 7px 14px; font-size: var(--step-small); border-radius: var(--radius-xs); }
.btn-block { width: 100%; }

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--step-body);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.link-btn:hover { color: var(--danger); }
.inline-form { display: inline; }

.link-accent { color: var(--accent-soft); text-decoration: underline; text-decoration-color: var(--accent-dim); text-underline-offset: 3px; }
.link-accent:hover { color: #fff; text-decoration-color: currentColor; }

/* --- pills / badges --- */
.pill,
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-quiet);
  background: var(--surface-1);
  color: var(--text-muted);
  font-size: var(--step-small);
  transition: border-color 0.18s, color 0.18s, box-shadow 0.18s, background 0.18s;
}
.pill:hover,
.filter-tab:hover {
  border-color: var(--p, var(--accent));
  color: var(--text);
  background: var(--surface-2);
}
/* Active filter is filled with that protocol's own hue, so the tab bar doubles
   as the colour legend for the cards below it. */
.filter-tab.active {
  background: color-mix(in srgb, var(--p, var(--accent)) 16%, transparent);
  border-color: var(--p, var(--accent));
  color: var(--text);
  font-weight: 600;
}
.filter-tab .tab-swatch,
.pill .tab-swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--p, var(--accent));
  flex: none;
}

.badge,
.meta-badge,
.purchase-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-quiet);
  background: var(--surface-1);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge-active,
.status-paid { background: var(--ok-wash); border-color: rgba(61, 220, 151, 0.34); color: var(--ok); }
.badge-inactive { background: var(--surface-1); border-color: var(--border-quiet); color: var(--text-faint); }
.status-pending { background: var(--warn-wash); border-color: rgba(255, 176, 32, 0.36); color: var(--warn); }
.status-failed { background: var(--danger-wash); border-color: rgba(255, 77, 109, 0.4); color: var(--danger); }

.meta-badge.protocol {
  border-color: color-mix(in srgb, var(--p, var(--accent)) 45%, transparent);
  color: var(--p, var(--accent-soft));
  background: color-mix(in srgb, var(--p, var(--accent)) 12%, transparent);
}
.meta-badge.static-ip { border-color: rgba(0, 240, 255, 0.32); color: var(--info); background: var(--info-wash); }
.meta-badge.flag { font-size: 0.85rem; }

/* --- inputs --- */
.field { margin-bottom: var(--s4); }
.field label,
.field-label-strong {
  display: block;
  font-size: var(--step-small);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
/* A hint sits under the label and explains the format before the user gets it
   wrong — cheaper than an error message after submit. */
.field-hint {
  display: block;
  font-size: var(--step-micro);
  color: var(--text-faint);
  margin: -2px 0 6px;
  line-height: 1.6;
}
.field-optional {
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  color: var(--text-faint);
  font-weight: 400;
  margin-inline-start: 6px;
}

.input,
.field input,
.field textarea,
.field select,
.copy-field input {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-body);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.field textarea { line-height: 1.8; resize: vertical; }
.field select { appearance: none; cursor: pointer; }

.input::placeholder,
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }

.input:hover,
.field input:hover,
.field textarea:hover,
.field select:hover { border-color: var(--border-loud); }

.input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.copy-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(188, 19, 254, 0.2);
  background: rgba(3, 0, 9, 0.8);
}

/* Only flag invalid after the user has actually typed something — :invalid
   alone would paint every required field red on page load. */
.field input:not(:placeholder-shown):invalid,
.field textarea:not(:placeholder-shown):invalid {
  border-color: rgba(255, 77, 109, 0.5);
}
.field input:not(:placeholder-shown):invalid:focus {
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.18);
}

.field input[type='checkbox'] {
  width: auto;
  accent-color: var(--accent);
  vertical-align: middle;
}

/* --- alerts --- */
.alert,
.form-error {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: var(--step-small);
  line-height: 1.7;
  margin-bottom: var(--s4);
  border: 1px solid;
  border-inline-start-width: 3px;
}
.alert::before {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: none;
}
.alert-error,
.form-error { background: var(--danger-wash); border-color: rgba(255, 77, 109, 0.42); color: #ffb3c4; }
.alert-error::before { content: '!'; color: var(--danger); font-weight: 700; }
.alert-success { background: var(--ok-wash); border-color: rgba(61, 220, 151, 0.4); color: #a9f2d3; }
.alert-success::before { content: '✓'; color: var(--ok); }
.alert-info { background: var(--info-wash); border-color: rgba(0, 240, 255, 0.36); color: #b6f4ff; }
.alert-info::before { content: 'i'; color: var(--info); font-style: italic; }

.form-note { text-align: center; margin-top: var(--s4); font-size: var(--step-small); color: var(--text-muted); }

/* Two short fields share a row on desktop and stack below 520px — auto-fit
   handles it without a media query, so nothing overflows on narrow phones. */
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 0 var(--s3);
}

.quick-answers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  font-size: var(--step-small);
  color: var(--text-muted);
}
.quick-answers li {
  padding-inline-start: var(--s4);
  position: relative;
  line-height: 1.9;
}
.quick-answers li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.85em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent2);
  opacity: 0.7;
}

.note {
  background: var(--bg-inset);
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: var(--step-small);
  color: var(--text-muted);
  line-height: 1.75;
}

.note.field-error {
  background: var(--danger-wash);
  border-color: rgba(255, 77, 109, 0.42);
  color: #ffb3c4;
}

/* --- section scaffolding --- */
.section {
  padding: var(--section-y) var(--page-x);
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
}
.section-narrow { max-width: 820px; }
/* Consecutive sections would otherwise stack two full --section-y paddings
   into one gap wide enough to read as an empty screen. */
.section + .section { padding-top: 0; }

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step-eyebrow);
  letter-spacing: 0.18em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: var(--s3);
}

.eyebrow-center { text-align: center; }

.section-title {
  margin: 0 0 var(--s2);
  font-size: var(--step-h2);
  font-weight: 800;
  letter-spacing: -0.015em;
}
.section-sub {
  color: var(--text-muted);
  margin: 0 0 var(--s6);
  max-width: var(--measure);
  font-size: var(--step-lede);
  line-height: 1.8;
}
.eyebrow-center + .section-title,
.section-title.is-center { text-align: center; }
.eyebrow-center ~ .section-sub { margin-inline: auto; text-align: center; }

/* Section head with an action on the far side (e.g. "see all plans") */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-bottom: var(--s6);
}
.section-head .section-title,
.section-head .section-sub { text-align: start; }
.section-head .section-sub { margin-bottom: 0; }
.section-head-text { min-width: 0; }

/* ==========================================================================
   Header
   ========================================================================== */

/* پرش به محتوا — تا وقتی فوکوس نگرفته کاملا بیرون از دیده. */
.skip-link {
  position: fixed;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 200;
  transform: translateY(-200%);
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--step-small);
  font-weight: 600;
  transition: transform 0.18s ease;
}
.skip-link:focus-visible { transform: translateY(0); outline: 2px solid #fff; outline-offset: 2px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px var(--page-x);
  background: rgba(8, 2, 18, 0.62);
  backdrop-filter: blur(var(--blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.site-header.is-scrolled {
  background: rgba(8, 2, 18, 0.86);
  box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.9), 0 0 30px -8px rgba(188, 19, 254, 0.35);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(188, 19, 254, 0.55)); }
.brand-word {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, #fff 20%, var(--accent-soft) 70%, var(--accent2) 105%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--s5);
  margin-inline-start: auto;
}
/* دو گروه لینک: کاتالوگ (چیزهایی که می‌خری) و حساب. فاصله‌ی بین گروه‌ها
   بیشتر از فاصله‌ی داخل گروهه، چون همین فاصله معنی گروه‌بندی رو می‌رسونه. */
.nav-group { display: flex; align-items: center; gap: 2px; }
.nav-group-account { gap: var(--s2); }

.main-nav a,
.main-nav .link-btn {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--step-small);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.main-nav a:not(.btn):hover,
.main-nav .link-btn:hover { color: #fff; background: var(--surface-2); }
.main-nav a.btn { color: var(--text); }
.main-nav a.btn:hover { color: #fff; }

/* صفحه‌ی جاری: متن روشن + یک خط زیرین بنفش. زیرخط رو با ::after می‌کشیم
   نه با border، تا ارتفاع لینک‌های دیگه رو جابه‌جا نکنه. */
.main-nav a.is-current { color: var(--text); font-weight: 600; }
.main-nav a.is-current::after {
  content: '';
  position: absolute;
  inset-inline: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-dim);
}

/* دکمه‌ی منوی موبایل — روی دسکتاپ اصلا وجود نداره. */
.nav-toggle {
  display: none;
  align-items: center;
  gap: var(--s2);
  margin-inline-start: auto;
  padding: 8px 13px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-small);
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { content: ''; position: absolute; top: -5px; }
.nav-toggle-bars::after { content: ''; position: absolute; top: 5px; }
.nav-toggle[aria-expanded='true'] { border-color: var(--border-loud); }

.signal-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-pill);
  padding: 8px 15px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  transition: color 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.signal-toggle:hover { border-color: var(--accent-dim); color: var(--text); }
.signal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.signal-toggle[aria-pressed='true'] {
  color: var(--accent2);
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: var(--glow-cyan);
}
.signal-toggle[aria-pressed='true'] .signal-dot {
  background: var(--accent2);
  box-shadow: 0 0 8px var(--accent2);
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.6; }
}

/* ==========================================================================
   Hero — mechanical keyboard backdrop
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(56px, 8vw, 104px) var(--page-x) clamp(48px, 6vw, 76px);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--hero-photo);
  background-size: cover;
  background-position: center 60%;
  opacity: 0.55;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 55% at 50% 32%, rgba(5, 1, 10, 0.42) 0%, rgba(5, 1, 10, 0.86) 62%, var(--bg) 100%),
    linear-gradient(180deg, rgba(20, 2, 40, 0.55) 0%, rgba(5, 1, 10, 0.35) 45%, var(--bg) 100%);
}

.hero-pulse {
  position: absolute;
  left: 0;
  bottom: 6%;
  width: 220%;
  height: 130px;
  opacity: 0.4;
  z-index: -1;
  animation: scroll-pulse 9s linear infinite;
}
@keyframes scroll-pulse {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  color: var(--accent-soft);
  font-size: var(--step-eyebrow);
  letter-spacing: 0.18em;
  padding: 7px 16px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-pill);
  background: rgba(188, 19, 254, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: var(--step-h1);
  font-weight: 800;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
}
.hero h1 span {
  background: linear-gradient(100deg, var(--accent-soft) 0%, #f0a6ff 45%, var(--accent2) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lede {
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 32px;
  font-size: var(--step-lede);
  line-height: 1.95;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.category-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 34px 0 0;
}

/* --- hero instrument pair: route trace + live keyboard --- */
.hero-instruments {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: stretch;
  max-width: 940px;
  margin: 46px auto 0;
  text-align: initial;
}

.mascot-wrap {
  width: 138px;
  margin: 0 auto 8px;
  position: relative;
  animation: mascot-float 4.5s ease-in-out infinite;
}
.mascot-flag {
  position: absolute;
  left: -6px;
  bottom: 58px;
  font-size: 1.8rem;
  line-height: 0;
  transform: rotate(-12deg);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  animation: flag-wave 2.2s ease-in-out infinite;
}
@keyframes flag-wave {
  0%, 100% { transform: rotate(-12deg); }
  50% { transform: rotate(-4deg); }
}
@keyframes mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.mascot-wrap.glitch {
  animation: mascot-float 4.5s ease-in-out infinite, mascot-glitch 0.35s steps(2, jump-none);
}
@keyframes mascot-glitch {
  0% { transform: translate(0, 0); filter: none; }
  20% { transform: translate(-3px, 1px); filter: drop-shadow(3px 0 0 var(--accent2)) drop-shadow(-3px 0 0 var(--accent)); }
  40% { transform: translate(3px, -1px); filter: drop-shadow(-2px 0 0 var(--accent2)) drop-shadow(2px 0 0 var(--accent)); }
  60% { transform: translate(-2px, 0); filter: drop-shadow(2px 0 0 var(--accent)); }
  100% { transform: translate(0, 0); filter: none; }
}
#mascot-eyes circle { transition: r 0.08s linear, opacity 0.08s linear; }

/* ==========================================================================
   Route trace readout (the signature element)
   ========================================================================== */

.terminal-log {
  background: rgba(4, 0, 12, 0.72);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent2);
  min-height: 168px;
  box-shadow: var(--lift), inset 0 0 40px rgba(188, 19, 254, 0.08);
}
.terminal-log::before {
  content: 'ROUTE TRACE';
  display: block;
  color: var(--accent-soft);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-quiet);
}
.terminal-log .line {
  opacity: 0;
  animation: term-in 0.4s forwards;
  margin-bottom: 5px;
  direction: ltr;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.terminal-log .line b { color: var(--text-muted); font-weight: 400; }
.terminal-log .line i { font-style: normal; color: var(--accent2); text-shadow: 0 0 10px rgba(0, 240, 255, 0.5); }
.terminal-log .line.is-drop i { color: var(--danger); text-shadow: none; }
@keyframes term-in { to { opacity: 1; } }

.terminal-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--accent);
  vertical-align: middle;
  animation: blink-cursor 1s step-end infinite;
}
@keyframes blink-cursor { 50% { opacity: 0; } }

/* --- interactive keycaps --- */
.keyboard-fx {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 18px;
}
.kb-row { display: flex; gap: 6px; justify-content: center; }
.kb-key {
  width: clamp(22px, 3.4vw, 32px);
  aspect-ratio: 1;
  border-radius: 7px;
  background: rgba(4, 0, 12, 0.6);
  border: 1px solid var(--border-quiet);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  transition: background 0.12s, color 0.12s, transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.kb-key.lit {
  background: linear-gradient(135deg, #c92dff, var(--accent));
  border-color: transparent;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(188, 19, 254, 0.8);
}

/* ==========================================================================
   Service posters + plan cards
   ========================================================================== */

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  max-width: 1180px;
  margin-inline: auto;
}

/* Ping-reduction services: 1 col mobile · 2 desktop · 3 on large screens */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  max-width: 1180px;
  margin-inline: auto;
}
@media (min-width: 720px) { .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.plan-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
/* Hover borrows the plan's own protocol hue, not the brand violet — otherwise
   every card in a mixed grid lights up the same colour and the hue stops
   carrying information. */
.plan-card:hover {
  border-color: color-mix(in srgb, var(--p, var(--accent)) 60%, transparent);
  transform: translateY(-4px);
  box-shadow: var(--lift), 0 0 26px -6px color-mix(in srgb, var(--p, var(--accent)) 34%, transparent);
}

/* poster sits flush to the card edge */
.plan-card.has-poster { padding-top: 0; }

/* the buy block absorbs leftover height so CTAs line up across a row
   regardless of how many feature bullets each plan has */
.plan-card > .plan-buy,
.plan-card > .btn-block { margin-top: auto; }

.plan-poster {
  position: relative;
  margin: 0 -24px 4px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0a0116 center / cover no-repeat;
  border-bottom: 1px solid var(--border);
}
.plan-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 1, 10, 0.12) 0%, rgba(5, 1, 10, 0.5) 60%, rgba(5, 1, 10, 0.94) 100%);
}
.plan-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.plan-card:hover .plan-poster img { transform: scale(1.05); }

.plan-poster-tag {
  position: absolute;
  z-index: 1;
  inset-inline-start: 12px;
  top: 12px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: rgba(5, 1, 10, 0.72);
  border: 1px solid var(--accent-dim);
  color: var(--accent-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.plan-poster-ping {
  position: absolute;
  z-index: 1;
  inset-inline-end: 12px;
  bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent2);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
  direction: ltr;
}

.plan-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent-soft);
  text-transform: uppercase;
}

/* ==========================================================================
   نبرد دو کاراکتر داخل کارت پلن — SVG درون‌خطی + انیمیشن CSS خالص
   عمداً بدون کتابخانه و بدون JS نوشته شده. کل سکانس (نزدیک‌شدن، ضربه، برخورد،
   عقب‌رفتن، جشن برنده، برگشت به idle) با یک keyframes زمان‌بندی‌شده اجرا می‌شه.
   ارتفاع میدان ثابته تا قد کارت نپره و همه‌ی حرکت‌ها فقط transform/opacity‌ان.
   ========================================================================== */

/* The battle lives inside the poster as an overlay strip along its lower edge,
   so it costs zero layout height and never pushes price or CTA down. It is
   decorative: aria-hidden in markup, pointer-events none here. */
.plan-battle {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 1;
  height: 58px;
  overflow: hidden;          /* جلوی سرریز افقی در صفحه‌های باریک */
  pointer-events: none;      /* هیچ‌وقت جلوی کلیک روی دکمه‌ی خرید رو نمی‌گیره */
  contain: layout paint;     /* رندر جدا: انیمیشن بقیه‌ی کارت رو reflow نمی‌کنه */
  user-select: none;
  --pb-dur: 7s;              /* طول یک دور کامل نبرد */
}

/* کف میدان: یک خط نئونی محو که به کاراکترها وزن می‌ده */
.pb-floor {
  position: absolute;
  inset-inline: 8%;
  bottom: 7px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--p, var(--accent-dim)) 22%, var(--p, var(--accent-dim)) 78%, transparent);
  opacity: 0.35;
}

.plan-battle svg { overflow: visible; display: block; }

.pb-fighter {
  position: absolute;
  bottom: 2px;
  line-height: 0;
  will-change: transform;
}
/* A از سمت چپ، B از سمت راست. با left/right ثابت شده تا در RTL هم
   رو‌به‌روی هم بمونن و جای‌شون با جهت متن عوض نشه. */
.pb-a { left: 12%; }
.pb-b { right: 12%; }

/* --- رنگ‌بندی مشترک --- */
.plan-battle .pb-plate {
  fill: rgba(255, 255, 255, 0.06);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.plan-battle .pb-line {
  stroke-width: 1.6;
  stroke-linecap: round;
  fill: none;
}
.plan-battle .pb-edge { stroke-width: 1.3; stroke-linejoin: round; }
.plan-battle .pb-shadow { fill: rgba(0, 0, 0, 0.5); }
.plan-battle .pb-vent { stroke-width: 1.4; stroke-linecap: round; fill: none; }

/* کاراکتر A — سایان/سبز */
.pb-a .pb-plate { stroke: var(--accent2); }
.pb-a .pb-line { stroke: var(--accent2); }
.pb-a .pb-edge { fill: rgba(0, 240, 255, 0.28); stroke: #5cffd0; }
.pb-a .pb-visor { fill: #5cffd0; opacity: 0.9; }
.pb-a .pb-core { fill: #5cffd0; }

/* کاراکتر B — نارنجی/قرمز */
.pb-b .pb-plate { stroke: #ff7a3d; }
.pb-b .pb-line { stroke: #ff7a3d; }
.pb-b .pb-edge { fill: rgba(255, 68, 68, 0.3); stroke: #ff4444; }
.pb-b .pb-optic { fill: #ff4444; }
.pb-b .pb-vent { stroke: #ff4444; opacity: 0.75; }

/* تنوع جزئی بین پلن‌ها تا همه‌ی کارت‌ها هم‌زمان یک‌شکل نزنن */
.pb-v2 { --pb-dur: 7.6s; }
.pb-v3 { --pb-dur: 8.2s; }
.pb-v4 { --pb-dur: 6.6s; }

/* ==========================================================================
   سکانس نبرد. درصدها روی یک دور --pb-dur حساب شدن:
   0-24% idle | 24-38% نزدیک‌شدن | 38-46% ضربه | 46-54% برخورد و عقب‌رفتن
   54-70% جشن برنده | 70-100% برگشت به idle و مکث
   ========================================================================== */

.pb-a { animation: pb-a-seq var(--pb-dur) ease-in-out infinite; }
.pb-b { animation: pb-b-seq var(--pb-dur) ease-in-out infinite; }

/* مهاجم: جلو می‌ره، ضربه می‌زنه، عقب می‌آد، کمی جشن می‌گیره */
@keyframes pb-a-seq {
  0%, 22%   { transform: translateX(0) scale(1); }
  30%       { transform: translateX(14px) scale(1.02); }   /* نزدیک شدن */
  38%       { transform: translateX(20px) scale(1.03); }
  44%       { transform: translateX(34px) scale(1.06); }   /* لحظه‌ی ضربه */
  50%       { transform: translateX(28px) scale(1.04); }
  58%       { transform: translateX(16px) scale(1.08); }   /* برنده */
  66%       { transform: translateX(12px) scale(1.05); }
  78%, 100% { transform: translateX(0) scale(1); }         /* برگشت به idle */
}

/* مدافع: کمی جلو می‌آد، ضربه می‌خوره و پرت می‌شه عقب، بعد جمع‌وجور می‌شه */
@keyframes pb-b-seq {
  0%, 22%   { transform: translateX(0) rotate(0deg); }
  30%       { transform: translateX(-10px) rotate(0deg); }
  42%       { transform: translateX(-14px) rotate(0deg); }
  46%       { transform: translateX(-6px) rotate(6deg); }   /* دریافت ضربه */
  52%       { transform: translateX(22px) rotate(12deg); }  /* پرت شدن به عقب */
  60%       { transform: translateX(16px) rotate(7deg); }
  70%       { transform: translateX(6px) rotate(2deg); }
  82%, 100% { transform: translateX(0) rotate(0deg); }
}

/* تنفس idle روی بدنه، مستقل از جابه‌جایی افقی کاراکتر */
.plan-battle .pb-body {
  animation: pb-idle 2.4s ease-in-out infinite;
  transform-origin: 24px 44px;
}
@keyframes pb-idle {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%      { transform: translateY(-1.5px) scaleY(0.985); }
}

/* بازوی سلاح: دقیقا در لحظه‌ی ضربه به جلو شلاق می‌خوره */
.pb-a .pb-arm { transform-origin: 30px 20px; animation: pb-swing-a var(--pb-dur) ease-in-out infinite; }
.pb-b .pb-arm { transform-origin: 18px 20px; animation: pb-guard-b var(--pb-dur) ease-in-out infinite; }

@keyframes pb-swing-a {
  0%, 34%   { transform: rotate(0deg); }
  40%       { transform: rotate(-26deg); }   /* آماده‌باش */
  45%       { transform: rotate(22deg); }    /* فرود ضربه */
  56%       { transform: rotate(-6deg); }
  70%, 100% { transform: rotate(0deg); }
}
@keyframes pb-guard-b {
  0%, 40%   { transform: rotate(0deg); }
  46%       { transform: rotate(-16deg); }   /* بالا آوردن سپر، دیر می‌رسه */
  56%       { transform: rotate(10deg); }
  72%, 100% { transform: rotate(0deg); }
}

/* چشم مدافع موقع خوردن ضربه فلش می‌زنه */
.pb-b .pb-optic { animation: pb-hit-flash var(--pb-dur) linear infinite; }
@keyframes pb-hit-flash {
  0%, 44%   { fill: #ff4444; }
  47%       { fill: #fff; }
  54%       { fill: #ffb199; }
  64%, 100% { fill: #ff4444; }
}

/* هسته‌ی مهاجم موقع بردن پرنور می‌شه */
.pb-a .pb-core { animation: pb-core-pulse var(--pb-dur) ease-in-out infinite; }
@keyframes pb-core-pulse {
  0%, 40%   { opacity: 0.75; }
  46%       { opacity: 1; }
  58%       { opacity: 1; }
  74%, 100% { opacity: 0.75; }
}

/* حلقه‌ی برنده: فقط بعد از ضربه‌ی موفق باز می‌شه */
.pb-win-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1.5px solid var(--accent2);
  border-radius: 50%;
  opacity: 0;
  animation: pb-win var(--pb-dur) ease-out infinite;
}
@keyframes pb-win {
  0%, 52%   { opacity: 0; transform: scale(0.5); }
  58%       { opacity: 0.85; transform: scale(1.15); }
  70%       { opacity: 0; transform: scale(1.7); }
  100%      { opacity: 0; transform: scale(0.5); }
}

/* --- افکت برخورد وسط میدان --- */
.pb-impact {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  opacity: 0;
  animation: pb-impact-seq var(--pb-dur) ease-out infinite;
}
.pb-impact-core {
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--accent2) 42%, rgba(188, 19, 254, 0) 72%);
}
.plan-battle .pb-shards {
  stroke: #fff2b0;
  stroke-width: 1.6;
  stroke-linecap: round;
  fill: none;
}
@keyframes pb-impact-seq {
  0%, 42%   { opacity: 0; transform: scale(0.35) rotate(0deg); }
  45%       { opacity: 1; transform: scale(1) rotate(6deg); }      /* جرقه‌ی برخورد */
  52%       { opacity: 0.55; transform: scale(1.35) rotate(14deg); }
  60%, 100% { opacity: 0; transform: scale(1.6) rotate(20deg); }
}

/* --- واکنش به hover و focus داخل کارت: تکرار سریع‌تر و پررنگ‌تر ---
   focus-within باعث می‌شه رسیدن با Tab به دکمه‌ی خرید هم نبرد رو تشدید کنه. */
.plan-card:hover .plan-battle,
.plan-card:focus-within .plan-battle { --pb-dur: 3.4s; }

.plan-card:hover .pb-floor,
.plan-card:focus-within .pb-floor { opacity: 0.9; }

/* --- ریسپانسیو: روی تبلت و موبایل کمی جمع‌تر، ولی همچنان دیده می‌شه ---
   انیمیشن به hover وابسته نیست، پس روی موبایل هم کامل اجرا می‌شه. */
@media (max-width: 900px) {
  .plan-battle { height: 54px; }
  .pb-a { left: 9%; }
  .pb-b { right: 9%; }
}
@media (max-width: 520px) {
  .plan-battle { height: 48px; }
  .plan-battle svg { width: 38px; height: 38px; }
  .pb-a { left: 6%; }
  .pb-b { right: 6%; }
  .pb-impact { width: 32px; height: 32px; margin-left: -16px; bottom: 14px; }
}

/* --- کاهش انیمیشن: کاراکترها می‌مونن و رو‌به‌روی هم می‌ایستن، حرکت متوقف می‌شه --- */
body.motion-off .plan-battle *,
body.motion-off .plan-battle { animation: none !important; }
body.motion-off .pb-impact,
body.motion-off .pb-win-ring { display: none; }

@media (prefers-reduced-motion: reduce) {
  .plan-battle *,
  .plan-battle { animation: none !important; }
  .pb-impact,
  .pb-win-ring { display: none; }
}

.plan-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 36px; }

/* ==========================================================================
   Auth / result cards
   ========================================================================== */

.auth-wrap {
  max-width: 430px;
  margin: clamp(40px, 7vw, 80px) auto;
  padding: 34px;
}
.auth-wrap h2 { margin: 0 0 22px; font-size: 1.5rem; font-weight: 700; }
.auth-title { margin: 0 0 6px; font-size: var(--step-h3); font-weight: 700; }
.auth-sub { margin: 0 0 var(--s5); font-size: var(--step-small); color: var(--text-muted); line-height: 1.8; }
.auth-wrap-solo { margin-block: clamp(80px, 14vh, 150px); }

.result-wrap {
  max-width: 470px;
  margin: clamp(56px, 9vw, 100px) auto;
  text-align: center;
  padding: 40px;
}
.result-wrap h1 { margin: 0 0 12px; font-size: var(--step-h3); }
.result-wrap h2 { margin: 0 0 12px; }
.result-wrap .note { text-align: start; }

/* The glyph is the fastest read on this page, so it carries the outcome colour
   rather than sitting decorative above a paragraph that says the same thing. */
.result-icon {
  display: grid;
  place-items: center;
  inline-size: 52px;
  block-size: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  border: 1px solid currentColor;
}
.is-ok .result-icon { color: var(--ok); background: var(--ok-wash); }
.is-pending .result-icon { color: var(--warn); background: var(--warn-wash); }
.is-error .result-icon { color: var(--danger); background: var(--danger-wash); }

.result-next {
  counter-reset: rstep;
  list-style: none;
  margin: var(--s5) 0 0;
  padding: var(--s4);
  text-align: start;
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  font-size: var(--step-small);
  color: var(--text-muted);
}
.result-next li {
  counter-increment: rstep;
  display: flex;
  gap: var(--s3);
  align-items: baseline;
  padding: 5px 0;
}
.result-next li::before {
  content: counter(rstep);
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--step-micro);
  color: var(--accent-soft);
}

/* ==========================================================================
   Purchases / tickets / tutorials / support
   ========================================================================== */

.purchase-card {
  position: relative;
  overflow: hidden;
  padding: var(--s5);
  margin-bottom: var(--s4);
}
/* Same hue spine as the plan cards, so a service is recognisable by protocol
   across browse and dashboard without repeating the label everywhere. */
.purchase-card[data-protocol]:not([data-protocol=''])::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--p, var(--accent));
  opacity: 0.85;
}
.purchase-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.copy-field { display: flex; gap: 8px; margin: 8px 0 14px; }
.copy-field input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  direction: ltr;
  text-align: left;
}
.copy-field button {
  flex: none;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 0 16px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--step-small);
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.copy-field button:hover { color: var(--accent2); border-color: var(--accent2); box-shadow: var(--glow-cyan); }

/* کانفیگ متنی چندخطی: دکمه‌ی کپی زیر متن می‌شینه نه کنارش */
.copy-field-block { flex-direction: column; align-items: flex-start; }
.copy-field-block textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  direction: ltr;
  text-align: left;
  resize: vertical;
}
.copy-field-block button { padding: 6px 16px; }

.config-label {
  font-size: 0.85rem;
  color: var(--accent2);
  margin: 10px 0 2px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.reply-box {
  background: var(--accent-wash);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-top: 10px;
  font-size: 0.9rem;
}
.reply-box-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--accent-soft);
  margin-bottom: 6px;
}

.quote {
  background: var(--bg-inset);
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 56px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.tutorial-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tutorial-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 15px;
  background: var(--bg-inset);
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  transition: border-color 0.18s;
}
.tutorial-list li:hover { border-color: var(--accent-dim); }
.tutorial-list li p { flex-basis: 100%; margin: 4px 0 0; font-size: 0.82rem; color: var(--text-muted); }
.tutorial-list .btn { margin-inline-start: auto; }

.step-list { counter-reset: step; list-style: none; padding: 0; margin: 12px 0 0; }
.step-list li {
  counter-increment: step;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 9px 0;
  color: var(--text-muted);
}
.step-list li::before {
  content: counter(step);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-soft);
  background: var(--accent-wash);
  border: 1px solid var(--accent-dim);
}

.protocol-guide { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.protocol-guide div {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  border: 1px solid var(--border-quiet);
  border-inline-start: 2px solid var(--p, var(--border));
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
}
.protocol-guide strong { color: var(--p, var(--text)); font-family: var(--font-latin); }

.contact-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  background: var(--bg-inset);
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.contact-row:hover { border-color: var(--border); background: var(--surface-2); transform: translateX(-3px); }
.contact-icon { font-size: 1.2rem; }
.contact-row strong { font-family: var(--font-mono); }

.stack { display: flex; flex-direction: column; gap: 14px; }

/* ==========================================================================
   Admin — same world, quieter
   ========================================================================== */

.admin-shell { display: flex; min-height: 100vh; width: 100%; }

.admin-sidebar {
  width: 224px;
  flex: none;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-inline-start: 1px solid var(--border);
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow-y: auto;
}
.admin-sidebar a,
.admin-sidebar button {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: none;
  border: none;
  text-align: right;
  cursor: pointer;
  width: 100%;
  font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
}
.admin-sidebar a:hover,
.admin-sidebar button:hover { background: var(--accent-wash); color: #fff; }
.admin-sidebar form { margin-top: auto; }
.admin-sidebar button { color: var(--text-faint); }
.admin-sidebar button:hover { background: var(--danger-wash); color: var(--danger); }

.admin-main { flex: 1; min-width: 0; padding: clamp(20px, 3vw, 34px); }
.admin-main h3 { font-size: var(--step-h3); margin: 0 0 16px; }

.admin-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  font-size: 1.35rem;
}
.admin-title small { color: var(--text-muted); font-size: 0.86rem; font-weight: 400; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}
.stat-card { padding: 20px; }
.stat-card .num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
.stat-card .label { color: var(--text-muted); font-size: var(--step-small); margin-top: 4px; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--lift);
  margin-bottom: 28px;
}

table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border-quiet);
  font-size: 0.88rem;
  white-space: nowrap;
}
/* Table chrome stays neutral. Violet here would compete with the row actions,
   which are the only thing in the table worth colouring. */
th {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--surface-2);
}
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--surface-1); }
tr:last-child td { border-bottom: none; }
.cell-actions { display: flex; gap: 8px; align-items: center; }
.cell-mono { font-family: var(--font-mono); font-size: 0.8rem; direction: ltr; text-align: left; white-space: normal; word-break: break-all; }

.admin-card { padding: 24px; margin-bottom: 20px; }
.admin-card h3 { margin-top: 0; }
.admin-card > p { color: var(--text-muted); font-size: var(--step-small); }
.field-wide { grid-column: 1 / -1; }

.admin-intro { max-width: 62ch; margin: -8px 0 22px; }

/* گروه چک‌باکس پروتکل‌ها. fieldset استایل پیش‌فرض مرورگر رو داره، پس صفر می‌شه
   تا مثل بقیه‌ی .field دیده بشه و چک‌باکس‌ها روی موبایل بشکنن به خط بعد. */
.protocol-picker {
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-sm);
  padding: 12px 14px 14px;
  margin: 0 0 var(--s4);
  min-width: 0;
}
.protocol-picker legend {
  padding: 0 6px;
  font-size: var(--step-micro);
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.protocol-picker .check-label { margin-top: 0; margin-inline-end: 18px; }
.protocol-picker .note { display: block; margin-top: 10px; }

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin-top: 26px;
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
}
.check-label input[type='checkbox'] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ticket-meta {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  margin-top: 5px;
}
.ticket-reply-form { margin-top: 16px; }
.ticket-reply-form .field { margin-bottom: 12px; }

/* ==========================================================================
   Global server locations
   ========================================================================== */

.locations { scroll-margin-top: 90px; }

.locations-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(22px, 3vw, 34px);
  align-items: center;
}
@media (min-width: 900px) {
  .locations-layout { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
}

.locations-panel { min-width: 0; }

.locations-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
}

.location-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-quiet);
  background: rgba(4, 0, 12, 0.45);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: start;
  transition: border-color 0.18s, color 0.18s, background 0.18s, transform 0.18s;
}
/* Locations read as live infrastructure, so they use the cyan "signal" hue
   rather than the brand violet reserved for purchase actions. */
.location-item:hover {
  border-color: rgba(0, 240, 255, 0.3);
  background: var(--info-wash);
  color: var(--text);
  transform: translateY(-2px);
}
.location-item.is-active {
  border-color: var(--info);
  background: var(--info-wash);
  color: var(--text);
  box-shadow: var(--glow-cyan);
}
.location-flag { font-size: 1.05rem; line-height: 0; display: inline-flex; flex: none; }
.location-name { flex: 1; min-width: 0; }
.location-code {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.location-item.is-active .location-code { color: var(--accent2); }

.location-card {
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  padding: 20px;
}
.location-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.location-card-flag { font-size: 1.7rem; line-height: 0; display: inline-flex; flex: none; }

/* پرچم‌ها SVG محلی‌ان تا توی کروم/اج/فایرفاکس دقیقا یک‌شکل باشن (ایموجی پرچم
   روی ویندوز رندر نمی‌شه). ابعاد ثابته و روی خود تگ img هم هست، پس قبل از لود
   شدن فایل هم جا گرفته می‌شه و صفحه تکون نمی‌خوره. */
.flag-icon {
  display: inline-block;
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: -2px;
  /* لبه‌ی روشن تا پرچم‌های تیره (مثل آلمان) روی پس‌زمینه‌ی تیره گم نشن */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}
/* توی جدول مشخصات کارت پلن، پرچم چسبیده به اسم کشور نباشه */
.spec dd .flag-icon { margin-inline-end: 6px; }
.mascot-flag .flag-icon { width: 26px; height: 18px; }
.location-card-flag .flag-icon { width: 32px; height: 22px; }
.location-card-name { display: block; font-size: 1.05rem; color: var(--text); }
.location-card-en {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  margin-top: 3px;
}
.location-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent2-wash);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent2);
}
.location-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 8px var(--accent2);
  animation: loc-blip 2s ease-in-out infinite;
}
@keyframes loc-blip { 50% { opacity: 0.35; } }
.location-note {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: var(--step-small);
  line-height: 1.65;
}

.globe-stage {
  position: relative;
  aspect-ratio: 1;
  max-width: 520px;
  width: 100%;
  margin-inline: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: radial-gradient(circle at 50% 45%, rgba(188, 19, 254, 0.12) 0%, rgba(4, 0, 12, 0.6) 62%);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--lift), inset 0 0 60px rgba(188, 19, 254, 0.1);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.globe-stage canvas { display: block; }
.globe-stage.is-ready .globe-fallback { display: none; }
/* کنترل‌ها فقط وقتی JS بالا اومده معنی دارن */
.globe-controls { display: none; }
.globe-stage.is-ready .globe-controls { display: flex; }

.globe-controls {
  position: absolute;
  inset-inline-end: 12px;
  top: 12px;
  z-index: 2;
  flex-direction: column;
  gap: 6px;
}
.globe-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--accent-soft);
  background: rgba(5, 1, 10, 0.66);
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.globe-btn:hover,
.globe-btn:focus-visible {
  color: var(--accent2);
  border-color: var(--accent2);
  background: rgba(5, 1, 10, 0.9);
}

.globe-fallback {
  margin: 0;
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--step-small);
  line-height: 1.7;
  max-width: 34ch;
}

.globe-hint {
  position: absolute;
  inset-inline: 0;
  bottom: 14px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  pointer-events: none;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  .globe-stage { max-width: 340px; }
  .locations-list { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
}

body.motion-off .location-status-dot { animation: none; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: var(--s7) var(--page-x) var(--s5);
  color: var(--text-muted);
  font-size: var(--step-small);
  background: rgba(8, 2, 18, 0.5);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
}
/* ستون برند پهن‌تره چون متن توضیحی داره؛ سه ستون لینک باریک و هم‌عرض. */
.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(140px, 1fr));
  gap: var(--s6) var(--s5);
  max-width: 1240px;
  margin: 0 auto;
}
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.footer-col-brand { gap: var(--s3); }
.footer-head {
  margin: 0 0 var(--s1);
  font-size: var(--step-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.footer-col a { color: var(--text-muted); line-height: 1.9; }
.footer-col a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.footer-blurb { margin: 0; max-width: 34ch; line-height: 1.85; color: var(--text-faint); }

.footer-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-latin);
  font-weight: 600;
  color: var(--text);
}
.footer-mark img { width: 22px; height: 22px; }

.footer-trust {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: var(--s3) 0 0;
  font-size: var(--step-micro);
  color: var(--ok);
}
.footer-trust-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  flex: none;
}

.footer-note {
  margin: var(--s6) auto 0;
  max-width: 1240px;
  padding-top: var(--s4);
  border-top: 1px solid var(--border-quiet);
  font-size: var(--step-micro);
  color: var(--text-faint);
}

.motion-toggle {
  background: var(--surface-1);
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--step-micro);
  padding: 7px 15px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.motion-toggle:hover { color: var(--text); border-color: var(--border-loud); }

/* ==========================================================================
   Tutorials — فهرست لنگری
   ========================================================================== */

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 26px;
}
.toc a {
  font-size: var(--step-small);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-quiet);
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.toc a:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-2);
}

/* ==========================================================================
   Gift cards
   ========================================================================== */

.giftcard-card { position: relative; overflow: hidden; }
.giftcard-card::after {
  content: '';
  position: absolute;
  inset-block-start: -40%;
  inset-inline-end: -25%;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.14), transparent 70%);
  pointer-events: none;
}
/* تراشه‌ی تزئینی گوشه‌ی کارت - همون حسی که روی کارت هدیه واقعی هست */
.giftcard-chip {
  width: 34px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid var(--accent-dim);
  background: linear-gradient(135deg, var(--accent-wash), var(--accent2-wash));
  box-shadow: var(--glow);
}
.giftcard-help { margin-top: 28px; }

/* ==========================================================================
   Payment status — کارت‌به‌کارت
   ========================================================================== */

.status-awaiting_review {
  background: var(--accent2-wash);
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--accent2);
}
.cell-note {
  margin-top: 5px;
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--text-faint);
  max-width: 30ch;
}
.cell-actions { flex-wrap: wrap; }
.cell-actions input[type='text'] { min-width: 130px; font-size: 0.74rem; padding: 6px 9px; }

/* ==========================================================================
   Wallet — کیف پول
   ========================================================================== */

.wallet-balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-wash), transparent 70%);
  box-shadow: var(--glow);
}
.wallet-balance-label {
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
.wallet-balance-value {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  color: var(--accent2);
}
.wallet-balance-value small { font-size: 0.8rem; color: var(--text-faint); }

.wallet-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.wallet-amount.is-credit { color: var(--accent2); }
.wallet-amount.is-debit { color: var(--text-faint); }

/* فرم شارژ دستی داخل ردیف جدول کاربرها — فشرده تا ستون رو پهن نکنه */
.wallet-adjust {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  max-width: 260px;
}
.wallet-adjust .input {
  font-size: 0.74rem;
  padding: 6px 9px;
  min-width: 78px;
  flex: 1 1 78px;
}

/* ==========================================================================
   Spec readout — the comparison surface
   ---------------------------------------------------------------------------
   Every plan exposes the same four rows in the same order, label right, value
   left, values in mono. That alignment is the whole point: a column of plans
   scans as a rack of instruments, and a missing value is visible as a gap
   rather than silently reflowing the card below it.
   ========================================================================== */

.spec {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1px var(--s3);
  margin: 0;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
}

.spec dt {
  font-size: var(--step-micro);
  color: var(--text-faint);
  line-height: 2.1;
  white-space: nowrap;
}

.spec dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--step-small);
  color: var(--text);
  line-height: 2.1;
  text-align: end;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spec dd.is-protocol { color: var(--p, var(--text)); }
.spec dd.is-ok { color: var(--ok); }
.spec dd.is-warn { color: var(--warn); }
.spec dd.is-faint { color: var(--text-faint); }

/* ==========================================================================
   Plan card composition
   ========================================================================== */

/* The hue spine. One rule tints the whole card by protocol without any
   per-protocol card class. */
.plan-card::before {
  content: '';
  position: absolute;
  z-index: 2;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: var(--p, var(--accent));
  opacity: 0.85;
}

.plan-head { display: flex; align-items: flex-start; gap: var(--s3); }
.plan-head-text { min-width: 0; flex: 1; }

.plan-title {
  margin: 0;
  font-size: var(--step-h3);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.plan-desc {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: var(--step-small);
  line-height: 1.75;
}

.plan-badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* Price block. The number is the largest mono on the page because it is the
   single value people are comparing across cards. */
.plan-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
  padding-top: var(--s3);
  border-top: 1px solid var(--border-quiet);
}
.plan-price-value {
  font-family: var(--font-mono);
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  direction: rtl;
}
.plan-price-unit {
  font-family: var(--font-body);
  font-size: var(--step-small);
  font-weight: 400;
  color: var(--text-faint);
  margin-inline-start: 4px;
}
.plan-price-was {
  font-family: var(--font-mono);
  font-size: var(--step-small);
  color: var(--text-faint);
  text-decoration: line-through;
}
.plan-price-note { font-size: var(--step-micro); color: var(--ok); }

/* Stock line. Reserving the row even when stock is unlimited keeps every card
   in a row the same height, so the CTAs stay aligned. */
.plan-stock {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 1.6em;
  font-size: var(--step-micro);
  color: var(--text-faint);
}
.plan-stock.is-low { color: var(--warn); }
.plan-stock.is-out { color: var(--danger); }
.plan-stock-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex: none;
}

.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  font-size: var(--step-small);
  color: var(--text-muted);
  line-height: 1.7;
}
.plan-features li::before {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  margin-top: 0.62em;
  border-radius: 50%;
  background: var(--p, var(--accent));
  opacity: 0.75;
}

.plan-buy { display: flex; flex-direction: column; gap: var(--s2); }

/* ==========================================================================
   Order dashboard — my-purchases
   ========================================================================== */

.order-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s6);
}
.order-summary-item {
  padding: var(--s4);
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
}
.order-summary-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
}
.order-summary-label {
  display: block;
  margin-top: 2px;
  font-size: var(--step-micro);
  color: var(--text-faint);
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  padding: var(--s3) 0;
  margin: 0 0 var(--s4);
  border-block: 1px solid var(--border-quiet);
  font-size: var(--step-micro);
  color: var(--text-faint);
}
.order-meta div { display: flex; align-items: baseline; gap: 6px; }
.order-meta b {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-muted);
  direction: ltr;
}

/* Credential + download actions grouped, so the operational controls read as
   one toolbar instead of a stack of competing buttons. */
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--border-quiet);
}

/* ==========================================================================
   Data usage meter — provisioned VPN accounts
   ---------------------------------------------------------------------------
   The number is the answer ("5.0 GB / 20.0 GB"); the bar is the glance. The
   fill inherits the card's protocol hue so a service stays identifiable, then
   overrides to amber/red near the cap — running out beats brand colour.
   ========================================================================== */

.usage-block { margin: 0 0 var(--s4); }

.usage-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.usage-label { font-size: var(--step-micro); color: var(--text-faint); }
.usage-value {
  font-family: var(--font-mono);
  font-size: var(--step-small);
  color: var(--text-muted);
}

.usage-bar {
  position: relative;
  height: 8px;
  border-radius: 99px;
  background: var(--bg-inset);
  border: 1px solid var(--border-quiet);
  overflow: hidden;
}
.usage-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--p, var(--accent));
  /* Fills grow from the start edge; RTL flips this automatically. */
  margin-inline-end: auto;
}
.usage-fill.is-warn { background: var(--warn); }
.usage-fill.is-critical { background: var(--danger); }

.usage-note {
  display: block;
  margin-top: 6px;
  font-size: var(--step-micro);
  color: var(--text-faint);
}

/* ==========================================================================
   Reference layout — tutorials
   ---------------------------------------------------------------------------
   Two columns on desktop with a sticky index, because this page is re-visited
   to look one thing up, not read top to bottom.
   ========================================================================== */

.doc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s6);
  align-items: start;
}
@media (min-width: 940px) {
  .doc-layout { grid-template-columns: 216px minmax(0, 1fr); }
  .doc-index {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }
}

.doc-index ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.doc-index a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border-inline-start: 2px solid transparent;
  color: var(--text-muted);
  font-size: var(--step-small);
  line-height: 1.6;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.doc-index a:hover {
  color: var(--text);
  background: var(--surface-1);
  border-inline-start-color: var(--border);
}

.doc-body { min-width: 0; }
.doc-section { scroll-margin-top: 96px; }
.doc-section + .doc-section { margin-top: var(--s7); }
.doc-section h3 {
  margin: 0 0 var(--s2);
  font-size: var(--step-h3);
  font-weight: 700;
}
.doc-section > p { color: var(--text-muted); margin: 0 0 var(--s4); max-width: var(--measure); }

/* App download rows — a table would overflow on mobile, so this is a grid that
   collapses to stacked rows instead of scrolling sideways. */
.doc-apps {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.doc-apps li {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  padding: var(--s3) var(--s4);
  background: var(--bg-inset);
}
.doc-apps li + li { border-top: 1px solid var(--border-quiet); }
.doc-app-name { font-weight: 600; min-width: 8ch; }
.doc-app-note {
  flex: 1;
  min-width: 12ch;
  font-size: var(--step-small);
  color: var(--text-muted);
}
.doc-apps .btn { margin-inline-start: auto; }

/* ==========================================================================
   Trust band — homepage
   ========================================================================== */

.trust-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s4);
  padding: var(--s5);
  border: 1px solid var(--border-quiet);
  border-radius: var(--radius);
  background: var(--surface-1);
}
.trust-item { display: flex; gap: var(--s3); align-items: flex-start; }
.trust-icon {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-quiet);
  background: var(--bg-inset);
  font-size: 0.95rem;
}
.trust-text strong { display: block; font-size: var(--step-small); font-weight: 600; }
.trust-text span {
  display: block;
  margin-top: 2px;
  font-size: var(--step-micro);
  color: var(--text-faint);
  line-height: 1.7;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .hero-instruments { grid-template-columns: 1fr; }
  .keyboard-fx { order: -1; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-col-brand { grid-column: 1 / -1; }
}

/* زیر این عرض لینک‌ها دیگه توی یک خط جا نمی‌شن، پس ناوبری به یک پنل
   بازشونده تبدیل می‌شه. پنل absolute ـه تا باز شدنش هدر رو بلند نکنه. */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: var(--s3);
    margin: 0;
    padding: var(--s4) var(--page-x) var(--s5);
    background: var(--bg-solid);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--lift);
  }
  body.nav-open .main-nav { display: flex; }
  .nav-group { flex-direction: column; align-items: stretch; gap: var(--s1); }
  .nav-group-account {
    gap: var(--s2);
    padding-top: var(--s3);
    border-top: 1px solid var(--border-quiet);
  }
  .main-nav a, .main-nav .link-btn { padding: 11px 12px; text-align: start; font-size: var(--step-body); }
  .main-nav a.btn { justify-content: center; }
  .main-nav a.is-current::after { inset-inline: auto 12px; bottom: 50%; width: 2px; height: 18px; transform: translateY(50%); }
  .inline-form { display: block; }
  .main-nav .link-btn { width: 100%; }
}

@media (max-width: 720px) {
  .site-header { gap: var(--s3); padding: 12px 16px; }
  .signal-label { display: none; }
  .grid-2, .field-wide { grid-column: auto; }
  .grid-2 { grid-template-columns: 1fr; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    max-height: none;
    position: static;
    flex-direction: row;
    overflow-x: auto;
    border-inline-start: none;
    border-bottom: 1px solid var(--border);
  }
  .admin-sidebar a, .admin-sidebar button { white-space: nowrap; width: auto; }
  .admin-sidebar form { margin-top: 0; }
  .admin-sidebar .brand { display: none; }
  .terminal-log { font-size: 0.7rem; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--s5); }
}
