:root {
  /* Light theme variables */
  --primary: #1a237e;
  --primary-light: #3949ab;
  --text-dark: #1c1c1c;
  --text-light: #666;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border-color: rgba(0, 0, 0, 0.1);
  --card-bg: rgba(0, 0, 0, 0.02);
  --shadow-color: rgba(26,35,126,0.15);
  --header-bg: rgba(255, 255, 255, 0.95);

  /* Spacing */
  --spacing-xl: 120px;
  --spacing-lg: 80px;
  --spacing-md: 40px;
  --spacing-sm: 20px;
  --header-height: 64px;
}

/* Dark theme variables */
[data-theme="dark"] {
  --primary: #3949ab;
  --primary-light: #5c6bc0;
  --text-dark: #e4e4e4;
  --text-light: #a0a0a0;
  --bg-light: #121212;
  --bg-white: #1e1e1e;
  --border-color: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(255, 255, 255, 0.05);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --header-bg: rgba(30, 30, 30, 0.95);
}

/* Theme toggle button */
.theme-toggle {
  --toggle-size: 32px;
  width: var(--toggle-size);
  height: var(--toggle-size);
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: var(--card-bg);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
}

/* Theme-specific styles */
[data-theme="dark"] {
  .topbar {
    background: var(--header-bg);
  }

  .hero-img {
    filter: brightness(0.8);
  }

  .features-section,
  .benefits,
  footer {
    background: var(--bg-white);
  }

  .feature-card,
  .benefit-card {
    background: var(--bg-white);
  }

  .feature-card:hover,
  .benefit-card:hover {
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.4);
  }

  .pricing-card {
    background: var(--bg-white);
  }

  .topbar-btn:not(.testeaza) {
    color: var(--text-dark);
  }
}

/* Base responsive fixes */
html, body {
  width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Mobile text handling */
* {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  box-sizing: border-box;
}

/* Topbar base styles */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.topbar .container {
  height: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
}

/* Button styles */
.topbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  color: var(--text-dark);
}

.topbar-btn.testeaza {
  background: var(--primary-light);
  color: white;
}

.topbar-btn:hover {
  transform: translateY(-1px);
}

.topbar-btn.testeaza:hover {
  filter: brightness(1.1);
}

.hero {
  padding-top: calc(var(--header-height) + var(--spacing-xl));
  margin-top: var(--spacing-lg);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--spacing-lg);
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 56px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 0 0 var(--spacing-sm);
  color: var(--text-dark);
}

.hero-desc {
  font-size: 20px;
  color: var(--text-light);
  margin-bottom: var(--spacing-md);
}

.hero-img {
  width: 100%;
  max-width: 1000px;
  height: auto;
  margin-top: var(--spacing-xl);
  border-radius: 12px;
  box-shadow: 0 20px 40px var(--shadow-color);
}

.cta-btn {
  display: inline-flex;
  padding: 16px 32px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--shadow-color);
  background: var(--primary-light);
}

.pricing-card {
  width: 100%;
  max-width: 300px;
  margin: var(--spacing-md) auto 0;
  padding: var(--spacing-sm);
  background: var(--card-bg);
  border-radius: 12px;
  box-sizing: border-box;
}

.pricing-card .price {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
}

.features-section {
  padding: var(--spacing-xl) 0;
  background: white;
}

.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: var(--spacing-lg);
  color: var(--text-dark);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
}

.feature-card {
  padding: var(--spacing-md);
  border-radius: 12px;
  background: var(--bg-light);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  box-sizing: border-box;
}

.feature-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 22px 44px var(--shadow-color);
}

.feature-img {
  width: 48px;
  height: 48px;
  margin-bottom: var(--spacing-sm);
}

.feature-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.feature-desc {
  color: var(--text-light);
  line-height: 1.6;
}

.trusted {
  padding: var(--spacing-xl) 0;
  text-align: center;
  background: var(--bg-light);
}

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

.trusted-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--text-dark);
}

.trusted-main {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

.benefits {
  padding: var(--spacing-xl) 0;
  background: white;
}

.benefit-card {
  text-align: center;
  padding: var(--spacing-md);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  box-sizing: border-box;
}

.benefit-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 22px 44px var(--shadow-color);
}

.benefit-img {
  width: 40px;
  height: 40px;
  margin-bottom: var(--spacing-sm);
}

.benefit-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.benefit-desc {
  color: var(--text-light);
}

.cta-bottom {
  padding: var(--spacing-xl) 0;
  text-align: center;
  background: var(--bg-light);
}

footer {
  padding: var(--spacing-lg) 0;
  background: white;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
  line-height: 1.5;
}

footer a {
  color: var(--text-light);
  text-decoration: none;
}

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

.footer-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
  max-width: 100%;
  padding: 0 var(--spacing-sm);
  box-sizing: border-box;
}

.footer-badges > div {
  height: 40px;
  display: flex;
  align-items: center;
}

.footer-badges img {
  height: 40px;
  width: auto;
  object-fit: contain;
  max-width: 100%;
}

.footer-badges iframe {
  max-width: 100%;
  height: auto;
}

/* Refined animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Feature cards hover animation */
.hero .fade-in {
  transition-delay: calc(var(--animation-order, 0) * 0.15s);
}

/* Simple fade animation for sections */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  :root {
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
  }

  .hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  .hero-desc {
    font-size: 1.125rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .features-grid,
  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .benefit-card {
    padding: var(--spacing-md);
  }

  .feature-img,
  .benefit-img {
    width: 40px;
    height: 40px;
  }

  section {
    padding: var(--spacing-xl) 0;
  }
}

@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .features-grid,
  .benefits-grid {
    grid-template-columns: 1fr;
  }

  footer .container {
    text-align: center;
  }

  .footer-badges {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 70px;
  }

  .topbar {
    padding: var(--spacing-sm) 0;
    transition: transform 0.3s ease;
  }

  .topbar .container {
    padding: var(--spacing-md) var(--spacing-md);
  }

  .topbar-btn {
    padding: 10px 20px;
    font-size: 0.9375rem;
  }

  /* Mobile scroll behavior */
  .topbar.scrolled {
    transform: translateY(-100%);
  }

  .topbar.scrolled .testeaza {
    position: fixed;
    top: var(--spacing-sm);
    right: var(--spacing-md);
    transform: translateY(0);
    box-shadow: 0 2px 10px var(--shadow-color);
  }

  /* Ensure proper hero spacing */
  .hero {
    padding-top: calc(var(--header-height) + var(--spacing-xl));
  }
}