:root {
  --bg: #0a0e14;
  --bg-alt: #0f1620;
  --surface: #131b26;
  --surface-2: #182333;
  --border: #223046;
  --text: #e8edf5;
  --text-dim: #9aa8bd;
  --violet: #8b5cf6;
  --violet-dark: #6d28d9;
  --violet-contrast: #ffffff;
  --radius: 14px;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.2rem); }
h2 { font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem); }
p { color: var(--text-dim); margin: 0 0 1em; }
a { color: inherit; }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Background circuit texture */
.circuit-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(139,92,246,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10,14,20,0.75);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}
.logo-mark-img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
}

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { text-decoration: none; color: var(--text-dim); font-weight: 500; font-size: 0.95rem; transition: color .15s; }
.main-nav a:hover { color: var(--text); }
.nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: var(--violet-contrast) !important;
  font-weight: 600;
}
.nav-cta:hover { color: var(--violet-contrast) !important; opacity: .9; }

.lang-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  cursor: pointer;
}

/* Ajustes básicos para idiomas RTL (ej. urdu) */
html[dir="rtl"] .header-inner,
html[dir="rtl"] .hero-actions,
html[dir="rtl"] .cta-final-actions,
html[dir="rtl"] .footer-social {
  direction: rtl;
}
html[dir="rtl"] .hero-inner { direction: rtl; }
html[dir="rtl"] .site-footer { direction: rtl; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); display: block; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: var(--violet-contrast);
  box-shadow: 0 8px 24px -8px rgba(109,40,217,0.55);
}
.btn-primary:hover { box-shadow: 0 10px 28px -6px rgba(109,40,217,0.7); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); }

.playstore-badge { display: inline-flex; line-height: 0; border-radius: var(--radius); overflow: hidden; }
.playstore-badge-img { height: 54px; width: auto; display: block; }

/* Hero */
.hero { padding: 80px 0 60px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.eyebrow {
  font-family: var(--font-mono);
  color: var(--violet);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}
.hero-desc { font-size: 1.08rem; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 24px 0 10px; }
.hero-note { font-size: 0.85rem; color: var(--text-dim); font-family: var(--font-mono); }

.hero-visual { position: relative; display: flex; justify-content: center; }
.phone {
  width: 288px;
  height: 480px;
  background: #060a10;
  border: 6px solid #1b2635;
  border-radius: 34px;
  padding: 14px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  position: relative;
  z-index: 1;
}
.phone-screen { width: 100%; height: 100%; border-radius: 20px; overflow: hidden; }
.phone-screenshot { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.glow {
  position: absolute;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(139,92,246,0.3), transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  filter: blur(10px);
}

/* Features */
.features { padding: 70px 0; }
.features h2 { text-align: center; margin-bottom: 40px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color .15s, transform .15s;
}
.feature-card:hover { border-color: var(--violet); transform: translateY(-3px); }
.feature-icon { font-size: 1.8rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { margin: 0; font-size: 0.94rem; }

/* Forum */
.forum { padding: 70px 0; background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.forum-inner { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 40px; align-items: center; }
.forum-text p { max-width: 50ch; }
.forum-hint { min-height: 1.4em; color: var(--violet); font-size: 0.9rem; font-family: var(--font-mono); margin-top: 12px; }
.forum-visual {
  font-size: 5rem;
  text-align: center;
  opacity: 0.85;
  filter: drop-shadow(0 0 30px rgba(139,92,246,0.4));
}

/* Chatbot */
.chatbot-section { padding: 70px 0 90px; }
.chatbot-intro { text-align: center; max-width: 50ch; margin: 0 auto 32px; }
.chat-widget {
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 460px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.5);
}
.chat-header {
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}
.chat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 8px var(--violet);
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.4;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: var(--violet-contrast);
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.chat-form {
  display: flex;
  border-top: 1px solid var(--border);
}
.chat-form input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.chat-form input:focus { outline: none; }
.chat-form button {
  background: none;
  border: none;
  color: var(--violet);
  font-size: 1.2rem;
  padding: 0 20px;
  cursor: pointer;
}
.chat-form button:hover { color: var(--violet-dark); }

/* Final CTA */
.cta-final { padding: 80px 0 100px; text-align: center; }
.cta-final-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: center; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}
.footer-sep { margin: 0 8px; opacity: .5; }
.footer-social {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
  text-decoration: none;
}
.footer-social:hover { color: var(--text); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--violet);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 860px) {
  .main-nav { position: fixed; top: 68px; left: 0; right: 0; background: var(--bg-alt); border-bottom: 1px solid var(--border); flex-direction: column; padding: 16px 24px; gap: 16px; transform: translateY(-150%); transition: transform .2s ease; }
  .main-nav.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .hero-inner, .forum-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .phone { width: 243px; height: 400px; }
  .forum-text p { margin-left: auto; margin-right: auto; }
}
