/* GLOBAL FONT RESTORE */

:root {
  --font-main: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}


:root {
  --bg: #f7fafc;
  --surface: #ffffff;
  --text: #0f1724;
  --muted: #6b7280;
  --brand: #0f6ef4;
  --accent: #00b894;
  --glass: rgba(255, 255, 255, 0.6);
  --radius: 14px;
  --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --max-w: 1200px;

  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ✅ GLOBAL FONT APPLY */
body,
button,
input,
select,
textarea {
  font-family: var(--font-main);
}

/* Dark theme */
html.dark {
  --bg: #03060a;
  --surface: #071021;
  --text: #e6eef8;
  --muted: #9aa9bf;
  --glass: rgba(5, 9, 16, 0.5);
  --card-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: linear-gradient(
    180deg,
    var(--bg),
    color-mix(in srgb, var(--bg) 85%, #ffffff 15%)
  );
  color: var(--text);
  line-height: 1.5;
}

/* Global container */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px;
}

/* --------------------------------
   HEADER / NAV
----------------------------------- */
header.site-header {
  position: sticky;
  top: 12px;
  z-index: 60;
  backdrop-filter: blur(6px);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.3)
  );
  border-radius: 12px;
  margin: 8px;
  box-shadow: var(--card-shadow);
}

html.dark header.site-header {
  background: linear-gradient(
    180deg,
    rgba(7, 16, 33, 0.6),
    rgba(7, 16, 33, 0.35)
  );
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 40px;
  width: auto;
  border-radius: 8px;
  display: block;
}

.brand-title {
  font-weight: 800;
  font-size: 18px;
}

/* Desktop nav */
.nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 8px;
  border-radius: 8px;
}

