/* ========================================
   Narweek OTP Gateway - Design System
   ======================================== */

/* --- CSS Variables --- */
:root {
  --whatsapp-green: #25D366;
  --whatsapp-dark: #075E54;
  --bg-dark: #071A18;
  --bg-card: #0D2B27;
  --bg-card-hover: #0F332E;
  --bg-surface: #0A221F;
  --bg-input: #071A18;
  --border-color: #1A3D37;
  --border-light: #254B44;
  --text-primary: #FFFFFF;
  --text-secondary: #A0B4B0;
  --text-muted: #6B8A83;
  --accent: #25D366;
  --accent-hover: #1DB854;
  --accent-glow: rgba(37, 211, 102, 0.15);
  --gradient-primary: linear-gradient(135deg, #075E54, #071A18);
  --gradient-accent: linear-gradient(135deg, #25D366, #075E54);
  --gradient-hero: linear-gradient(160deg, #071A18 0%, #0D2B27 40%, #075E54 100%);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(37, 211, 102, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 64px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
}

.gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   LANDING PAGE STYLES
   ======================================== */

/* --- Landing Navbar --- */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7, 26, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(37, 211, 102, 0.08);
  transition: var(--transition);
}

.landing-nav.scrolled {
  padding: 12px 40px;
  background: rgba(7, 26, 24, 0.95);
  box-shadow: 0 1px 30px rgba(0, 0, 0, 0.3);
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
}

.landing-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
}

.landing-logo span:last-child {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 14px;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.landing-nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.landing-nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}
.landing-nav-links a:hover {
  color: var(--text-primary);
}
.landing-nav-links a:hover::after {
  width: 100%;
}

.landing-nav-buttons {
  display: flex;
  align-items: center;
 gap: 12px;
}

/* --- Hero Section --- */
.hero {
  padding: 140px 40px 80px;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37, 211, 102, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(7, 94, 84, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 560px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: heroPulse 2s infinite;
}

@keyframes heroPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero-title .highlight {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 480px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Hero Phone Mockup --- */
.hero-mockup {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 550px;
}

.phone-mockup {
  width: 320px;
  background: #0D2B27;
  border-radius: 40px;
  padding: 12px;
  border: 1px solid rgba(37, 211, 102, 0.15);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(37, 211, 102, 0.05);
  position: relative;
  z-index: 2;
}

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 24px;
  background: #0D2B27;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.phone-screen {
  background: #0A221F;
  border-radius: 30px;
  overflow: hidden;
  padding: 16px;
  min-height: 580px;
  position: relative;
}

.phone-status-bar {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px 16px;
  font-size: 11px;
  color: var(--text-secondary);
}

.phone-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.phone-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.phone-chat-info {
  flex: 1;
}
.phone-chat-info .name {
  font-size: 14px;
  font-weight: 600;
}
.phone-chat-info .status {
  font-size: 11px;
  color: var(--accent);
}

.phone-chat-time {
  font-size: 11px;
  color: var(--text-muted);
}

.phone-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
  animation: msgIn 0.4s ease-out;
}

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

.phone-message.received {
  background: #0D2B27;
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
  margin-right: auto;
}

.phone-message.sent {
  background: var(--whatsapp-dark);
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.phone-message .msg-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.phone-message .msg-otp {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
  padding: 8px 0;
  color: var(--accent);
}

.phone-message .msg-text {
  color: var(--text-secondary);
  font-size: 12px;
}

.phone-message .msg-time {
  text-align: right;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.phone-input-bar {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
}

.phone-input-bar .field {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  font-size: 13px;
  color: var(--text-primary);
}

.phone-input-bar .send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--bg-dark);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.phone-input-bar .send-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

/* --- Section Styles --- */
.section {
  padding: 100px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.section-header p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-glow);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.feature-card:hover .feature-icon {
  background: rgba(37, 211, 102, 0.2);
  transform: scale(1.1);
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- How It Works --- */
.how-it-works {
  background: var(--bg-surface);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--whatsapp-dark), transparent);
  z-index: 0;
}

.step-card {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  transition: var(--transition);
}

.step-card:hover .step-number {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 30px rgba(37, 211, 102, 0.2);
}

.step-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Pricing --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: start;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  transition: var(--transition);
  position: relative;
}

