/* ============================================
   Formula AI Global - Premium Design System
   ============================================ */

:root {
  /* Brand Colors */
  --primary: #00ff88;
  --primary-dark: #00cc6a;
  --primary-light: #4dffaa;
  --secondary: #00d4ff;
  --secondary-dark: #0099cc;
  --accent: #e94560;
  --gold: #ffd700;

  /* Backgrounds */
  --bg-1: #050818;
  --bg-2: #0a0e27;
  --bg-3: #0f1733;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.05);

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --border-primary: rgba(0, 255, 136, 0.3);

  /* Text */
  --text-1: #ffffff;
  --text-2: #c1c8e4;
  --text-3: #8892b0;
  --text-4: #4a5170;

  /* Effects */
  --shadow-glow: 0 0 60px rgba(0, 255, 136, 0.3);
  --shadow-glow-blue: 0 0 60px rgba(0, 212, 255, 0.3);
  --shadow-card: 0 24px 48px -16px rgba(0, 0, 0, 0.5);

  /* Gradients */
  --grad-hero: radial-gradient(ellipse at top, #1a1a4e 0%, #0a0e27 50%, #050818 100%);
  --grad-primary: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
  --grad-accent: linear-gradient(135deg, #e94560 0%, #903749 100%);
  --grad-text: linear-gradient(135deg, #00ff88 0%, #00d4ff 50%, #c084fc 100%);

  /* Sizing */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --container: 1280px;
}

/* ============================================
   Base Reset
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  /* Inter leads for Latin (crisp, modern — the world-class look); Cairo
     automatically picks up Arabic glyphs Inter doesn't cover. */
  font-family: 'Inter', 'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
  background: var(--bg-1);
  color: var(--text-1);
  line-height: 1.65;
  font-size: 16px;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}
/* Arabic should stay Cairo-led for proper shaping/readability. */
html[lang="ar"] body, [dir="rtl"] body {
  font-family: 'Cairo', 'Tajawal', 'Inter', system-ui, sans-serif;
  letter-spacing: 0;
}

/* Animated background mesh */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 255, 136, 0.08), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(0, 212, 255, 0.08), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(192, 132, 252, 0.05), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ── Global dark-theme hardening for native controls ──────────────
   Fixes the whole class of "white/ugly/invisible" bugs at once:
   selects, date/number pickers, autofill, placeholders, focus rings,
   spinners — so no single page needs a one-off patch again. */
:root { color-scheme: dark; }
input::placeholder, textarea::placeholder { color: var(--text-3, #8b93a7); opacity: 1; }
input, select, textarea { color-scheme: dark; }
/* Chrome autofill no longer paints a white/yellow box */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text-1, #e8edf6);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-card, #0b1020) inset;
  caret-color: var(--text-1, #e8edf6);
  transition: background-color 9999s ease-in-out 0s;
}
/* Native date/time/number pickers + spinners stay dark */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(0.9); cursor: pointer; }
input[type="number"]::-webkit-inner-spin-button { filter: invert(0.85); }
/* Accent (checkboxes, radios, range, progress) uses the brand colour */
input[type="checkbox"], input[type="radio"], input[type="range"], progress {
  accent-color: var(--primary, #00ff88);
}
/* Any element that visually fails the dark theme can opt in */
.force-dark, .force-dark * { color-scheme: dark; }

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

/* Dark-theme <select> dropdown fix: native <option> popups render with
   a white OS background; our light option text was white-on-white and
   only visible when highlighted. Force readable dark options site-wide
   + a colour-scheme hint so the browser draws the popup dark. */
select {
  color-scheme: dark;
}
select option,
select optgroup {
  background: #0b1020;
  color: #e8edf6;
}
select option:checked,
select option:hover {
  background: var(--primary, #00ff88);
  color: #02110a;
}

::selection {
  background: var(--primary);
  color: var(--bg-1);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-2);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 800;
  color: var(--text-1);
}

h1 { font-size: clamp(2.2rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}

/* ============================================
   Layout
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.section {
  padding: 100px 0;
  position: relative;
}

.section-sm {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 60px;
}

.section-header p {
  color: var(--text-2);
  font-size: 1.1rem;
  margin-top: 16px;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 14px 0;
  transition: padding 0.25s ease, background 0.25s ease;
  /* Solid-glass from the start: content never bleeds into it, and it
     reads as a real product header — not a cheap transparent bar. */
  background: rgba(5, 8, 24, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar.scrolled {
  background: rgba(5, 8, 24, 0.9);
  border-bottom-color: var(--border);
  padding: 10px 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 1.6vw, 22px);
  flex-wrap: nowrap;
}

/* ROOT CAUSE FIX: the shared .container caps width (~1240px) so the
   10-item nav overlapped even on a 1900px screen (viewport media
   queries couldn't help — the constraint was the container, not the
   viewport). The navbar gets its own WIDE container so every item +
   the CTAs fit on real desktops; narrow screens get the hamburger. */
.navbar > .container,
.navbar .nav-inner {
  max-width: min(1680px, 96vw);
}
.nav-links { flex-shrink: 1; }
.nav-tools, .nav-cta { flex-shrink: 0; }
/* Guarantee clear separation between the link row and the tools/CTA so
   the last item ("About") can never touch the language selector. */
.nav-links { margin-right: 18px; }
[dir="rtl"] .nav-links { margin-right: 0; margin-left: 18px; }
.nav-tools { margin-left: 6px; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-1);
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 40px;
  height: 40px;
  background: var(--grad-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 255, 136, 0.35);
}

.logo-mark svg {
  width: 24px;
  height: 24px;
  color: var(--bg-1);
  /* Continuous rotation of the orbital structure — visible because each
     ellipse moves through unique angles between symmetric positions */
  animation: logo-spin 6s linear infinite;
  transform-origin: 12px 12px;
  transform-box: view-box;
}

/* The nucleus dot pulses with a steady heartbeat */
.logo-mark svg circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: logo-nucleus-pulse 1.6s ease-in-out infinite;
}

/* The whole logo breathes — pulsing scale + glowing shadow */
.logo-mark {
  animation: logo-breathe 2.4s ease-in-out infinite;
  position: relative;
}

/* Soft halo behind the box that fades in/out — gives a "living" glow */
.logo-mark::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 16px;
  background: var(--grad-primary, linear-gradient(135deg, #00ff88, #00d4ff));
  filter: blur(14px);
  opacity: 0.4;
  z-index: -1;
  animation: logo-halo 2.4s ease-in-out infinite;
  pointer-events: none;
}

/* Pause everything on hover */
.logo:hover .logo-mark,
.logo:hover .logo-mark::after,
.logo:hover .logo-mark svg,
.logo:hover .logo-mark svg circle {
  animation-play-state: paused;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .logo-mark,
  .logo-mark::after,
  .logo-mark svg,
  .logo-mark svg circle {
    animation: none !important;
  }
}

@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes logo-nucleus-pulse {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%      { transform: scale(1.8);  opacity: 0.7; }
}

@keyframes logo-halo {
  0%, 100% { opacity: 0.30; transform: scale(1);    }
  50%      { opacity: 0.75; transform: scale(1.15); }
}

@keyframes logo-breathe {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 8px 24px rgba(0, 255, 136, 0.35);
  }
  50% {
    transform: scale(1.06);
    box-shadow:
      0 10px 32px rgba(0, 255, 136, 0.65),
      0 0 36px rgba(0, 212, 255, 0.45);
  }
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 22px);
  list-style: none;
  flex-wrap: nowrap;
  min-width: 0;
}

.nav-links a {
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text-1);
}

