/* =========================
   RESET & GLOBAL
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden; /* CRITICAL: prevents mobile zoom/slide */
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1f2937;
  background: #f6f7ff;
  -webkit-tap-highlight-color: transparent;
}

/* Remove mobile tap flash everywhere */
button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* =========================
   BACKGROUND DEPTH
========================= */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 500px at top center, #e8e9ff 0%, transparent 60%),
    linear-gradient(180deg, #f6f7ff 0%, #f2f3fb 100%);
}

/* =========================
   NAVBAR
========================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate; /* FIX: stacking bugs on mobile */

  height: 72px;
  padding: 0 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: linear-gradient(135deg, #5b5df0, #6c6ff5);
  box-shadow: 0 12px 35px rgba(91,93,240,0.35);
}

.logo {
  font-weight: 900;
  font-size: 20px;
  color: #ffffff;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-link {
  text-decoration: none;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  padding: 10px 16px;
  border-radius: 999px;
}

.nav-link:hover {
  background: rgba(255,255,255,0.18);
}

.nav-link.primary {
  background: #ffffff;
  color: #5b5df0;
  font-weight: 700;
}

/* Hamburger */
.menu-btn {
  display: none;
  font-size: 22px;
  background: rgba(255,255,255,0.18);
  border: none;
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}

/* =========================
   OVERLAY
========================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 900;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw); /* FIX: mobile scaling */
  height: 100%;
  z-index: 1000;

  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f7ff 100%);
  box-shadow: -30px 0 60px rgba(0,0,0,0.22);

  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}

.sidebar.open {
  transform: translateX(0);
}

/* Sidebar header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #5b5df0, #6c6ff5);
  color: #ffffff;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-title {
  font-weight: 800;
  font-size: 16px;
}

.sidebar .close {
  font-size: 24px;
  cursor: pointer;
}

/* Sidebar links */
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  color: #1f2937;
  border-radius: 16px;
}

.sidebar-link:hover {
  background: #eef0ff;
  transform: translateX(4px);
}

.sidebar-footer {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

/* =========================
   LAYOUT
========================= */
.container {
  max-width: 960px;
  margin: 72px auto;
  padding: 20px;
}

.card {
  background: white;
  padding: 40px;
  border-radius: 26px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.12);
}

/* =========================
   HERO
========================= */
.hero h1 {
  font-size: 40px;
  margin-bottom: 16px;
}

.hero p {
  font-size: 18px;
  color: #6b7280;
}

.hero .cta {
  display: inline-block;
  margin-top: 28px;
  padding: 16px 32px;
  background: linear-gradient(135deg, #5b5df0, #6c6ff5);
  color: white;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(91,93,240,0.45);
}

/* =========================
   FORMS
========================= */
label {
  display: block;
  margin-top: 18px;
  font-weight: 700;
}

input, textarea, select {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #dcdcdc;
  font-size: 15px;
}

button.primary {
  width: 100%;
  margin-top: 26px;
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #5b5df0, #6c6ff5);
  color: white;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

/* =========================
   RESULT & ADS
========================= */
.result {
  margin-top: 22px;
  background: #eef0ff;
  padding: 22px;
  border-radius: 16px;
  animation: resultPop 0.35s ease-out;
}

.ad-box {
  background: #eef0ff;
  padding: 18px;
  margin: 40px 0;
  border-radius: 16px;
  text-align: center;
  font-size: 14px;
}

/* =========================
   ANIMATIONS
========================= */
@keyframes resultPop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {
  .nav-link {
    display: none;
  }

  .menu-btn {
    display: block;
  }

  .hero h1 {
    font-size: 32px;
  }
}
