/* ============================================================
   TEKNAWI APPS — design system
   Dark neon-glass theme · EN/AR (RTL-aware, logical properties)
   ============================================================ */

:root {
  --bg: #05060c;
  --bg-2: #0a0d1a;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef0fb;
  --muted: #9aa3c0;
  --faint: #626b8a;
  --brand-1: #6366f1;
  --brand-2: #22d3ee;
  --brand-3: #a855f7;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --grad: linear-gradient(96deg, var(--brand-1), var(--brand-3) 50%, var(--brand-2));
  --glow-1: 0 0 40px rgba(99, 102, 241, 0.35);
  --glow-2: 0 0 60px rgba(34, 211, 238, 0.22);
  --radius: 18px;
  --radius-sm: 12px;
  --font-head: 'Space Grotesk', 'Tajawal', system-ui, sans-serif;
  --font-body: 'Inter', 'Tajawal', system-ui, sans-serif;
  --nav-h: 72px;
}

[dir="rtl"] {
  --font-head: 'Tajawal', 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Tajawal', 'Inter', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: rgba(99, 102, 241, 0.45); color: #fff; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img, svg { max-width: 100%; }

/* ---- background layers ---- */
#particles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

.orb {
  position: fixed; border-radius: 50%; filter: blur(110px);
  opacity: 0.35; z-index: 0; pointer-events: none;
  animation: orbFloat 18s ease-in-out infinite alternate;
}
.orb-a { width: 480px; height: 480px; background: #4338ca; top: -160px; inset-inline-start: -120px; }
.orb-b { width: 420px; height: 420px; background: #0e7490; bottom: -140px; inset-inline-end: -100px; animation-delay: -6s; }
.orb-c { width: 300px; height: 300px; background: #7e22ce; top: 40%; inset-inline-start: 55%; opacity: 0.22; animation-delay: -12s; }

@keyframes orbFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, -50px, 0) scale(1.15); }
}

main, nav, footer { position: relative; z-index: 1; }

/* ---- nav ---- */
.nav {
  position: fixed; top: 0; inset-inline: 0; height: var(--nav-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: clamp(16px, 4vw, 48px);
  background: rgba(5, 6, 12, 0.55);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(5, 6, 12, 0.85); }

.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: 0.5px; }
.logo .logo-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--grad); box-shadow: var(--glow-1); color: #fff; font-size: 17px;
}
.logo .logo-accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 30px); }
.nav-links a { color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color 0.25s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:not(.btn)::after {
  content: ''; position: absolute; inset-inline-start: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--grad); border-radius: 2px; transition: width 0.3s;
}
.nav-links a:not(.btn):hover::after, .nav-links a.active:not(.btn)::after { width: 100%; }

.lang-btn {
  cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); border-radius: 999px; padding: 7px 16px; font-size: 13.5px; font-weight: 600;
  transition: all 0.25s;
}
.lang-btn:hover { border-color: var(--brand-2); box-shadow: var(--glow-2); }

.burger { display: none; cursor: pointer; background: none; border: 0; width: 40px; height: 40px; position: relative; }
.burger span {
  position: absolute; inset-inline-start: 8px; width: 24px; height: 2px; background: var(--text);
  border-radius: 2px; transition: all 0.3s;
}
.burger span:nth-child(1) { top: 13px; }
.burger span:nth-child(2) { top: 20px; }
.burger span:nth-child(3) { top: 27px; }
.burger.open span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .burger { display: block; }
  .nav-links {
    position: fixed; top: var(--nav-h); inset-inline: 0; flex-direction: column; align-items: stretch;
    padding: 18px clamp(16px, 4vw, 48px) 26px; gap: 4px;
    background: rgba(7, 9, 18, 0.97); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px); opacity: 0; pointer-events: none; visibility: hidden;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; visibility: visible; }
  /* Animate only once the burger has actually been used, otherwise the menu
     visibly fades out whenever the viewport crosses this breakpoint. Only the
     slide is animated: opacity/visibility flip instantly, so the menu is usable
     even if transitions are throttled (e.g. a backgrounded tab). */
  .nav-anim .nav-links { transition: transform 0.3s; }
  .nav-links a { padding: 12px 4px; font-size: 16px; }
  .nav-links a:not(.btn)::after { display: none; }
  .nav-links .btn { margin-top: 10px; justify-content: center; }

  /* Pages without a burger (admin) must keep their links reachable. */
  .nav-links.nav-links-plain {
    position: static; flex-direction: row; padding: 0; gap: 14px;
    background: none; border: 0; transform: none; opacity: 1; pointer-events: auto;
  }
  .nav-links.nav-links-plain a { padding: 6px 0; font-size: 13.5px; }
}

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  border: 0; border-radius: 999px; padding: 13px 28px;
  font-size: 15px; font-weight: 600; font-family: var(--font-body);
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad); background-size: 160% 100%; color: #fff;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(99, 102, 241, 0.55); background-position: 100% 0; }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand-2); box-shadow: var(--glow-2); transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn .arrow { transition: transform 0.25s; }
.btn:hover .arrow { transform: translateX(4px); }
[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .arrow { transform: scaleX(-1) translateX(4px); }

/* ---- layout helpers ---- */
.container { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.section { padding-block: clamp(64px, 9vw, 110px); }

.section-head { text-align: center; max-width: 720px; margin-inline: auto; margin-bottom: clamp(36px, 5vw, 64px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--brand-2); margin-bottom: 14px;
}
.eyebrow::before, .eyebrow::after { content: ''; width: 26px; height: 1px; background: currentColor; opacity: 0.5; }
.section-title { font-size: clamp(28px, 4.4vw, 44px); margin-bottom: 14px; }
.section-sub { color: var(--muted); font-size: clamp(15px, 1.6vw, 17.5px); }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; } .reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; } .reveal-d4 { transition-delay: 0.32s; }

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