.nav-links a:hover {
  background: var(--glass);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Dark toggle button */
.toggle-btn {
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
}

.toggle-indicator {
  width: 36px;
  height: 22px;
  border-radius: 18px;
  background: linear-gradient(90deg, #e6eef8, #dbeefe);
  display: inline-block;
  position: relative;
}

.toggle-dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 3px 8px rgba(2, 6, 23, 0.15);
  transition: all 0.28s;
}

html.dark .toggle-dot {
  left: 17px;
  background: #0f1724;
}

/* --------------------------------
   FLOATING SHAPES
----------------------------------- */
.float-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.shape {
  position: absolute;
  border-radius: 999px;
  opacity: 0.14;
  filter: blur(8px);
  transform: translate3d(0, 0, 0);
}

.shape.s1 {
  width: 220px;
  height: 220px;
  background: linear-gradient(135deg, #60a5fa, #34d399);
  left: -60px;
  top: 120px;
}

.shape.s2 {
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  right: -40px;
  top: 220px;
}

.shape.s3 {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #60a5fa, #fb7185);
  left: 40%;
  bottom: 120px;
}

/* --------------------------------
   HERO
----------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 36px;
  align-items: center;
  padding: 48px 0;
}

.hero-left {
  max-width: 760px;
}

.badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #0747c8);
  color: white;
  font-weight: 800;
  font-size: 13px;
}

.headline {
  font-size: 40px;
  line-height: 1.03;
  margin: 18px 0 12px;
  font-weight: 800;
}

.headline .shimmer {
  display: inline-block;
  background: linear-gradient(90deg, var(--text), #bfe1ff, var(--text));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 2.2s linear infinite;
}

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

.lead {
  color: var(--muted);
  font-size: 16px;
  max-width: 60ch;
}

.cta-row {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 12px 16px;
  border-radius: 10px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn.primary {
  background: linear-gradient(90deg, var(--brand), #1e4fd8);
  color: white;
  box-shadow: 0 12px 30px rgba(15, 110, 244, 0.12);
}

.btn.primary:hover {
  transform: translateY(-3px);
}

.btn.ghost {
  background: transparent;
  border: 2px solid rgba(15, 110, 244, 0.12);
  color: var(--brand);
}

/* Inline features row */
.features-inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.feature-pill {
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: var(--card-shadow);
  font-weight: 700;
}

/* --------------------------------
   SIGNUP CARD / LEAD FORM
----------------------------------- */
.signup {
  background: var(--surface);
  padding: 20px;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

.signup h3 {
  margin: 0 0 8px;
}

.muted {
  color: var(--muted);
}

.lead-form input,
.lead-form select,
.lead-form textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e6e9ee;
  margin-bottom: 10px;
  background: transparent;
  color: inherit;
}

.lead-form .row {
  display: flex;
  gap: 10px;
}

.lead-form .submit {
  background: var(--accent);
  color: white;
  padding: 10px;
  border-radius: 10px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

/* --------------------------------
   CARDS & GRIDS
----------------------------------- */
.card {
  background: var(--surface);
  padding: 20px;
  border-radius: 14px;
  box-shadow: var(--card-shadow);
}

.categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.cat {
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  box-shadow: var(--card-shadow);
  min-height: 64px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

/* CTA section */
.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  border-radius: 16px;
}

/* --------------------------------
   FOOTER
----------------------------------- */
footer.site-footer {
  padding: 28px 0;
  margin-top: 36px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --------------------------------
   MOBILE NAV
----------------------------------- */

/* Burger (hidden on desktop) */
.mobile-menu-btn {
  display: none;
  font-size: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text);
}

/* Mobile slide-down panel */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin: 12px;
  position: absolute;
  top: 70px;
  right: 12px;
  width: calc(100% - 24px);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  z-index: 1000;
}

.mobile-menu.open {
  display: flex;
  max-height: 550px;
  opacity: 1;
}

.mobile-menu a {
  padding: 12px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border-radius: 8px;
  display: block;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-menu a:last-child {
  border-bottom: none;
}

/* --------------------------------
   RESPONSIVE
----------------------------------- */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .signup {
    order: 2;
  }

  .hero-left {
    order: 1;
  }

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

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

  .wrap {
    padding: 18px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }
}

/* Hero search mobile override (works with inline styles in index.html) */
@media (max-width: 768px) {
  .hero-search {
    width: 100%;
  }

  .hero-search form {
    flex-direction: column !important;
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
  }

  .hero-search input[type="text"] {
    width: 100% !important;
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
  }

  .hero-search button {
    width: 100%;
    margin-top: 10px;
    padding: 14px 0;
    font-size: 16px;
    border-radius: 10px;
  }

  .cta-card {
    display: grid;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .shimmer {
    animation: none !important;
  }

  .shape {
    animation: none !important;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}

/* --------------------------------
   GSAP INITIAL STATE HELPERS
----------------------------------- */
.gs-hidden {
  opacity: 0;
  transform: translateY(28px);
  will-change: transform, opacity;
}

.gs-hidden-left {
  opacity: 0;
  transform: translateX(28px);
  will-change: transform, opacity;
}

.stagger-item {
  opacity: 0;
  transform: translateY(18px);
  will-change: transform, opacity;
}

/* --------------------------------
   MODALS (index + detail)
----------------------------------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
  backdrop-filter: blur(8px);
}

.modal-content {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--card-shadow);
  position: relative;
}

/* Center modal titles on both desktop & mobile (A: centered title) */
.modal-content h1,
.modal-content h2,
.modal-content h3 {
  text-align: center;
  margin-top: 8px;
  margin-bottom: 16px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}

/* FULL MOBILE APP STYLE AUTH (tweaked: no overlap) */
@media (max-width: 768px) {
  .modal {
    padding: 0;
    background: var(--bg);
    align-items: flex-end; /* sheet from bottom */
  }

  .modal-content {
    width: 100vw;
    height: 100dvh; /* dynamic viewport unit for iOS Safari */
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    padding: 24px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.25);
  }

  /* Back button on sub-modals:
     - Uses same element: class="modal-close auth-back"
     - On mobile we override the absolute positioning */
  .modal-close.auth-back {
    position: static;
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    cursor: pointer;
    text-align: left;
  }

  /* Keep X-close top-right ONLY for normal modal-close (no auth-back) */
  .modal-close:not(.auth-back) {
    top: 16px;
    right: 16px;
  }

  /* Main login title */
  .auth-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
    margin-bottom: 12px;
  }

  .auth-btn,
  .modal-content button {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 17px;
  }

  input,
  select {
    font-size: 17px !important;
    padding: 14px !important;
    border-radius: 12px !important;
  }
}

/* --------------------------------
   TOAST
----------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
  pointer-events: none;
  padding: 24px 30px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 99999;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) translateY(-8px);
  pointer-events: auto;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: #0f1724;
  font-weight: 600;
}

.toast-icon {
  font-size: 26px;
  color: #0f6ef4;
}

.toast.error {
  border-left: 6px solid #e03131;
}

.toast.error .toast-icon {
  color: #e03131;
}

.toast:hover {
  cursor: pointer;
}

.toast-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 22px;
  color: #555;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}

.toast-close:hover {
  color: #000;
}

@media (max-width: 768px) {
  .toast {
    width: 90%;
    max-width: 90%;
    padding: 20px;
    transform: translate(-50%, -50%) scale(0.9);
  }

  .toast.show {
    transform: translate(-50%, -50%) scale(1) translateY(-4px);
  }

  .toast-content {
    font-size: 15px;
    gap: 10px;
  }

  .toast-icon {
    font-size: 22px;
  }
}

/* --------------------------------
   USER MENU (DESKTOP)
----------------------------------- */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.login-btn {
  padding: 10px 22px;
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease;
  font-size: 15px;
}

.login-btn:hover {
  background: #0d5ed1;
}

.avatar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.arrow-down {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text);
  opacity: 0.6;
}

/* Dropdown panel */
.user-dropdown {
  position: absolute;
  right: 0;
  top: 52px;
  width: 240px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  padding: 8px 0;
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
}

.user-dropdown.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-header {
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #eee;
}

.dropdown-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.dropdown-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.dropdown-email {
  font-size: 13px;
  color: var(--muted);
}

.dropdown-link {
  display: block;
  padding: 12px 20px;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
}

.dropdown-link:hover {
  background: var(--bg);
}

.dropdown-divider {
  margin: 10px 0;
  border: 0;
  height: 1px;
  background: #eee;
}

/* --------------------------------
   MOBILE USER MENU
----------------------------------- */
.mobile-login-btn {
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.mobile-user-menu {
  margin-top: 10px;
}

.mobile-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.mobile-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.mobile-user-name {
  font-weight: 600;
  font-size: 15px;
}

.mobile-user-email {
  font-size: 13px;
  color: var(--muted);
}

.mobile-user-link {
  display: block;
  padding: 10px 0;
  font-size: 15px;
}


/* ===== MOBILE MENU FIX ===== */

.mobile-menu * {
  pointer-events: auto;
}

.mobile-menu {
  position: fixed;
  top: 70px;
  right: -100%;
  width: 280px;
  height: calc(100vh - 70px);
  background: var(--bg, #fff);
  box-shadow: -4px 0 12px rgba(0,0,0,0.1);
  transition: right 0.3s ease;
  z-index: 999;
}

.mobile-menu.open {
  right: 0;
}

@media (min-width: 991px) {
  .mobile-menu {
    display: none !important;
  }
}

/* Lock background when any modal is open */
html.modal-open,
body.modal-open {
  overflow: hidden;
  height: 100%;
}
