/* ==========================================================================
   VPN Pi — Official Global Brand Design System
   Authentic App Palette: Deep Cosmic Violet (#1B1026), Royal Purple (#713D83),
   Molten Gold (#F0AA2B), Verified Emerald (#00E676).
   Supports Dark (default) & Light themes + RTL (Arabic) & LTR (English).
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #140c1c;
  --bg-elevated: #1b1026;
  --surface: #251633;
  --surface-2: #321d42;
  --surface-glass: rgba(37, 22, 51, 0.78);
  --border: rgba(174, 122, 188, 0.22);
  --border-strong: rgba(240, 170, 43, 0.42);
  --purple: #713d83;
  --purple-deep: #593169;
  --purple-light: #ae7abc;
  --gold: #f0aa2b;
  --gold-light: #f5c65d;
  --gold-dark: #da931e;
  --green: #00e676;
  --green-soft: rgba(0, 230, 118, 0.14);
  --danger: #ff4778;
  --warn: #ffa000;
  --text: #ffffff;
  --text-secondary: #cbc5dc;
  --text-muted: #9389ad;
  --shadow-lg: 0 24px 64px rgba(7, 3, 14, 0.55);
  --shadow-glow: 0 0 42px rgba(113, 61, 131, 0.36);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --nav-h: 74px;
  --max-w: 1180px;
  --font-en: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ar: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f8f5fc;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1e9f9;
  --surface-glass: rgba(255, 255, 255, 0.86);
  --border: rgba(89, 49, 105, 0.16);
  --border-strong: rgba(196, 131, 18, 0.45);
  --purple: #6b357d;
  --purple-deep: #4e245e;
  --purple-light: #874d9b;
  --gold: #c9830b;
  --gold-light: #e4a124;
  --gold-dark: #a66905;
  --green: #009c50;
  --green-soft: rgba(0, 156, 80, 0.12);
  --danger: #d62857;
  --warn: #c77700;
  --text: #1b1026;
  --text-secondary: #49385b;
  --text-muted: #705e82;
  --shadow-lg: 0 20px 48px rgba(45, 22, 68, 0.1);
  --shadow-glow: 0 12px 32px rgba(113, 61, 131, 0.16);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

html[dir='rtl'] body {
  font-family: var(--font-ar);
}

img {
  max-width: 100%;
  display: block;
}

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

button,
input,
textarea,
select {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Instant zero-flicker bilingual visibility */
html[lang='en'] [data-lang='ar'],
html[lang='ar'] [data-lang='en'] {
  display: none !important;
}

/* Cosmic ambient background */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 14% 12%, rgba(113, 61, 131, 0.28), transparent 42%),
    radial-gradient(circle at 86% 20%, rgba(240, 170, 43, 0.12), transparent 36%),
    radial-gradient(circle at 50% 90%, rgba(0, 230, 118, 0.06), transparent 42%);
}

html[data-theme='light'] .ambient-bg {
  background:
    radial-gradient(circle at 14% 10%, rgba(113, 61, 131, 0.11), transparent 45%),
    radial-gradient(circle at 86% 18%, rgba(240, 170, 43, 0.12), transparent 38%);
}

/* Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--nav-h);
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(113, 61, 131, 0.45);
}

.brand-name {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  direction: ltr;
  unicode-bidi: isolate;
}

.brand-name .accent {
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.nav-links a {
  transition: color 0.18s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 38px;
  padding: 0 0.78rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}

.icon-btn:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 40px;
  padding: 0;
}

/* Mobile drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  inset-inline: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem 1.5rem;
  z-index: 85;
  box-shadow: var(--shadow-lg);
}

.mobile-drawer.open {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-drawer a {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}

.mobile-drawer a:hover,
.mobile-drawer a.active {
  background: var(--surface-2);
  color: var(--gold);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  border-radius: 13px;
  font-weight: 700;
  font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1b1026;
  box-shadow: 0 10px 28px rgba(240, 170, 43, 0.32);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(240, 170, 43, 0.44);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 0.55rem 1rem;
  font-size: 0.86rem;
  border-radius: 10px;
}

/* Status badges & pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(113, 61, 131, 0.24);
  border: 1px solid var(--border-strong);
  color: var(--gold-light);
}

html[data-theme='light'] .pill {
  background: rgba(113, 61, 131, 0.08);
  color: var(--purple-deep);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  flex-shrink: 0;
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 10px var(--warn);
}

.dot.danger {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

/* Hero */
.hero {
  padding: 4.2rem 0 3.6rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 3rem;
}