/* ---- hero ---- */
.hero {
  min-height: 100svh; display: flex; align-items: center;
  padding-top: calc(var(--nav-h) + 30px); padding-bottom: 60px; position: relative;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
@media (max-width: 960px) { .hero-inner { grid-template-columns: 1fr; text-align: center; } }

.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 8px 18px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 24px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 12px var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: 0.6; } }

.hero h1 { font-size: clamp(36px, 6vw, 64px); letter-spacing: -1px; margin-bottom: 20px; }
.hero .typed-wrap { display: inline-block; min-width: 5ch; }
.typed { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.caret { display: inline-block; width: 3px; height: 0.95em; background: var(--brand-2); vertical-align: -0.12em; margin-inline-start: 4px; animation: blink 0.9s step-end infinite; border-radius: 2px; }
@keyframes blink { 50% { opacity: 0; } }

.hero-sub { color: var(--muted); font-size: clamp(15.5px, 1.8vw, 18.5px); max-width: 560px; margin-bottom: 34px; }
@media (max-width: 960px) { .hero-sub { margin-inline: auto; } }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 960px) { .hero-ctas { justify-content: center; } }

/* floating platform cards in hero */
.hero-visual { position: relative; height: clamp(320px, 42vw, 480px); }
@media (max-width: 960px) { .hero-visual { display: none; } }
.float-card {
  position: absolute; display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 14px 20px; font-weight: 600; font-size: 14.5px;
  backdrop-filter: blur(14px); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  animation: floatY 6s ease-in-out infinite;
}
.float-card svg { width: 26px; height: 26px; flex-shrink: 0; }
.float-card:nth-child(1) { top: 4%; inset-inline-start: 6%; animation-delay: 0s; }
.float-card:nth-child(2) { top: 24%; inset-inline-end: 2%; animation-delay: -1.2s; }
.float-card:nth-child(3) { top: 48%; inset-inline-start: 0; animation-delay: -2.4s; }
.float-card:nth-child(4) { top: 66%; inset-inline-end: 10%; animation-delay: -3.6s; }
.float-card:nth-child(5) { top: 88%; inset-inline-start: 22%; animation-delay: -4.8s; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

.hero-phone {
  position: absolute; top: 8%; inset-inline-start: 34%; width: 200px; height: 400px;
  border-radius: 34px; border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.16), rgba(34, 211, 238, 0.07) 60%, rgba(168, 85, 247, 0.14));
  box-shadow: var(--glow-1), inset 0 0 30px rgba(255, 255, 255, 0.04);
  animation: floatY 7s ease-in-out infinite; animation-delay: -2s;
}
.hero-phone::before {
  content: ''; position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 70px; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.12);
}
.hero-phone::after {
  content: ''; position: absolute; inset: 44px 18px 18px;
  border-radius: 18px; background: rgba(5, 6, 12, 0.5);
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 100% 26px;
}

/* scroll hint */
.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--faint); border-radius: 14px; opacity: 0.7;
}
.scroll-hint::before {
  content: ''; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 8px; border-radius: 3px; background: var(--brand-2); animation: scrollDot 1.8s infinite;
}
@keyframes scrollDot { 0% { opacity: 0; top: 7px; } 35% { opacity: 1; } 100% { opacity: 0; top: 22px; } }

/* ---- counters strip ---- */
.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 760px) { .counters { grid-template-columns: repeat(2, 1fr); } }
.counter-card {
  text-align: center; padding: 30px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.3s, transform 0.3s;
}
.counter-card:hover { border-color: var(--brand-1); transform: translateY(-4px); }
.counter-num { font-family: var(--font-head); font-size: clamp(30px, 4vw, 44px); font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.counter-label { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---- platform cards ---- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.p-card {
  position: relative; padding: 30px 26px; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.p-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 0.35s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(99, 102, 241, 0.14), transparent 60%);
}
.p-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45); }
.p-card:hover::before { opacity: 1; }
.p-icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px;
  background: linear-gradient(140deg, rgba(99, 102, 241, 0.2), rgba(34, 211, 238, 0.12));
  border: 1px solid var(--border-strong);
}
.p-icon svg { width: 28px; height: 28px; }
.p-card h3 { font-size: 19px; margin-bottom: 8px; }
.p-card p { color: var(--muted); font-size: 14.5px; }