.nav-links a.active {
  color: var(--primary);
}
/* Premium underline on the active item */
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-primary, linear-gradient(135deg, #00ff88, #00d4ff));
}

/* The full nav (up to 10 items + 2 CTAs) only fits on wide screens.
   Anything narrower → clean hamburger menu instead of an overlapping
   cheap mess. This is the premium behaviour (one tidy row OR a tidy
   menu — never collision). */
@media (min-width: 1367px) and (max-width: 1560px) {
  .nav-links { gap: 13px; }
  .nav-links a { font-size: 0.82rem; }
  .logo { font-size: 1.2rem; }
  .nav-cta .btn { padding: 9px 14px; font-size: 0.85rem; }
}
@media (max-width: 1366px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(5, 8, 24, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    font-size: 0.95rem;
    padding: 12px 14px;
    border-radius: 10px;
  }
  .nav-links a:hover { background: var(--bg-card); }
  .nav-links a.active::after { display: none; }
  .nav-toggle { display: flex !important; }
  .nav-cta { display: none; }
}

.nav-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  color: var(--text-1);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--grad-primary);
  color: var(--bg-1);
  box-shadow: 0 10px 30px -8px rgba(0, 255, 136, 0.5);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px -10px rgba(0, 255, 136, 0.7);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-1);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-primary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: rgba(0, 255, 136, 0.1);
}

