/* ============================================
   UNVERPAY — DESIGN SYSTEM
   QR-Based Restaurant Payment Ecosystem
   ============================================ */

:root {
  /* Fluid Spacing & Sizing */
  --space-unit: clamp(1rem, 1.2vw, 1.5rem);
  --section-padding: clamp(5rem, 10vw, 8rem);
  
  /* Colors - Deep Premium Palette */
  --bg-primary: #050511;
  --bg-secondary: #0a0a1a;
  --bg-tertiary: #0e0e24;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.15);
  --purple: #8b5cf6;
  --purple-glow: rgba(139, 92, 246, 0.15);
  --emerald: #10b981;
  --gold: #f59e0b;
  
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-accent: rgba(0, 240, 255, 0.2);
  
  --gradient-primary: linear-gradient(135deg, #00f0ff, #8b5cf6);
  --gradient-deep: linear-gradient(180deg, rgba(5,5,17,0) 0%, #050511 100%);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.5);
  
  /* Typography - Fluid Sizing */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --fs-h1: clamp(2.5rem, 6vw, 4.5rem);
  --fs-h2: clamp(2rem, 4vw, 3rem);
  --fs-h3: clamp(1.5rem, 3vw, 2.2rem);
  --fs-body: clamp(0.95rem, 1.1vw, 1.1rem);
  
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  
  --transition: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --glass-glow: radial-gradient(circle at top left, rgba(255,255,255,0.08), transparent 70%);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: var(--fs-body);
  position: relative;
}

body.nav-open {
  overflow: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: -2;
}

body::before {
  top: -18vw;
  right: -12vw;
  background: rgba(0, 240, 255, 0.08);
}

body::after {
  bottom: -18vw;
  left: -12vw;
  background: rgba(139, 92, 246, 0.08);
}

/* === UI UTILITIES === */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 5vw;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.1;
  font-weight: 900;
}

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

/* Glassmorphism 2.0 */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-glow);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: var(--font-heading);
  gap: 12px;
  letter-spacing: -0.02em;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #000;
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 15px 40px rgba(0, 240, 255, 0.4);
  transform: scale(1.03) translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

/* === PREMIUM ANIMATIONS === */
@keyframes reveal {
  from { opacity: 0; transform: translateY(40px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Default state: Visible if JS not ready or animation class not applied */
.reveal {
  opacity: 1;
  transition: 1s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Hidden state: ONLY if JS is ready and we want to animate */
body.js-ready .reveal {
  opacity: 0;
}

body.js-ready .reveal.active {
  animation: reveal 1s forwards;
}

/* Default state for stagger children: Visible */
.stagger > * {
  opacity: 1;
}

/* Hidden state for stagger: ONLY if JS ready */
body.js-ready .stagger > * {
  opacity: 0;
}

body.js-ready .stagger.active > *:nth-child(1) { animation: reveal 0.8s forwards 0.1s; }
body.js-ready .stagger.active > *:nth-child(2) { animation: reveal 0.8s forwards 0.2s; }
body.js-ready .stagger.active > *:nth-child(3) { animation: reveal 0.8s forwards 0.3s; }
body.js-ready .stagger.active > *:nth-child(4) { animation: reveal 0.8s forwards 0.4s; }

.animate-fade-up {
  animation: reveal 1s ease forwards;
}

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

.nav-link {
  position: relative;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav-link:hover {
  color: var(--text-primary) !important;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* === PRELOADER & UTILITIES === */
.preloader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.8s;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* === HEADER & NAVIGATION === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: var(--transition);
  background: transparent;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header .logo {
  font-weight: 900;
  font-size: 1.5rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  text-decoration: none;
}

.header .logo img {
  height: 40px;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: 0.3s;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 10px;
}

/* Multi-Sector Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  min-width: 220px;
  padding: 15px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 15px 40px rgba(0,0,0,0.5);
  z-index: 2000;
}

.dropdown:hover .dropdown-content {
  display: block;
  animation: reveal 0.4s ease forwards;
}

.dropdown-content a {
  color: var(--text-muted);
  padding: 12px 15px;
  text-decoration: none;
  display: block;
  font-size : 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: 0.2s;
}

.dropdown-content a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--cyan);
}

/* === MOBILE NAVIGATION === */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    transition: var(--transition);
    z-index: 1001;
  }
  .nav.active {
    right: 0;
  }
  .menu-toggle {
    display: flex !important;
    z-index: 1002;
  }
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.menu-toggle span {
  width: 30px;
  height: 2px;
  background: #fff;
  transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

/* === CUSTOM INPUT === */
.custom-amount-wrapper {
  margin-top: 15px;
  display: none;
}
.custom-amount-wrapper.active {
  display: block;
}
.custom-amount-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  outline: none;
  transition: var(--transition);
}
/* === PRICING CARDS === */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
.pricing-card {
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  border-radius: 24px;
}
.pricing-card.popular {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.02);
  transform: scale(1.05);
  z-index: 2;
}
.pricing-price {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  margin: 1.5rem 0;
}
.pricing-features {
  text-align: left;
  margin: 2rem 0;
}
.pricing-features li {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

/* === FOOTER === */
.footer {
  background: var(--bg-secondary);
  padding: 5rem 0 2rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 4rem;
}
.footer-title {
  color: #fff;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.footer-links li {
  margin-bottom: 10px;
}
.footer-links a {
  color: var(--text-muted);
  transition: var(--transition);
}
.footer-links a:hover {
  color: var(--cyan);
}

/* === STEP CARDS === */
.step-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 40px;
}
.step-number-circle {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cyan-glow);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border: 1px solid var(--cyan);
}

@media (max-width: 1200px) {
  .container {
    padding: 0 6vw;
  }

  .pricing-card.popular {
    transform: none;
  }
}

/* === HOMEPAGE POLISH === */
.home-hero {
  isolation: isolate;
}

.hero-glow {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: min(68vw, 920px);
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.1) 0%, rgba(139, 92, 246, 0.05) 35%, transparent 72%);
  z-index: -1;
}

.live-stats-pill {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 16px 40px rgba(0, 0, 0, 0.25);
}

.hero-dashboard-wrap {
  margin-top: 4rem;
  position: relative;
}

.hero-dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  text-align: left;
}