/* ---- process timeline ---- */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; position: relative; counter-reset: step; }
@media (max-width: 900px) { .timeline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .timeline { grid-template-columns: 1fr; } }
.t-step {
  position: relative; padding: 28px 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); transition: border-color 0.3s, transform 0.3s;
}
.t-step:hover { border-color: var(--brand-3); transform: translateY(-4px); }
.t-num {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 18px; color: #fff;
  background: var(--grad); box-shadow: var(--glow-1); margin-bottom: 16px;
}
.t-step h3 { font-size: 17.5px; margin-bottom: 8px; }
.t-step p { color: var(--muted); font-size: 14px; }

/* ---- why cards ---- */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.why-item {
  display: flex; gap: 14px; align-items: flex-start; padding: 22px;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.3s;
}
.why-item:hover { border-color: var(--brand-2); }
.why-item .check {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(52, 211, 153, 0.15); color: var(--ok); font-size: 14px; font-weight: 700;
}
.why-item h4 { font-size: 15.5px; margin-bottom: 4px; }
.why-item p { color: var(--muted); font-size: 13.5px; }

/* ---- trust strip ---- */
.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .trust-strip { grid-template-columns: 1fr; } }
.trust-card {
  padding: 28px 26px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.09), rgba(34, 211, 238, 0.04));
  border: 1px solid var(--border-strong); transition: transform 0.3s, border-color 0.3s;
}
.trust-card:hover { transform: translateY(-4px); border-color: var(--brand-2); }
.trust-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 16px; background: rgba(52, 211, 153, 0.12); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.3); }
.trust-icon svg { width: 24px; height: 24px; }
.trust-card h3 { font-size: 17px; margin-bottom: 8px; }
.trust-card p { color: var(--muted); font-size: 14px; }

/* ---- selected work ---- */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .work-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; } }
.work-card {
  display: block; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.work-card:hover { transform: translateY(-6px); border-color: var(--brand-1); box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5); }
.work-thumb {
  height: 150px; display: grid; place-items: center; position: relative; overflow: hidden;
  font-family: var(--font-head); font-weight: 700; font-size: 26px; line-height: 1.05;
  text-align: center; color: #fff; letter-spacing: 0.5px;
}
.work-thumb::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 100% 22px; opacity: 0.6;
}
.work-thumb span { position: relative; z-index: 1; text-shadow: 0 3px 18px rgba(0,0,0,0.4); }
.work-thumb-1 { background: linear-gradient(135deg, #4f46e5, #0891b2); }
.work-thumb-2 { background: linear-gradient(135deg, #7e22ce, #db2777); }
.work-thumb-3 { background: linear-gradient(135deg, #0e7490, #15803d); }
.work-body { padding: 22px 24px 24px; }
.work-kind { font-size: 11.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--brand-2); margin-bottom: 8px; }
.work-card h3 { font-size: 19px; margin-bottom: 8px; }
.work-card p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.work-link { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--brand-2); }
.work-card:hover .work-link .arrow { transform: translate(3px, -3px); }
.work-link .arrow { transition: transform 0.25s; }
.work-more { text-align: center; color: var(--muted); font-size: 14.5px; margin-top: 28px; max-width: 620px; margin-inline: auto; }

/* ---- FAQ accordion ---- */
.faq-list { max-width: 820px; margin-inline: auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; transition: border-color 0.3s; }
.faq-item.open { border-color: var(--brand-1); }
.faq-q {
  width: 100%; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 19px 22px; background: none; border: 0; color: var(--text);
  font-family: var(--font-body); font-size: 15.5px; font-weight: 600; text-align: start; line-height: 1.5;
  transition: color 0.25s;
}
.faq-q:hover { color: var(--brand-2); }
.faq-mark { position: relative; width: 16px; height: 16px; flex-shrink: 0; }
.faq-mark::before, .faq-mark::after {
  content: ''; position: absolute; inset-inline-start: 0; top: 7px; width: 16px; height: 2px;
  background: var(--brand-2); border-radius: 2px; transition: transform 0.3s;
}
.faq-mark::after { transform: rotate(90deg); }
.faq-item.open .faq-mark::after { transform: rotate(0deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.faq-item.open .faq-a { max-height: 400px; }
.faq-a p { color: var(--muted); font-size: 14.5px; padding: 0 22px 20px; line-height: 1.75; }

/* ---- store QR portfolios ---- */
.qr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 780px; margin-inline: auto; }
@media (max-width: 640px) { .qr-grid { grid-template-columns: 1fr; max-width: 380px; } }

.qr-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  padding: 26px 24px 24px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s, box-shadow 0.35s;
}
.qr-card::before {
  content: ''; position: absolute; top: 0; inset-inline: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent); opacity: 0.7;
}
.qr-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--brand) 50%, transparent);
  box-shadow: 0 22px 52px color-mix(in srgb, var(--brand) 20%, transparent);
}