.btn-lg {
  padding: 16px 30px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

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

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: rgba(0, 255, 136, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 1px solid var(--border-primary);
}

.card-icon svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.card-icon.blue {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
}
.card-icon.blue svg { color: var(--secondary); }

.card-icon.purple {
  background: rgba(192, 132, 252, 0.1);
  border-color: rgba(192, 132, 252, 0.3);
}
.card-icon.purple svg { color: #c084fc; }

.card-icon.gold {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.3);
}
.card-icon.gold svg { color: var(--gold); }

.card-icon.pink {
  background: rgba(233, 69, 96, 0.1);
  border-color: rgba(233, 69, 96, 0.3);
}
.card-icon.pink svg { color: var(--accent); }

.card h3 {
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.card p {
  color: var(--text-2);
  font-size: 0.95rem;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  padding: 160px 0 100px;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  /* Defensive: orbs are positioned with negative offsets — clip them
     here so they cannot push the page's horizontal scroll on mobile
     even when the parent section doesn't itself set overflow:hidden. */
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
  animation: float 12s ease-in-out infinite;
}

.hero-orb.green {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: 10%;
  left: -100px;
}

.hero-orb.blue {
  width: 600px;
  height: 600px;
  background: var(--secondary);
  bottom: -10%;
  right: -150px;
  animation-delay: -4s;
}

.hero-orb.purple {
  width: 400px;
  height: 400px;
  background: #c084fc;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -8s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-30px, 30px) scale(0.95); }
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 0 auto;
}

.hero h1 {
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--text-2);
  margin-bottom: 36px;
  max-width: 720px;
  margin-inline: auto;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

/* Floating molecule animation */
.molecule {
  position: absolute;
  pointer-events: none;
  opacity: 0.3;
  animation: spin-slow 30s linear infinite;
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

@keyframes pulse-slow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* ============================================
   Stats
   ============================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.stat:hover {
  border-color: var(--border-primary);
  transform: translateY(-4px);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 900;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-label {
  color: var(--text-3);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================
   Industries Grid
   ============================================ */
.industries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.industry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
}

.industry:hover {
  border-color: var(--border-primary);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}

.industry-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

.industry-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-1);
}

.industry-count {
  font-size: 0.8rem;
  color: var(--primary);
  margin-top: 4px;
}

/* ============================================
   How it works steps
   ============================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  position: relative;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  transition: all 0.3s ease;
}

.step:hover {
  border-color: var(--border-primary);
  transform: translateY(-4px);
}

.step-number {
  position: absolute;
  top: -20px;
  inset-inline-start: 24px;
  width: 44px;
  height: 44px;
  background: var(--grad-primary);
  color: var(--bg-1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: 0 8px 20px rgba(0, 255, 136, 0.4);
}

.step h3 {
  margin: 16px 0 10px;
  font-size: 1.2rem;
}

.step p {
  color: var(--text-2);
  font-size: 0.95rem;
}

/* ============================================
   Pricing Cards
   ============================================ */
.pricing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: 999px;
  margin-bottom: 50px;
}

.pricing-toggle button {
  padding: 8px 22px;
  border-radius: 999px;
  color: var(--text-3);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.25s ease;
}

.pricing-toggle button.active {
  background: var(--grad-primary);
  color: var(--bg-1);
}

.save-badge {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-inline-start: 6px;
  font-weight: 800;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.plan {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 26px;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.plan:hover {
  border-color: var(--border-primary);
  transform: translateY(-4px);
}

.plan.popular {
  background: linear-gradient(180deg, rgba(0, 255, 136, 0.08), rgba(0, 212, 255, 0.04));
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-glow);
}

.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--grad-primary);
  color: var(--bg-1);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 12px;
}

.plan-price {
  font-size: 3rem;
  font-weight: 900;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 6px;
}

.plan-price .currency {
  font-size: 1.4rem;
  vertical-align: super;
  margin-inline-end: 4px;
  color: var(--text-3);
}

.plan-period {
  color: var(--text-3);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.plan-features {
  list-style: none;
  margin-bottom: 28px;
  flex: 1;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: var(--text-2);
  font-size: 0.9rem;
}

.plan-features li svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================
   Testimonials
   ============================================ */
.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.testimonial {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.3s ease;
}

.testimonial:hover {
  border-color: var(--border-primary);
}

.testimonial-stars {
  color: var(--gold);
  margin-bottom: 14px;
  font-size: 1.1rem;
}

.testimonial-text {
  color: var(--text-2);
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.8;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--bg-1);
  font-size: 1.2rem;
}

