/* ==========================================================================
   RMV CONSULTANCY SERVICES - MASTER DESIGN SYSTEM & BRAND TOKENS
   File Location: /css/design-system.css
   Module: Global Design Tokens, Color Palette, Typography, Floating Actions & Animations
   ========================================================================== */

:root {
  /* Brand Primary Colors Sampled Directly from Official RMV Logo */
  --color-primary-navy: #081B4B;  /* Matching 'R' & 'RMV' logo heading */
  --color-primary-blue: #004BCE;  /* Matching 'M' & 'CONSULTANCY' blue */
  --color-accent-blue: #2563EB;
  --color-accent-cyan: #0284C7;
  --color-bg-light-blue: #F4F8FF;

  /* Brand Premium Gold & Warm Accents Sampled from Logo 'V' Arrow */
  --color-premium-gold: #B88A1A; /* Matching 'V' arrow & 'SERVICES' gold */
  --color-soft-gold: #D4AF37;
  --color-gold-hover: #9E7412;
  --color-gold-light: #FFF8E7;

  /* Neutral Surface & Glassmorphic Backgrounds */
  --color-white: #FFFFFF;
  --color-bg-light: #FFFFFF;
  --color-bg-soft: #F8FAFC;
  --color-border: #E2E8F0;
  --color-border-hover: #CBD5E1;
  --color-surface-glass: rgba(255, 255, 255, 0.85);
  --color-border-glass: rgba(255, 255, 255, 0.4);

  /* Typography Colors */
  --color-text-primary: #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted: #94A3B8;

  /* Status Colors */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;

  /* Typography Font Families */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Font Scale */
  --text-h1: clamp(2.1rem, 4.8vw, 3.6rem);
  --text-h2: clamp(1.65rem, 3.4vw, 2.45rem);
  --text-h3: clamp(1.25rem, 2.4vw, 1.7rem);
  --text-body-lg: 1.125rem;
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-caption: 0.75rem;

  /* Font Weights */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Spacing Scale (Base 4px/8px grid) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border Radius System */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-card: 20px;
  --radius-feature: 24px;
  --radius-full: 9999px;

  /* Soft Elevation & Ambient Glow Shadows */
  --shadow-sm: 0 2px 6px rgba(10, 25, 47, 0.04);
  --shadow-md: 0 8px 20px rgba(10, 25, 47, 0.07);
  --shadow-lg: 0 16px 36px rgba(10, 25, 47, 0.11);
  --shadow-hover: 0 22px 44px rgba(37, 99, 235, 0.18);
  --shadow-gold: 0 8px 24px rgba(217, 119, 6, 0.25);
  --shadow-blue: 0 8px 24px rgba(37, 99, 235, 0.28);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.22);
  --shadow-gold-glow: 0 0 25px rgba(217, 119, 6, 0.28);
  --shadow-float: 0 20px 45px -12px rgba(10, 25, 47, 0.16);

  /* Animation Curves */
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  --ease-natural: cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-Index Hierarchy Layering */
  --z-base: 1;
  --z-sticky: 1000;
  --z-floating: 2100;
  --z-modal: 2500;
  --z-toast: 3000;
}

/* --------------------------------------------------------------------------
   UNIVERSAL ICON STYLING SYSTEM (STRICT BOUNDS)
   -------------------------------------------------------------------------- */
i[data-lucide], svg.lucide {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  max-width: 100%;
  max-height: 100%;
  vertical-align: -0.15em;
  flex-shrink: 0;
  stroke-width: 2;
}

[class^="fa-"], [class*=" fa-"] {
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   REUSABLE BADGES & STATUS INDICATORS
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  line-height: 1;
}