.qr-head { display: flex; align-items: center; gap: 13px; width: 100%; margin-bottom: 20px; }
.qr-logo {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
.qr-logo svg { width: 22px; height: 22px; }
.qr-titles h3 { font-size: 17px; line-height: 1.25; }
.qr-titles p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* white plate so the QR always scans, whatever the theme */
.qr-frame {
  position: relative; overflow: hidden; padding: 12px; border-radius: 16px;
  background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  line-height: 0;
}
/* NOTE: no image-rendering:pixelated — these are 600px QRs shown at 176px, and
   nearest-neighbour downscaling drops modules and can break scanning. */
.qr-frame img { width: 176px; height: 176px; display: block; }
@media (max-width: 400px) { .qr-frame img { width: 150px; height: 150px; } }

/* scanning sweep */
.qr-scanline {
  position: absolute; inset-inline: 0; top: -40%; height: 40%;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--brand) 55%, transparent), transparent);
  opacity: 0; pointer-events: none;
}
.qr-card:hover .qr-scanline { animation: qrScan 1.5s ease-in-out infinite; }
@keyframes qrScan {
  0%   { top: -40%; opacity: 0; }
  20%  { opacity: 0.9; }
  80%  { opacity: 0.9; }
  100% { top: 100%; opacity: 0; }
}

.qr-hint {
  margin-top: 14px; font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--faint); transition: color 0.3s;
}
.qr-card:hover .qr-hint { color: var(--brand); }
.qr-btn { margin-top: 14px; width: 100%; justify-content: center; }

@media (prefers-reduced-motion: reduce) { .qr-card:hover .qr-scanline { animation: none; } }

/* ---- social / connect ---- */
.social-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 900px; margin-inline: auto; }
@media (max-width: 820px) { .social-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .social-grid { grid-template-columns: 1fr; } }

.social-card {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.32s, box-shadow 0.32s, background 0.32s;
}
.social-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  box-shadow: 0 18px 44px color-mix(in srgb, var(--brand) 26%, transparent);
}

.social-ico {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 32%, transparent);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.32s;
}
.social-card:hover .social-ico { transform: scale(1.08) rotate(-5deg); box-shadow: 0 0 22px color-mix(in srgb, var(--brand) 45%, transparent); }
[dir="rtl"] .social-card:hover .social-ico { transform: scale(1.08) rotate(5deg); }

.social-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.social-meta b { font-size: 15.5px; font-weight: 700; }
.social-meta span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-go { margin-inline-start: auto; color: var(--faint); font-size: 16px; transition: color 0.3s, transform 0.3s; }
.social-card:hover .social-go { color: var(--brand); transform: translate(3px, -3px); }
[dir="rtl"] .social-go { transform: scaleX(-1); }
[dir="rtl"] .social-card:hover .social-go { transform: scaleX(-1) translate(3px, -3px); }

/* shine sweep on hover */
.social-shine {
  position: absolute; top: 0; inset-inline-start: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  transform: skewX(-18deg); pointer-events: none; transition: inset-inline-start 0.6s ease;
}
.social-card:hover .social-shine { inset-inline-start: 130%; }

/* footer social row */
.footer-social-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 22px; }
.footer-social-label { font-size: 12.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--faint); }
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.footer-social a:hover {
  color: var(--brand); transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent);
}