.testimonial-name {
  font-weight: 700;
  color: var(--text-1);
}

.testimonial-role {
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ============================================
   FAQ
   ============================================ */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
}

.faq-item:hover {
  border-color: var(--border-primary);
}

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--text-1);
  width: 100%;
  text-align: start;
  gap: 16px;
}

.faq-q svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item.open .faq-q svg {
  transform: rotate(180deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  color: var(--text-2);
  padding: 0 24px;
  line-height: 1.8;
}

.faq-item.open .faq-a {
  padding: 0 24px 22px;
  max-height: 300px;
}

/* ============================================
   CTA Banner
   ============================================ */
.cta-banner {
  background: var(--grad-primary);
  border-radius: var(--radius-xl);
  padding: 60px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent 50%);
}

.cta-banner h2 {
  color: var(--bg-1);
  margin-bottom: 14px;
  position: relative;
}

.cta-banner p {
  color: rgba(5, 8, 24, 0.7);
  font-size: 1.1rem;
  margin-bottom: 28px;
  position: relative;
}

.cta-banner .btn-primary {
  background: var(--bg-1);
  color: var(--primary);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--bg-2);
  padding: 80px 0 30px;
  border-top: 1px solid var(--border);
  margin-top: 80px;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-brand {
  max-width: 360px;
}

.footer-brand p {
  color: var(--text-3);
  margin-top: 16px;
  font-size: 0.95rem;
  line-height: 1.8;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: all 0.25s ease;
}

.footer-social a:hover {
  background: var(--grad-primary);
  color: var(--bg-1);
  border-color: transparent;
  transform: translateY(-3px);
}

.footer-social svg { width: 18px; height: 18px; }

.footer-col h4 {
  font-size: 1rem;
  margin-bottom: 18px;
  color: var(--text-1);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-3);
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-4);
  font-size: 0.88rem;
}

/* ============================================
   Forms & Auth
   ============================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 60px;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-card);
}

.auth-card h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  text-align: center;
}

.auth-card .auth-sub {
  text-align: center;
  color: var(--text-3);
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-input::placeholder { color: var(--text-4); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-divider {
  text-align: center;
  margin: 22px 0;
  color: var(--text-3);
  font-size: 0.85rem;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-foot {
  text-align: center;
  margin-top: 22px;
  color: var(--text-3);
  font-size: 0.92rem;
}

.auth-foot a {
  color: var(--primary);
  font-weight: 700;
}

/* ============================================
   Search Page
   ============================================ */
.search-bar {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 8px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px 18px;
  color: var(--text-1);
  font-size: 1rem;
  outline: none;
}

.search-input::placeholder { color: var(--text-3); }

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.chip {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-primary);
  color: var(--primary);
}

.chip svg { width: 14px; height: 14px; }

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 28px;
  backdrop-filter: blur(12px);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 14px;
}