.pricing-card.featured {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: scale(1.05);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.pricing-card.featured::before {
  content: 'Popular';
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  background: var(--gradient-accent);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

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

.pricing-card.featured:hover {
  transform: scale(1.05) translateY(-4px);
}

.pricing-name {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 4px;
}

.pricing-price .currency {
  font-size: 20px;
  color: var(--text-muted);
}

.pricing-period {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.pricing-messages {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.pricing-features {
  list-style: none;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-features li {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
}

/* --- Trust Note --- */
.trust-section {
  padding: 60px 40px;
  text-align: center;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}

.trust-content {
  max-width: 700px;
  margin: 0 auto;
}

.trust-content .icon {
  font-size: 40px;
  margin-bottom: 16px;
  display: block;
}

.trust-content h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.trust-content p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Landing Footer --- */
.landing-footer {
  padding: 40px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
  transform: translateY(-1px);
  color: white;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-light);
  color: var(--text-primary);
}

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

.btn-success {
  background: #22c55e;
  color: white;
}
.btn-success:hover { background: #16a34a; }

.btn-danger {
  background: #ef4444;
  color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn-warning {
  background: #eab308;
  color: #0f172a;
}
.btn-warning:hover { background: #d1a306; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 6px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-family);
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

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

.form-input.error {
  border-color: #ef4444;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

/* --- Phone Input --- */
.phone-input-wrapper {
  display: flex;
  align-items: stretch;
}

.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.phone-input-wrapper .form-input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-success {
  background: rgba(37, 211, 102, 0.12);
  color: #4ade80;
  border: 1px solid rgba(37, 211, 102, 0.2);
}
.badge-success .dot { background: #4ade80; box-shadow: 0 0 6px #4ade80; }

.badge-warning {
  background: rgba(234, 179, 8, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.2);
}
.badge-warning .dot { background: #fbbf24; animation: pulse 1.5s infinite; }

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.badge-danger .dot { background: #f87171; }

.badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.badge-info .dot { background: #60a5fa; }

.badge-neutral {
  background: rgba(160, 180, 176, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-light);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px 24px;
}

.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* --- Stats Card --- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-accent);
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.stat-card .stat-change {
  font-size: 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card .stat-change.up { color: #4ade80; }
.stat-card .stat-change.down { color: #f87171; }

/* ========================================
   TABLES
   ======================================== */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(26, 61, 55, 0.5);
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ========================================
   SIDEBAR
   ======================================== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  min-height: var(--topbar-height);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.sidebar-brand {
  font-size: 18px;
  font-weight: 800;
  flex: 1;
}

.sidebar-brand small {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 16px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
}

/* ========================================
   TOPBAR
   ======================================== */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
}

.topbar-search {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  gap: 8px;
}

.topbar-search input {
  background: none;
  border: none;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-primary);
  width: 200px;
  outline: none;
}

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

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.topbar-user:hover {
  background: rgba(255, 255, 255, 0.05);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
}

.topbar-user-info {
  line-height: 1.3;
}
.topbar-user-info .name {
  font-size: 13px;
  font-weight: 600;
}
.topbar-user-info .role {
  font-size: 11px;
  color: var(--text-muted);
}

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background: var(--bg-dark);
}

.page-content {
  padding: 24px;
}

/* ========================================
   TOASTS
   ======================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.3s ease-out;
  min-width: 280px;
  max-width: 420px;
}

.toast.success {
  background: #0D2B27;
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: #4ade80;
}

.toast.error {
  background: #2B0D0D;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.toast.warning {
  background: #2B2A0D;
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #fbbf24;
}

.toast.info {
  background: #0D1B2B;
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.toast-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.5;
  font-size: 16px;
  background: none;
  border: none;
  color: inherit;
}

.toast-close:hover { opacity: 1; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.removing {
  animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ========================================
   LOADING
   ======================================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }

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

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ========================================
   TABLES (Data styling)
   ======================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  background: var(--bg-surface);
}

.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(26, 61, 55, 0.3);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h4 {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
}

/* ========================================
   CODE BLOCK
   ======================================== */
.code-block {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}

.code-block-header .lang {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-block-body {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.code-block-body .code-comment { color: var(--text-muted); font-style: italic; }
.code-block-body .code-keyword { color: #60a5fa; }
.code-block-body .code-string { color: #4ade80; }
.code-block-body .code-variable { color: #fbbf24; }

/* ========================================
   TAB PANELS
   ======================================== */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-family);
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* ========================================
   AUTH PAGES
   ======================================== */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37, 211, 102, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.auth-left-content {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.auth-left-content .brand {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-left-content h2 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.auth-left-content p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.auth-features {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-feature .check {
  width: 24px;
  height: 24px;
  background: var(--accent-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 12px;
  flex-shrink: 0;
}

.auth-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  background: var(--bg-dark);
}

.auth-form-container {
  width: 100%;
  max-width: 400px;
}

.auth-form-container .auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-form-container .auth-logo .brand {
  font-size: 24px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-form-container h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.auth-form-container .auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.auth-form-container .auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-form-container .auth-switch a {
  font-weight: 600;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-6 { grid-template-columns: repeat(6, 1fr); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

/* ========================================
   LOGS
   ======================================== */
.logs-box {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  max-height: 350px;
  overflow-y: auto;
}

.log-entry {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(26, 61, 55, 0.3);
  color: var(--text-muted);
  transition: var(--transition);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry.success {
  color: #4ade80;
}

.log-entry.failed {
  color: #f87171;
}

.log-entry .log-time {
  color: var(--text-muted);
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.alert-warning {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.2);
  color: #fbbf24;
}

.alert-success {
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.2);
  color: #4ade80;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* ========================================
   DROPDOWN
   ======================================== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.dropdown-menu.show {
  display: block;
  animation: dropdownIn 0.15s ease-out;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-family);
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.dropdown-item.danger {
  color: #f87171;
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ========================================
   API KEY DISPLAY
   ======================================== */
.api-key-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

.api-key-display .key {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-display .actions {
  display: flex;
  gap: 4px;
}

/* ========================================
   PAYMENT STATUS
   ======================================== */
.payment-pending .status { color: #fbbf24; }
.payment-approved .status { color: #4ade80; }
.payment-rejected .status { color: #f87171; }

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* ========================================
   TOGGLE SWITCH
   ======================================== */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-color);
  border-radius: 24px;
  transition: var(--transition);
}

.toggle .slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked + .slider {
  background: var(--accent);
}

.toggle input:checked + .slider::before {
  transform: translateX(20px);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .pricing-card.featured { transform: none; }
  .pricing-card.featured:hover { transform: translateY(-4px); }
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-content { max-width: 100%; }
  .hero-desc { margin: 0 auto 32px; }
  .hero-buttons { justify-content: center; }
  .hero-mockup { order: -1; min-height: 400px; }
  .phone-mockup { width: 280px; }
  .hero-title { font-size: 40px; }
  .section { padding: 60px 24px; }
  .section-header h2 { font-size: 30px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid::before { display: none; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .landing-nav { padding: 12px 20px; }
  .landing-nav-links { display: none; }
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .sidebar-brand,
  .sidebar .nav-item span:not(.nav-icon),
  .sidebar .sidebar-label,
  .sidebar .nav-badge { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 10px; }
  .sidebar .sidebar-header { justify-content: center; }
  .sidebar .sidebar-logo { margin: 0; }
  .sidebar .sidebar-footer { display: none; }
  .main-content { margin-left: var(--sidebar-collapsed); }
  .topbar-title { font-size: 15px; }
  .topbar-search { display: none; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .cols-2, .cols-3, .cols-4, .cols-6 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 28px; }
  .hero-desc { font-size: 15px; }
  .hero { padding: 100px 16px 60px; }
  .hero-mockup { min-height: 350px; }
  .section { padding: 40px 16px; }
  .section-header h2 { font-size: 24px; }
  .section-header p { font-size: 14px; }
  .features-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 22px; }
  .card-body { padding: 16px; }
  .page-content { padding: 12px; }
  .landing-nav { padding: 10px 16px; }
  .landing-logo { font-size: 18px; }
  .landing-nav-buttons .btn { font-size: 12px; padding: 8px 14px; }
  .toast { min-width: auto; max-width: calc(100vw - 40px); }
  .auth-right { padding: 40px 24px; }
}

/* ========================================
   RTL SUPPORT
   ======================================== */

/* --- Layout --- */
[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border-color);
}
[dir="rtl"] .sidebar-header {
  border-bottom: 1px solid var(--border-color);
}
[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}
[dir="rtl"] .nav-item .nav-badge {
  margin-left: 0;
  margin-right: auto;
}
[dir="rtl"] .nav-item {
  text-align: right;
}

/* --- Topbar --- */
[dir="rtl"] .topbar-search input { text-align: right; }
[dir="rtl"] .topbar-right { margin-right: auto; margin-left: 0; }

/* --- Tables --- */
[dir="rtl"] .data-table thead th { text-align: right; }
[dir="rtl"] .data-table tbody td { text-align: right; }

/* --- Stats --- */
[dir="rtl"] .stat-card::before { left: auto; right: 0; }

/* --- Forms --- */
[dir="rtl"] .phone-prefix {
  border-right: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
[dir="rtl"] .phone-input-wrapper .form-input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* --- Toasts --- */
[dir="rtl"] .toast-container { right: auto; left: 20px; }
[dir="rtl"] .toast-close { margin-left: 0; margin-right: auto; }

/* --- Pricing --- */
[dir="rtl"] .pricing-card.featured::before { right: auto; left: 16px; }
[dir="rtl"] .pricing-features li { text-align: right; }

/* --- Landing Nav --- */
[dir="rtl"] .landing-nav-links { margin-right: auto; margin-left: 0; }
[dir="rtl"] .landing-nav-links a::after { left: auto; right: 0; }
[dir="rtl"] .landing-nav-buttons { margin-right: 0; margin-left: 0; }

/* --- Hero --- */
[dir="rtl"] .hero::before { right: auto; left: -20%; }
[dir="rtl"] .hero::after { left: auto; right: -10%; }
[dir="rtl"] .hero-content { text-align: right; }
[dir="rtl"] .hero-desc { margin-left: 0; }
[dir="rtl"] .hero-buttons { justify-content: flex-start; }

/* --- Steps --- */
[dir="rtl"] .steps-grid::before { background: linear-gradient(270deg, var(--accent), var(--whatsapp-dark), transparent); }

/* --- Auth --- */
[dir="rtl"] .auth-left::before { right: auto; left: -20%; }
[dir="rtl"] .auth-left { text-align: right; }

/* --- Dropdown --- */
[dir="rtl"] .dropdown-menu { right: auto; left: 0; }
[dir="rtl"] .dropdown-item { text-align: right; }

/* --- Code Block --- */
[dir="rtl"] .code-block-body { direction: ltr; text-align: left; }

/* --- Empty State --- */
[dir="rtl"] .empty-state { text-align: center; }

/* --- Cards --- */
[dir="rtl"] .card-header { text-align: right; }
[dir="rtl"] .card-body { text-align: right; }

/* --- Sections --- */
[dir="rtl"] .section-header { text-align: center; }
[dir="rtl"] .section-header p { text-align: center; }

/* --- Feature Cards --- */
[dir="rtl"] .feature-card { text-align: right; }

/* --- Step Cards --- */
[dir="rtl"] .step-card { text-align: center; }

/* --- API Key --- */
[dir="rtl"] .api-key-display { direction: ltr; text-align: left; }

/* --- Modal --- */
[dir="rtl"] .modal { text-align: right; }
[dir="rtl"] .modal-header { text-align: right; }
[dir="rtl"] .modal-footer { justify-content: flex-start; }

/* --- Trust Note --- */
[dir="rtl"] .trust-content { text-align: center; }

/* --- Landing Footer --- */
[dir="rtl"] .landing-footer { text-align: center; }

@media (max-width: 992px) {
  [dir="rtl"] .main-content { margin-right: var(--sidebar-collapsed); margin-left: 0; }
  [dir="rtl"] .hero-buttons { justify-content: center; }
}

@media (max-width: 600px) {
  [dir="rtl"] .sidebar { width: var(--sidebar-collapsed); }
}

/* ========================================
   LANGUAGE TOGGLE
   ======================================== */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-family);
}

.lang-toggle:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
  background: var(--bg-card);
}

.lang-toggle .lang-icon {
  font-size: 14px;
}

/* ========================================
   HERO ANIMATIONS
   ======================================== */

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(37, 211, 102, 0.12) 0%, rgba(7, 94, 84, 0.05) 40%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
}

.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  box-shadow: 0 0 6px var(--accent), 0 0 12px rgba(37, 211, 102, 0.2);
}

@keyframes particleFloat {
  0% { opacity: 0; transform: translateY(0) scale(0); }
  15% { opacity: 0.6; transform: translateY(0) scale(1); }
  85% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-100px) scale(0); }
}

.floating-card {
  position: absolute;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(13, 43, 39, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(37, 211, 102, 0.15);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(37, 211, 102, 0.05);
  white-space: nowrap;
  pointer-events: none;
  transform-origin: center center;
}

.card-1 { top: calc(50% - 75px); left: calc(50% - 140px); animation: cardFloatLeft 3s ease-in-out infinite; animation-delay: calc(var(--i, 1) * 0.2s); }
.card-2 { top: calc(50% - 65px); left: calc(50% + 140px); animation: cardFloatRight 3s ease-in-out infinite; animation-delay: calc(var(--i, 1) * 0.2s); }
.card-3 { top: calc(50% + 75px); left: calc(50% - 120px); animation: cardFloatLeft 3s ease-in-out infinite; animation-delay: calc(var(--i, 1) * 0.2s); }
.card-4 { top: calc(50% + 85px); left: calc(50% + 120px); animation: cardFloatRight 3s ease-in-out infinite; animation-delay: calc(var(--i, 1) * 0.2s); }

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

@keyframes cardFloatRight {
  0%, 100% { transform: translateX(-100%) translateY(0); }
  50% { transform: translateX(-100%) translateY(-10px); }
}

.fc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.fc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fc-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.fc-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.5px;
}

.msg-otp.swap {
  animation: otpSwap 0.3s ease-out;
}

@keyframes otpSwap {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

.phone-chat-info .status.online::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 6px;
  animation: heroPulse 2s infinite;
  vertical-align: middle;
}

[dir="rtl"] .phone-chat-info .status.online::before {
  margin-left: 0;
  margin-right: 6px;
}

/* ========================================
   TRUST BAR
   ======================================== */

.trust-bar {
  padding: 36px 40px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.trust-bar-grid {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 48px;
}

.trust-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.trust-lbl {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.trust-bar-divider {
  width: 1px;
  height: 40px;
  background: var(--border-color);
  flex-shrink: 0;
}

/* --- Trust Bar Responsive --- */
@media (max-width: 768px) {
  .trust-bar { padding: 24px 20px; }
  .trust-bar-item { padding: 0 24px; }
  .trust-val { font-size: 16px; }
  .trust-lbl { font-size: 10px; }
}

@media (max-width: 600px) {
  .trust-bar-item { padding: 0 12px; }
  .trust-val { font-size: 14px; }
  .trust-lbl { font-size: 9px; }
  .trust-bar-divider { height: 30px; }
  .trust-bar-grid { gap: 0; }
}

/* --- Floating Cards Responsive --- */
@media (max-width: 992px) {
  .card-1 { top: calc(50% - 55px); left: calc(50% - 90px); }
  .card-2 { top: calc(50% - 45px); left: calc(50% + 90px); }
  .card-3 { top: calc(50% + 60px); left: calc(50% - 80px); }
  .card-4 { top: calc(50% + 70px); left: calc(50% + 80px); }
  .floating-card { padding: 8px 12px; gap: 8px; }
  .fc-icon { width: 28px; height: 28px; font-size: 12px; }
  .fc-value { font-size: 11px; }
  .hero-glow { width: 300px; height: 300px; }
}

@media (max-width: 600px) {
  .floating-card { display: none; }
  .hero-glow { width: 240px; height: 240px; }
  .particles { display: none; }
}

/* ========================================
   ARABIC FONT
   ======================================== */
[lang="ar"] {
  font-family: 'Inter', 'Tajawal', 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
}