/* ---- tech marquee ---- */
.marquee { overflow: hidden; position: relative; padding-block: 8px;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 30s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
[dir="rtl"] .marquee-track { animation-name: marqueeRtl; }
@keyframes marqueeRtl { to { transform: translateX(50%); } }
.chip {
  padding: 10px 22px; border-radius: 999px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: 14px; font-weight: 600;
}

/* ---- CTA banner ---- */
.cta-banner {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(44px, 7vw, 80px) 24px; border-radius: 26px;
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.16), rgba(168, 85, 247, 0.10) 50%, rgba(34, 211, 238, 0.14));
  border: 1px solid var(--border-strong);
}
.cta-banner::before, .cta-banner::after {
  content: ''; position: absolute; width: 320px; height: 320px; border-radius: 50%; filter: blur(90px); opacity: 0.5;
}
.cta-banner::before { background: #4f46e5; top: -160px; inset-inline-start: -80px; }
.cta-banner::after { background: #0891b2; bottom: -160px; inset-inline-end: -80px; }
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner h2 { font-size: clamp(26px, 4vw, 40px); margin-bottom: 12px; }
.cta-banner p { color: var(--muted); margin-bottom: 28px; }

/* ---- footer ---- */
footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 44px 0 30px; background: rgba(5, 6, 12, 0.6); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; }
.footer-col p { color: var(--muted); font-size: 14px; max-width: 320px; margin-top: 8px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a, .footer-contact a { color: var(--muted); font-size: 14px; transition: color 0.25s; display: inline-flex; align-items: center; gap: 8px; }
.footer-links a:hover, .footer-contact a:hover { color: var(--brand-2); }
.footer-contact { display: flex; flex-direction: column; gap: 8px; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; color: var(--faint); font-size: 13px; }
.footer-title { font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text); margin-bottom: 10px; }

/* ============================================================
   REQUEST WIZARD
   ============================================================ */
.wizard-wrap { max-width: 780px; margin-inline: auto; padding-top: calc(var(--nav-h) + clamp(28px, 5vw, 60px)); }
.wizard-head { text-align: center; margin-bottom: 34px; }
.wizard-head h1 { font-size: clamp(28px, 4.6vw, 42px); margin-bottom: 10px; }
.wizard-head p { color: var(--muted); }

/* labelled stepper */
.stepper { list-style: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; margin-bottom: 26px; position: relative; }
.stepper-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; text-align: center; }
.stepper-item::before {
  content: ''; position: absolute; top: 17px; inset-inline-start: -50%; width: 100%; height: 2px;
  background: var(--border); z-index: 0;
}
.stepper-item:first-child::before { display: none; }
.stepper-item.done::before, .stepper-item.current::before { background: var(--grad); }
.stepper-dot {
  position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 14px;
  background: var(--bg-2); border: 2px solid var(--border); color: var(--faint);
  transition: all 0.35s;
}
.stepper-item.current .stepper-dot { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow-1); transform: scale(1.08); }
.stepper-item.done .stepper-dot { background: rgba(52, 211, 153, 0.16); border-color: var(--ok); color: var(--ok); }
.stepper-item.done .stepper-dot::after { content: '✓'; font-size: 15px; }
.stepper-item.done .stepper-dot { font-size: 0; }
.stepper-label { font-size: 12.5px; font-weight: 600; color: var(--faint); transition: color 0.3s; }
.stepper-item.current .stepper-label { color: var(--text); }
.stepper-item.done .stepper-label { color: var(--muted); }
.stepper-item.clickable { cursor: pointer; }
.stepper-item.clickable:hover .stepper-dot { border-color: var(--brand-2); transform: scale(1.12); }
@media (max-width: 620px) { .stepper-label { display: none; } .stepper { margin-bottom: 20px; } }

.progress-rail { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; width: 20%; background: var(--grad); border-radius: 8px; transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--glow-1); }
.progress-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; margin-bottom: 20px; }
.draft-note { color: var(--ok); font-size: 12px; opacity: 0; transition: opacity 0.3s; }
.draft-note.show { opacity: 1; }

.draft-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; margin-bottom: 20px; border-radius: var(--radius-sm);
  background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--brand-2); font-size: 13.5px;
}
.draft-discard { background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; font-family: inherit; }
.draft-discard:hover { color: var(--danger); }

/* char counter + field footer */
.field-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; }
.field-foot .err-msg { margin-top: 0; }
.char-count { color: var(--faint); font-size: 12.5px; margin-inline-start: auto; white-space: nowrap; }
.char-count.low { color: var(--warn); }

/* NDA checkbox */
.nda-row {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer; user-select: none;
  padding: 16px 18px; border-radius: var(--radius-sm); background: var(--bg-2);
  border: 1.5px solid var(--border); transition: border-color 0.25s; margin-top: 4px;
}
.nda-row:hover { border-color: var(--border-strong); }
.nda-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.nda-box {
  flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; border-radius: 6px;
  border: 1.5px solid var(--border-strong); display: grid; place-items: center; transition: all 0.22s;
}
.nda-box::after { content: '✓'; font-size: 12px; color: #fff; opacity: 0; transition: opacity 0.2s; }
.nda-row input:checked ~ .nda-box { background: var(--grad); border-color: transparent; }
.nda-row input:checked ~ .nda-box::after { opacity: 1; }
.nda-row input:checked ~ span .nda-label { color: var(--text); }
.nda-row input:focus-visible ~ .nda-box { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25); }
.nda-label { display: block; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.nda-hint { display: block; color: var(--faint); font-size: 12.5px; margin-top: 3px; }

/* privacy note on review */
.privacy-note {
  display: flex; align-items: flex-start; gap: 11px; margin-top: 16px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  background: rgba(52, 211, 153, 0.07); border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--muted); font-size: 13.5px; line-height: 1.6;
}
.privacy-note svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--ok); margin-top: 1px; }

/* success: reference + next steps */
.ref-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 6px; }
.ref-row .ref-chip { margin: 0; }
.ref-copy { padding: 9px 18px; font-size: 13.5px; }
.ref-note { color: var(--faint); font-size: 13px; max-width: 420px; margin-inline: auto; margin-bottom: 30px; }

.next-steps { text-align: start; max-width: 500px; margin-inline: auto; margin-bottom: 32px; }
.next-steps h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 1.8px; color: var(--brand-2); margin-bottom: 16px; text-align: center; }
.next-steps ol { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.next-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); }
.ns-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 13px;
}
.next-steps li div { display: flex; flex-direction: column; gap: 3px; }
.next-steps b { font-size: 14.5px; }
.next-steps span { color: var(--muted); font-size: 13px; line-height: 1.55; }