.result-title h3 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.result-meta {
  display: flex;
  gap: 16px;
  color: var(--text-3);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.result-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.confidence-badge {
  background: rgba(0, 255, 136, 0.15);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.formula-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.formula-table th,
.formula-table td {
  padding: 12px 14px;
  text-align: start;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.formula-table th {
  color: var(--text-3);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.formula-table td.pct {
  color: var(--primary);
  font-weight: 700;
}

.formula-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* Loader */
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.loading-state .spinner { width: 40px; height: 40px; border-width: 4px; margin-bottom: 18px; }
.loading-state p { color: var(--text-3); }

/* ============================================
   Dashboard
   ============================================ */
.dash-page {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.dash-sidebar {
  background: var(--bg-2);
  border-inline-end: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.dash-main {
  padding: 80px 32px 60px;
}

.dash-nav {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-3);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.dash-nav a:hover {
  background: var(--bg-card);
  color: var(--text-1);
}

.dash-nav a.active {
  background: rgba(0, 255, 136, 0.1);
  color: var(--primary);
}

.dash-nav svg { width: 20px; height: 20px; flex-shrink: 0; }

.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.dash-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
}

.dash-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.dash-stat-icon svg { width: 22px; height: 22px; }

.dash-stat .label {
  color: var(--text-3);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.dash-stat .value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-1);
}

.dash-stat .delta {
  font-size: 0.82rem;
  color: var(--primary);
  margin-top: 4px;
  font-weight: 700;
}

.progress-bar {
  height: 6px;
  background: var(--bg-card-hover);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 999px;
  transition: width 1s ease;
}

/* ============================================
   Compliance
   ============================================ */
.compliance-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.country-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: 600px;
  overflow-y: auto;
}

.country-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.country-item:hover {
  background: var(--bg-card-hover);
}

.country-item.active {
  background: rgba(0, 255, 136, 0.1);
  color: var(--primary);
}

.country-flag {
  font-size: 1.4rem;
}

.compliance-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.compliance-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.comp-stat {
  text-align: center;
  padding: 18px;
  background: var(--bg-glass);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.comp-stat .value {
  font-size: 2.2rem;
  font-weight: 900;
}
.comp-stat .label { color: var(--text-3); font-size: 0.85rem; }

.comp-stat.success { border-color: var(--border-primary); }
.comp-stat.success .value { color: var(--primary); }
.comp-stat.warning { border-color: rgba(255, 215, 0, 0.3); }
.comp-stat.warning .value { color: var(--gold); }
.comp-stat.danger { border-color: rgba(233, 69, 96, 0.3); }
.comp-stat.danger .value { color: var(--accent); }

.standard-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg-glass);
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.standard-item svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex-shrink: 0;
}

.standard-name { font-weight: 700; margin-bottom: 4px; }
.standard-desc { color: var(--text-3); font-size: 0.88rem; }

/* ============================================
   Formula Detail
   ============================================ */
.grade-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.grade-tab {
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.grade-tab:hover {
  border-color: var(--border-primary);
}

.grade-tab.active {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.grade-tab svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
  margin-bottom: 6px;
}

.grade-tab .grade-name { font-weight: 700; }
.grade-tab .grade-desc { color: var(--text-3); font-size: 0.82rem; margin-top: 4px; }

.tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.tab {
  padding: 10px 18px;
  border-radius: 10px;
  color: var(--text-3);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab.active {
  background: var(--grad-primary);
  color: var(--bg-1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Animations & Reveal
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }
.reveal.delay-4 { transition-delay: 0.4s; }

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.glow {
  position: relative;
}

.glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--grad-primary);
  z-index: -1;
  filter: blur(10px);
  opacity: 0.5;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dash-page {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    position: fixed;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s;
    width: 280px;
  }
  [dir="ltr"] .dash-sidebar { transform: translateX(-100%); }
  .dash-sidebar.open {
    transform: translateX(0);
  }
  .dash-main {
    padding: 80px 20px 60px;
  }
  .compliance-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 70px;
    left: 16px;
    right: 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--radius-lg);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    backdrop-filter: blur(20px);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; border-radius: 10px; }
  .nav-links a:hover { background: var(--bg-card); }

  .nav-toggle { display: flex; }
  .nav-cta { display: none; }

  .section { padding: 70px 0; }
  .hero { padding: 130px 0 60px; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .form-row { grid-template-columns: 1fr; }
  .grade-tabs { grid-template-columns: repeat(2, 1fr); }
  .compliance-stats { grid-template-columns: 1fr; }

  .cta-banner { padding: 40px 24px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.2rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .industries { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 30px 24px; }
}

/* ============================================
   Light Theme (toggle) — Dark is DEFAULT
   ============================================ */
[data-theme="light"] {
  --bg-1: #f6f8fc;
  --bg-2: #ffffff;
  --bg-3: #eef2f9;
  --bg-card: rgba(15, 23, 51, 0.04);
  --bg-card-hover: rgba(15, 23, 51, 0.07);
  --bg-glass: rgba(15, 23, 51, 0.04);

  --border: rgba(15, 23, 51, 0.10);
  --border-light: rgba(15, 23, 51, 0.16);
  --border-primary: rgba(0, 180, 110, 0.35);

  --text-1: #0a0e27;
  --text-2: #2c3656;
  --text-3: #5a6486;
  --text-4: #8892b0;

  --shadow-glow: 0 0 60px rgba(0, 180, 110, 0.18);
  --shadow-glow-blue: 0 0 60px rgba(0, 153, 204, 0.18);
  --shadow-card: 0 24px 48px -16px rgba(15, 23, 51, 0.12);

  --grad-hero: radial-gradient(ellipse at top, #e6f7ee 0%, #f6f8fc 50%, #ffffff 100%);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 200, 130, 0.06), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(0, 150, 220, 0.06), transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(150, 100, 240, 0.04), transparent 50%);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(15, 23, 51, 0.08);
}

[data-theme="light"] .footer {
  background: linear-gradient(180deg, transparent, rgba(15, 23, 51, 0.04));
}

[data-theme="light"] ::selection {
  background: var(--primary);
  color: #fff;
}

/* ============================================
   Navbar Tools (theme + language)
   ============================================ */
.nav-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-end: 12px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.icon-btn:hover {
  border-color: var(--border-primary);
  color: var(--primary);
  background: var(--bg-card-hover);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .moon { display: none; }
.theme-toggle .sun { display: inline-block; }
[data-theme="light"] .theme-toggle .moon { display: inline-block; }
[data-theme="light"] .theme-toggle .sun { display: none; }

/* Language dropdown */
.lang-dropdown {
  position: relative;
}

.lang-trigger {
  padding: 0 12px;
  width: auto;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.lang-trigger .flag {
  font-size: 1.05rem;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  width: 240px;
  max-height: 380px;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  display: none;
  z-index: 200;
}

.lang-menu.open { display: block; }

.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-2);
  transition: all 0.15s ease;
}

.lang-item:hover {
  background: var(--bg-card);
  color: var(--text-1);
}

.lang-item.active {
  background: rgba(0, 255, 136, 0.1);
  color: var(--primary);
  font-weight: 700;
}

.lang-item .flag { font-size: 1.15rem; }
.lang-item .code {
  margin-inline-start: auto;
  font-size: 0.72rem;
  font-family: monospace;
  color: var(--text-3);
  text-transform: uppercase;
}

/* ============================================
   Forever Memory Highlight Card
   ============================================ */
.memory-pulse {
  position: relative;
  overflow: hidden;
}

.memory-pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(0, 255, 136, 0.18), transparent 60%);
  pointer-events: none;
}

/* ============================================
   Chat Interface (Forever Memory)
   ============================================ */
.chat-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: calc(100vh - 120px);
  min-height: 560px;
}

.chat-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-sidebar h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  margin: 6px 6px 4px;
}