.testimonials-grid,
.security-grid {
  display: grid;
  gap: 2rem;
}

.testimonials-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.security-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .hero-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .security-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .hero-dashboard-wrap {
    margin-top: 2rem;
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: clamp(4rem, 12vw, 5.5rem);
  }

  body::before,
  body::after {
    width: 70vw;
    height: 70vw;
    filter: blur(70px);
  }

  .container {
    padding: 0 1.2rem;
  }

  h1 {
    line-height: 1.15;
  }

  .header {
    padding: 1rem 0 !important;
  }

  .header .container {
    gap: 0.8rem;
  }

  .header .logo {
    font-size: 1.15rem !important;
  }

  .header .logo img {
    height: 32px !important;
  }

  .nav {
    align-items: flex-start;
  }

  .nav .btn {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 360px;
    margin-inline: auto;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .live-stats-pill {
    border-radius: 20px !important;
    gap: 16px !important;
    padding: 14px 16px !important;
  }

  .desktop-only {
    display: none;
  }

  .glass-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .step-item {
    padding-left: 56px;
    margin-bottom: 28px;
  }

  .hero-dashboard-grid {
    gap: 1.5rem;
  }

  .hero-dashboard-grid > div:first-child {
    display: none; /* Hide complex desktop feed on small mobile to save space */
  }

  .hero-dashboard-grid > div:last-child {
    max-width: 100%;
  }

  .footer {
    padding-top: 4rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer .container > div[style*='margin-top: 5rem'] {
    margin-top: 2.5rem !important;
    padding-top: 1.2rem !important;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.8rem;
  }

  .split-bar {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    padding: 16px;
  }

  .payment-summary {
    gap: 10px;
  }

  .payment-summary .btn {
    padding-inline: 16px !important;
  }
}

@media (max-width: 560px) {
  .btn {
    padding: 14px 22px;
    font-size: 0.92rem;
  }

  .pricing-card,
  .glass-card[style*='padding: 3rem'],
  .glass-card[style*='padding: 2.5rem'] {
    padding: 1.35rem !important;
  }

  .hero-dashboard-wrap .glass-card {
    padding: 18px !important;
  }

  .hero-dashboard-grid {
    gap: 18px;
  }

  .hero-dashboard-grid > div[style*='display: flex; gap: 15px;'] {
    flex-direction: column;
  }

  .hero-dashboard-grid > div[style*='display: flex; gap: 15px;'] > div {
    width: 100%;
  }

  section[style*='grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));'] {
    grid-template-columns: 1fr !important;
  }
}