.step-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: clamp(22px, 4vw, 40px); backdrop-filter: blur(10px);
  animation: stepIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes stepIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.step-panel h2 { font-size: clamp(20px, 3vw, 26px); margin-bottom: 6px; }
.step-panel .step-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 26px; }

/* platform select cards */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.opt-card {
  position: relative; cursor: pointer; text-align: center; padding: 22px 12px 18px;
  border-radius: var(--radius-sm); background: var(--bg-2); border: 1.5px solid var(--border);
  transition: all 0.25s; user-select: none;
}
.opt-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.opt-card.selected { border-color: var(--brand-1); background: rgba(99, 102, 241, 0.12); box-shadow: var(--glow-1); }
.opt-card .opt-icon { width: 40px; height: 40px; margin-inline: auto; margin-bottom: 10px; display: grid; place-items: center; }
.opt-card .opt-icon svg { width: 34px; height: 34px; }
.opt-card .opt-name { font-weight: 600; font-size: 14.5px; }
.opt-card .opt-tick {
  position: absolute; top: 8px; inset-inline-end: 8px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--grad); color: #fff; display: none; place-items: center; font-size: 11px;
}
.opt-card.selected .opt-tick { display: grid; }

/* feature chips */
.chips-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.f-chip {
  cursor: pointer; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--bg-2); border: 1.5px solid var(--border); color: var(--muted); transition: all 0.22s; user-select: none;
}
.f-chip:hover { border-color: var(--border-strong); color: var(--text); }
.f-chip.selected { border-color: var(--brand-2); color: var(--text); background: rgba(34, 211, 238, 0.12); }

/* inputs */
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; background: var(--bg-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 16px; color: var(--text); font-size: 15px; font-family: var(--font-body);
  transition: border-color 0.25s, box-shadow 0.25s; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-1); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
.input.error, .textarea.error { border-color: var(--danger); }
.textarea { min-height: 140px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa3c0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
[dir="rtl"] .select { background-position: left 16px center; }
.field .hint { color: var(--faint); font-size: 12.5px; margin-top: 6px; }
.field .err-msg { color: var(--danger); font-size: 12.5px; margin-top: 6px; display: none; }
.field.has-error .err-msg { display: block; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .two-col { grid-template-columns: 1fr; } }

/* wizard nav */
.wizard-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 30px; }
.step-error { color: var(--danger); font-size: 14px; margin-top: 14px; text-align: center; display: none; }
.step-error.show { display: block; animation: shake 0.4s; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* review */
.review-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px; margin-bottom: 14px; background: var(--bg-2); }
.review-block h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--brand-2); margin-bottom: 8px; }
.review-block p { font-size: 14.5px; color: var(--text); word-break: break-word; }
.review-block .muted { color: var(--muted); }

/* success */
.success-panel { text-align: center; padding: clamp(30px, 6vw, 60px) 20px; }
.success-ring {
  width: 110px; height: 110px; margin-inline: auto; margin-bottom: 26px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(52, 211, 153, 0.12);
  border: 2px solid var(--ok); box-shadow: 0 0 50px rgba(52, 211, 153, 0.35);
  animation: popIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.success-ring svg { width: 52px; height: 52px; stroke: var(--ok); }
.success-ring .tick-path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.7s 0.3s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes popIn { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-panel h2 { font-size: clamp(24px, 4vw, 34px); margin-bottom: 12px; }
.success-panel p { color: var(--muted); max-width: 460px; margin-inline: auto; margin-bottom: 8px; }
.ref-chip {
  display: inline-block; margin: 16px 0 26px; padding: 10px 24px; border-radius: 999px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  font-family: var(--font-head); font-size: 17px; letter-spacing: 2px; color: var(--brand-2);
}

/* ============================================================
   STATS DASHBOARD
   ============================================================ */
.stats-wrap { padding-top: calc(var(--nav-h) + clamp(28px, 5vw, 56px)); }
.stats-head { text-align: center; margin-bottom: 40px; }
.stats-head h1 { font-size: clamp(30px, 5vw, 48px); margin-bottom: 10px; }
.stats-head p { color: var(--muted); }
.live-pill {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  padding: 7px 18px; border-radius: 999px; background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.4); color: var(--ok); font-size: 13px; font-weight: 700; letter-spacing: 1.5px;
}
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 1.6s infinite; }

.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
@media (max-width: 860px) { .stat-tiles { grid-template-columns: repeat(2, 1fr); } }
.tile {
  position: relative; overflow: hidden; padding: 26px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); transition: transform 0.3s, border-color 0.3s;
}
.tile:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.tile::after {
  content: ''; position: absolute; top: 0; inset-inline: 0; height: 3px;
  background: var(--grad); opacity: 0.85;
}
.tile .tile-label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; }
.tile .tile-num { font-family: var(--font-head); font-size: clamp(30px, 4vw, 42px); font-weight: 700; margin-top: 6px; }
.tile .tile-icon { position: absolute; inset-inline-end: 18px; top: 22px; opacity: 0.5; }
.tile .tile-icon svg { width: 30px; height: 30px; }