.chat-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--grad-primary);
  color: var(--bg-1);
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s;
}

.chat-new:hover { transform: translateY(-1px); }
.chat-new svg { width: 16px; height: 16px; }

.chat-history-item {
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chat-history-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-1);
}

.chat-history-item.active {
  background: rgba(0, 255, 136, 0.08);
  color: var(--text-1);
  border-color: var(--border-primary);
}

.chat-history-item .when {
  font-size: 0.72rem;
  color: var(--text-3);
  display: block;
  margin-top: 2px;
}

.memory-banner {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.10), rgba(0, 212, 255, 0.08));
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.6;
  display: flex;
  gap: 10px;
}

.memory-banner svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }

.chat-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header .title { font-weight: 800; }
.chat-header .sub { color: var(--text-3); font-size: 0.82rem; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.msg.ai .avatar {
  background: var(--grad-primary);
  color: var(--bg-1);
}
.msg .bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  line-height: 1.7;
  font-size: 0.94rem;
}
.msg.user .bubble {
  background: rgba(0, 255, 136, 0.08);
  border-color: var(--border-primary);
}

.chat-input-row {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input {
  flex: 1;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-1);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--primary); }

@media (max-width: 768px) {
  .chat-shell { grid-template-columns: 1fr; height: auto; }
  .chat-sidebar { max-height: 260px; }
  .nav-tools { gap: 4px; margin-inline-end: 6px; }
  .lang-menu { width: 220px; }
}

/* ============================================
   Source Tracking Badge
   ============================================ */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 212, 255, 0.10);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary);
}

.eco-badge {
  background: rgba(0, 255, 136, 0.10);
  border-color: var(--border-primary);
  color: var(--primary);
}

/* ============================================
   Mobile language switch (inside hamburger menu)
   Visible only when the navbar collapses into the
   hamburger so language is always discoverable.
   ============================================ */
.mobile-lang { display: none; }
@media (max-width: 1366px) {
  .nav-links .mobile-lang {
    display: list-item; list-style: none;
    margin-top: 8px; padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .nav-links .mobile-lang a {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: 10px;
    color: var(--primary); font-weight: 700;
    border: 1px solid rgba(0,255,136,0.30);
    background: rgba(0,255,136,0.06);
    text-decoration: none;
  }
  .nav-links .mobile-lang a:hover,
  .nav-links .mobile-lang a:active { background: rgba(0,255,136,0.14); }
  .nav-links .mobile-lang .flag { font-size: 1.15rem; }
}