.badge-gold {
  background-color: rgba(197, 160, 89, 0.15);
  color: #8A6D3B;
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.badge-blue {
  background-color: var(--color-bg-light-blue);
  color: var(--color-primary-blue);
  border: 1px solid rgba(29, 78, 216, 0.2);
}

.badge-success {
  background-color: rgba(22, 163, 74, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.badge-warning {
  background-color: rgba(217, 119, 6, 0.1);
  color: var(--color-warning);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-info {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--color-info);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

/* --------------------------------------------------------------------------
   REUSABLE FORM INPUTS & CONTROLS
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--color-primary-navy);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-small);
  color: var(--color-text-primary);
  background-color: var(--color-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--color-primary-blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

/* --------------------------------------------------------------------------
   MODALS & TOASTS
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(11, 37, 69, 0.65);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--color-white);
  border-radius: var(--radius-feature);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  max-width: 520px;
  width: 100%;
  position: relative;
  transform: translateY(20px);
  transition: var(--transition-normal);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--color-error);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--color-primary-navy);
  color: var(--color-white);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
  font-size: var(--text-small);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideUp 0.3s var(--ease-natural);
}

.toast-success {
  border-left: 4px solid var(--color-success);
}

/* --------------------------------------------------------------------------
   FLOATING ACTION BUTTON SYSTEM (WHATSAPP + AI CHATBOT)
   -------------------------------------------------------------------------- */
.floating-actions-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  z-index: var(--z-floating);
}

/* On mobile, shift floating buttons above the bottom nav (68px nav + 12px gap) */
@media (max-width: 767px) {
  .floating-actions-container {
    bottom: 5.5rem; /* clears the 68px bottom nav + extra breathing room */
    right: 1rem;
    flex-direction: column;
    gap: 0.7rem;
  }

  .btn-floating {
    width: 48px;
    height: 48px;
  }

  /* AI chatbot panel full-width on mobile */
  .ai-chatbot-panel {
    bottom: 5.5rem;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-width: 100%;
    height: 60vh;
    max-height: 480px;
  }

  /* Toast on mobile: bottom respects bottom nav */
  .toast {
    bottom: 5.5rem;
    right: 1rem;
    left: 1rem;
    max-width: calc(100vw - 2rem);
  }

  /* Floating button tooltip: show above the button on mobile */
  .btn-floating[title]:hover::after {
    right: auto;
    left: 50%;
    bottom: 56px;
    top: auto;
    transform: translateX(-50%);
  }
}

.btn-floating {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-floating:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.btn-floating-whatsapp {
  background: #25D366;
}

.btn-floating-chatbot {
  background: linear-gradient(135deg, var(--color-primary-navy) 0%, var(--color-primary-blue) 100%);
  border: 1.5px solid var(--color-premium-gold);
}

/* AI Chatbot Floating Panel */
.ai-chatbot-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 360px;
  max-width: calc(100vw - 3rem);
  height: 480px;
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 40px rgba(11, 37, 69, 0.22);
  border: 1px solid var(--color-border);
  z-index: var(--z-floating);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s var(--ease-natural), transform 0.3s var(--ease-natural), visibility 0.3s;
}

.ai-chatbot-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ai-chatbot-header {
  background: var(--color-primary-navy);
  color: #FFFFFF;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-chatbot-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--color-bg-soft);
}

.ai-msg-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: var(--text-small);
  line-height: 1.45;
}

.ai-msg-bot {
  background: var(--color-white);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  align-self: flex-start;
}

.ai-msg-user {
  background: var(--color-primary-blue);
  color: #FFFFFF;
  align-self: flex-end;
}

.ai-chatbot-footer {
  padding: 0.75rem;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   SCROLL REVEAL ANIMATIONS
   -------------------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-natural), transform 0.6s var(--ease-natural);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
}

/* WhatsApp Pulse Animation */
.rmv-wa-pulse {
  animation: waButtonPulse 2.5s ease-in-out infinite;
}

@keyframes waButtonPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(37,211,102,0.35); }
  50% { box-shadow: 0 8px 30px rgba(37,211,102,0.6), 0 0 0 8px rgba(37,211,102,0.1); }
}

.rmv-wa-pulse:hover {
  animation: none;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 12px 28px rgba(37,211,102,0.5) !important;
}

/* Hero Section Entrance Animations */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes heroVisualFade {
  from { opacity: 0; transform: translateX(28px) scale(0.97); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

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

.hero-anim-badge  { animation: heroFadeUp 0.6s 0.1s both ease-out; }
.hero-anim-title  { animation: heroFadeUp 0.7s 0.25s both ease-out; }
.hero-anim-sub    { animation: heroFadeUp 0.65s 0.4s both ease-out; }
.hero-anim-cta    { animation: heroFadeUp 0.6s 0.55s both ease-out; }
.hero-anim-trust  { animation: heroFadeUp 0.6s 0.7s both ease-out; }
.hero-anim-visual { animation: heroVisualFade 0.8s 0.3s both ease-out; }

.hero-visual-wrapper .hero-visual img {
  animation: heroFloat 5s ease-in-out infinite;
  animation-delay: 1.2s;
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  .rmv-wa-pulse, .hero-anim-badge, .hero-anim-title, .hero-anim-sub,
  .hero-anim-cta, .hero-anim-trust, .hero-anim-visual,
  .hero-visual-wrapper .hero-visual img, .reveal-on-scroll {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Floating Button Tooltip */
.btn-floating[title]:hover::after {
  content: attr(title);
  position: absolute;
  right: 64px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-primary-navy);
  color: #fff;
  white-space: nowrap;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 500;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.btn-floating {
  position: relative;
}

/* ── STRICT DESKTOP ISOLATION ── */
@media (min-width: 769px) {
  .mobile-app-shell,
  .mockup-bottom-nav,
  .mockup-pwa-pill-banner,
  #pwa-install-banner {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
  }
}