.panel-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.panel-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 900px) { .panel-grid, .panel-grid-3 { grid-template-columns: 1fr; } }

.panel {
  padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.panel h3 { font-size: 16px; margin-bottom: 18px; display: flex; align-items: center; gap: 9px; }
.panel h3 .h-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--grad); display: inline-block; }

/* area chart */
.chart-box { position: relative; width: 100%; }
.chart-box svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-line { fill: none; stroke: url(#lineGrad); stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.5)); }
.chart-area { fill: url(#areaGrad); opacity: 0.9; }
.chart-tip {
  position: absolute; pointer-events: none; background: #12152a; border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 8px 12px; font-size: 12.5px; transform: translate(-50%, -110%);
  white-space: nowrap; opacity: 0; transition: opacity 0.15s; z-index: 5;
}
.chart-tip b { color: var(--brand-2); }

/* h-bars */
.bar-row { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13.5px; }
.bar-row .bar-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-rail { height: 9px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.bar-row .bar-fill { height: 100%; width: 0; border-radius: 6px; background: var(--grad); transition: width 1s cubic-bezier(0.16, 1, 0.3, 1); }
.bar-row .bar-val { text-align: end; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-wrap svg { width: 150px; height: 150px; flex-shrink: 0; }
.donut-seg { fill: none; stroke-width: 20; transition: stroke-dasharray 1s cubic-bezier(0.16, 1, 0.3, 1); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; min-width: 130px; }
.donut-legend .lg-row { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.donut-legend .lg-dot { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }
.donut-legend b { color: var(--text); margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.donut-center { font-family: var(--font-head); font-size: 22px; font-weight: 700; fill: var(--text); }
.donut-center-sub { font-size: 10px; fill: var(--muted); letter-spacing: 1px; }

/* heatmap */
.heat-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 7px; }
.heat-cell {
  aspect-ratio: 1; border-radius: 6px; background: var(--bg-2); position: relative;
  border: 1px solid var(--border); transition: transform 0.2s;
}
.heat-cell:hover { transform: scale(1.15); z-index: 2; }
.heat-cell .heat-h { position: absolute; inset: 0; display: grid; place-items: center; font-size: 9.5px; color: var(--faint); }
.heat-note { color: var(--faint); font-size: 12px; margin-top: 12px; }

/* device split */
.dev-split { display: flex; flex-direction: column; gap: 16px; }
.dev-item { display: flex; align-items: center; gap: 14px; }
.dev-item .dev-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--border); flex-shrink: 0; }
.dev-item .dev-icon svg { width: 20px; height: 20px; }
.dev-item .dev-body { flex: 1; }
.dev-item .dev-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.dev-item .dev-top b { font-variant-numeric: tabular-nums; }
.dev-item .dev-rail { height: 8px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.dev-item .dev-fill { height: 100%; width: 0; border-radius: 6px; transition: width 1s cubic-bezier(0.16, 1, 0.3, 1); }

.stats-note { text-align: center; color: var(--faint); font-size: 13px; margin-top: 8px; padding-bottom: 20px; }
.stats-note a { color: var(--brand-2); }

.skeleton { position: relative; overflow: hidden; background: var(--bg-2) !important; color: transparent !important; border-radius: 8px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-wrap { padding-top: calc(var(--nav-h) + 40px); max-width: 880px; margin-inline: auto; }
.key-gate { max-width: 420px; margin: 8vh auto; text-align: center; }
.key-gate .panel { padding: 36px 30px; }
.sub-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 22px 24px; margin-bottom: 16px; transition: border-color 0.3s; }
.sub-card:hover { border-color: var(--border-strong); }
.sub-card .sub-top { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sub-card .sub-id { font-family: var(--font-head); color: var(--brand-2); letter-spacing: 1px; font-size: 14px; }
.sub-card .sub-when { color: var(--faint); font-size: 12.5px; }
.sub-card .sub-name { font-size: 17px; font-weight: 700; }
.sub-card .sub-row { font-size: 14px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.sub-card .sub-row b { color: var(--text); font-weight: 600; }
.sub-card .sub-desc { margin-top: 10px; padding: 12px 14px; background: var(--bg-2); border-radius: 10px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px; }
.badge-ok { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.badge-warn { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.badge-new { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.badge-prog { background: rgba(34, 211, 238, 0.14); color: var(--brand-2); }
.badge-arch { background: rgba(255, 255, 255, 0.07); color: var(--faint); }
.admin-bar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 22px; }

/* mail health banner */
.mail-health {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 14px 18px; margin-bottom: 16px;
}
.mh-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.mh-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.mh-ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.mh-warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.mh-row b { color: var(--text); }
.mh-sep { opacity: 0.4; }
.mh-queued { color: var(--warn); font-weight: 600; }
.mh-link { background: none; border: 0; color: var(--brand-2); cursor: pointer; font-size: 13px; text-decoration: underline; padding: 0; }
.mh-note { color: var(--faint); font-size: 12.5px; margin-top: 8px; line-height: 1.6; }
.mh-alert {
  margin-top: 10px; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.65;
  background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.35); color: #fcd34d;
}
.mh-alert b { color: #fde68a; }
.mh-alert code { background: rgba(0, 0, 0, 0.3); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.mh-note code { background: var(--bg-2); padding: 1px 6px; border-radius: 5px; color: var(--muted); font-size: 12px; }

/* status filters */
.filter-row { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-chip {
  cursor: pointer; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); transition: all 0.22s;
}
.filter-chip:hover { border-color: var(--border-strong); color: var(--text); }
.filter-chip.selected { border-color: var(--brand-1); background: rgba(99, 102, 241, 0.14); color: var(--text); }

/* quick actions + reply */
.quick-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.qa-spacer { flex: 1; }
.qa {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; font-family: inherit;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); transition: all 0.22s;
}
.qa:hover { border-color: var(--brand-2); color: var(--text); }
.qa-select {
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; font-family: inherit;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--muted); cursor: pointer; outline: none;
}
.qa-select:focus { border-color: var(--brand-1); }

.reply-box { margin-top: 14px; animation: stepIn 0.3s ease; }
.reply-box .textarea { min-height: 110px; font-size: 14px; }
.reply-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.reply-actions .btn { padding: 10px 20px; font-size: 14px; }
.reply-status { font-size: 13px; margin-top: 10px; min-height: 18px; color: var(--muted); }
.reply-status.ok { color: var(--ok); }
.reply-status.err { color: var(--danger); }

.reply-log { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.reply-item { border-inline-start: 3px solid var(--brand-1); padding: 10px 14px; background: rgba(99, 102, 241, 0.06); border-radius: 0 10px 10px 0; }
[dir="rtl"] .reply-item { border-radius: 10px 0 0 10px; }
.reply-meta { font-size: 12px; color: var(--faint); margin-bottom: 5px; }
.reply-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }

/* ============================================================
   404 + misc pages
   ============================================================ */
.err-wrap { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 20px; }
.err-code { font-family: var(--font-head); font-size: clamp(90px, 20vw, 180px); font-weight: 700; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.4)); animation: floatY 5s ease-in-out infinite; }
.err-wrap h1 { font-size: clamp(20px, 3.5vw, 30px); margin: 14px 0 10px; }
.err-wrap p { color: var(--muted); margin-bottom: 28px; }

.legal-wrap { max-width: 760px; margin-inline: auto; padding-top: calc(var(--nav-h) + 50px); padding-bottom: 60px; }
.legal-wrap h1 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 24px; }
.legal-wrap h2 { font-size: 20px; margin: 28px 0 10px; }
.legal-wrap p, .legal-wrap li { color: var(--muted); font-size: 15px; }
.legal-wrap ul { padding-inline-start: 22px; }

/* confetti canvas */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

/* ============================================================
   WHATSAPP — floating button + inline button
   ============================================================ */
.btn-wa {
  background: #25D366; color: #06301a;
  box-shadow: 0 8px 26px rgba(37, 211, 102, 0.32);
}
.btn-wa:hover { background: #1eba59; transform: translateY(-2px); box-shadow: 0 12px 34px rgba(37, 211, 102, 0.5); }
.btn-wa svg { width: 20px; height: 20px; flex-shrink: 0; }

.wa-fab {
  position: fixed; z-index: 60;
  bottom: 22px; inset-inline-end: 22px;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: #25D366; color: #fff;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.42), 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s;
}
.wa-fab svg { width: 32px; height: 32px; position: relative; z-index: 1; }
.wa-fab:hover { transform: scale(1.08); box-shadow: 0 14px 40px rgba(37, 211, 102, 0.6), 0 2px 10px rgba(0, 0, 0, 0.4); }
.wa-fab:active { transform: scale(0.97); }

/* attention ring */
.wa-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #25D366; opacity: 0;
  animation: waPulse 2.8s ease-out infinite;
}
@keyframes waPulse {
  0%   { transform: scale(1); opacity: 0.75; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* label on hover (desktop only) */
.wa-tip {
  position: absolute; inset-inline-end: calc(100% + 12px); top: 50%; transform: translateY(-50%) translateX(6px);
  background: #12152a; color: var(--text); border: 1px solid var(--border-strong);
  padding: 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
[dir="rtl"] .wa-tip { transform: translateY(-50%) translateX(-6px); }
.wa-fab:hover .wa-tip { opacity: 1; transform: translateY(-50%) translateX(0); }

@media (max-width: 720px) {
  .wa-fab { width: 52px; height: 52px; bottom: 16px; inset-inline-end: 16px; }
  .wa-fab svg { width: 28px; height: 28px; }
  .wa-tip { display: none; }
}

@media (prefers-reduced-motion: reduce) { .wa-ring { animation: none; opacity: 0; } }