.hero h1 {
  margin: 1.15rem 0 1rem;
  font-size: clamp(2.15rem, 4.4vw, 3.45rem);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero h1 .grad {
  color: var(--gold-light);
}

html[data-theme='light'] .hero h1 .grad {
  color: var(--purple);
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 58ch;
  margin: 0 0 1.8rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.8rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Realistic Phone Bezel Mockup */
.phone-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-glow {
  position: absolute;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 230, 118, 0.22), rgba(113, 61, 131, 0.32), transparent 70%);
  filter: blur(28px);
  z-index: 0;
}

.phone-frame {
  position: relative;
  z-index: 1;
  width: min(300px, 84vw);
  padding: 10px;
  border-radius: 38px;
  background: linear-gradient(160deg, #3c2650, #160c20);
  border: 1px solid rgba(240, 170, 43, 0.35);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: floatSlow 6s ease-in-out infinite;
}

.phone-frame img {
  width: 100%;
  border-radius: 30px;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

/* Live Status Ribbon */
.status-ribbon {
  margin: 0.5rem 0 3.2rem;
  padding: 1rem 1.35rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
}

.status-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Sections */
.section {
  padding: 4.2rem 0;
}

.section-alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin-bottom: 2.6rem;
}

.section-head .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.section-head h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

/* Cards & Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.65rem;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(113, 61, 131, 0.32), rgba(240, 170, 43, 0.18));
  border: 1px solid var(--border-strong);
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.12rem;
  font-weight: 700;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

/* Architecture Split */
.arch-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.8rem;
}

.arch-node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
}

.arch-step {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--gold);
  background: rgba(240, 170, 43, 0.14);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

/* Notice & Disclaimer Box */
.notice-box {
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(240, 170, 43, 0.09);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 1.6rem;
}

.notice-box strong {
  color: var(--gold);
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-q {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 1.2rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: start;
  cursor: pointer;
}

.faq-q span.chev {
  color: var(--gold);
  transition: transform 0.2s ease;
  font-size: 1.15rem;
}

.faq-item.open .faq-q span.chev {
  transform: rotate(45deg);
}

.faq-a {
  display: none;
  padding: 0 1.4rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.faq-item.open .faq-a {
  display: block;
}

/* Forms & Legal prose */
.page-hero {
  padding: 3.4rem 0 2.2rem;
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  margin: 0.7rem 0 0.6rem;
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
  font-weight: 800;
}

.page-hero p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 68ch;
}

.prose {
  max-width: 820px;
}

.prose h2 {
  margin: 2.2rem 0 0.7rem;
  font-size: 1.32rem;
  color: var(--gold);
}

.prose p,
.prose li {
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.prose ul {
  padding-inline-start: 1.35rem;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 620px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.field label {
  font-weight: 700;
  font-size: 0.9rem;
}

.field input,
.field textarea,
.field select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0.8rem 0.95rem;
  color: var(--text);
  font-size: 0.95rem;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--gold);
}

.form-msg {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 11px;
  font-size: 0.92rem;
  font-weight: 600;
  display: none;
}

.form-msg.show { display: block; }
.form-msg.ok { background: var(--green-soft); color: var(--green); border: 1px solid var(--green); }
.form-msg.err { background: rgba(255, 71, 120, 0.14); color: var(--danger); border: 1px solid var(--danger); }

/* Status Table */
.status-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.2rem;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.status-table th,
.status-table td {
  padding: 0.95rem 1.1rem;
  text-align: start;
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
}

.status-table th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--gold);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 3.2rem 0 2rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.2rem;
}

.footer-col h4 {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  color: var(--gold);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-bottom {
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid,
  .grid-3,
  .arch-flow,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-lead { margin-inline: auto; }
  .hero-cta, .trust-row { justify-content: center; }
  .nav-links { display: none; }
  .menu-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
  .grid-3,
  .grid-2,
  .arch-flow,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .nav-actions .btn-primary {
    display: none;
  }
  .hero { padding: 2.2rem 0 2.4rem; }
  .section { padding: 2.8rem 0; }
  .form-card { padding: 1.35rem; }
}
