/* ═══════════════════════════════════════════
   GLOBAL MOBILE RESPONSIVE — EnviroNextGen
   Covers: 320px → 768px → 1024px → 1440px+
═══════════════════════════════════════════ */

/* ── Viewport fix for all devices ── */
html { -webkit-text-size-adjust: 100%; }

/* ── NAVBAR ── */
@media (max-width: 768px) {
  nav {
    padding: 14px 5% !important;
    flex-wrap: wrap;
    gap: 10px;
  }
  .nav-links {
    display: none !important;
  }
  .logo { font-size: 1.1rem !important; }

  /* Hamburger menu */
  .nav-mobile-toggle {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: none;
  }
  .nav-mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--green-deep);
    border-radius: 2px;
    transition: all 0.3s;
  }
  .nav-mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0; right: 0;
    background: rgba(245,240,232,0.98);
    backdrop-filter: blur(16px);
    padding: 20px 5% 28px;
    border-bottom: 1px solid rgba(47,177,90,0.15);
    z-index: 99;
    flex-direction: column;
    gap: 0;
  }
  .nav-mobile-menu.open { display: flex !important; }
  .nav-mobile-menu a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--green-deep);
    text-decoration: none;
    border-bottom: 1px solid rgba(10,46,26,0.07);
  }
  .nav-mobile-menu a:last-child { border-bottom: none; }
  .nav-mobile-menu .btn-signup {
    margin-top: 12px;
    text-align: center;
    padding: 14px 22px !important;
    border-radius: 50px !important;
    background: var(--green-deep) !important;
    color: white !important;
    font-weight: 600;
  }
}

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

/* ── HERO ── */
@media (max-width: 768px) {
  .hero {
    padding: 100px 5% 80px !important;
    min-height: 100svh !important;
  }
  h1 { font-size: clamp(2.2rem, 10vw, 3.2rem) !important; }
  .hero-sub { font-size: 1rem !important; margin-bottom: 32px !important; }
  .hero-ctas {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .btn-primary, .btn-ghost {
    width: 100% !important;
    justify-content: center !important;
    padding: 16px 24px !important;
    font-size: 1rem !important;
  }
  .hero-stats {
    flex-wrap: wrap !important;
  }
  .stat-item {
    flex: 1 1 50% !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(94,255,155,0.1) !important;
    padding: 18px 0 !important;
  }
  .stat-item:nth-child(odd) { border-right: 1px solid rgba(94,255,155,0.1) !important; }
  .stat-num { font-size: 1.3rem !important; }
}

/* ── SCOPES SECTION ── */
@media (max-width: 900px) {
  .scopes-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .scopes-section { padding: 70px 5% 60px !important; }
  .scope-card { padding: 28px 24px !important; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .scopes-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ── HOW IT WORKS ── */
@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }
  .steps-grid::before { display: none !important; }
  .how-section { padding: 60px 5% 70px !important; }
  .step { padding: 0 10px !important; }
}
@media (max-width: 480px) {
  .steps-grid { grid-template-columns: 1fr !important; }
}

/* ── CTA BANNER ── */
@media (max-width: 768px) {
  .cta-banner {
    flex-direction: column !important;
    gap: 32px !important;
    padding: 60px 5% !important;
    text-align: center;
  }
  .cta-action { align-items: center !important; }
  .btn-primary-dark { width: 100% !important; justify-content: center !important; }
}

/* ── FOOTER ── */
@media (max-width: 768px) {
  footer {
    flex-direction: column !important;
    gap: 20px !important;
    text-align: center !important;
    padding: 36px 5% !important;
  }
  .footer-links { flex-wrap: wrap !important; justify-content: center !important; }
}

/* ── LOGIN / SIGNUP two-panel layout ── */
@media (max-width: 900px) {
  body { flex-direction: column !important; overflow: auto !important; }
  .side-panel {
    min-height: 220px !important;
    flex: none !important;
    padding: 36px 5% !important;
  }
  .panel-illustration {
    width: 120px !important;
    height: 120px !important;
    font-size: 3rem !important;
    margin-bottom: 20px !important;
  }
  .panel-logo { font-size: 1.3rem !important; }
  .panel-tagline { margin-bottom: 24px !important; }
  .perks { display: none !important; }
  .form-panel {
    width: 100% !important;
    min-width: unset !important;
    padding: 36px 5% 48px !important;
  }
  .field-grid { grid-template-columns: 1fr !important; gap: 0 !important; }
}

/* ── FORGOT PASSWORD card ── */
@media (max-width: 480px) {
  .card {
    padding: 36px 24px !important;
    border-radius: 16px !important;
  }
}

/* ── DASHBOARD ── */
@media (max-width: 1024px) {
  .dashboard-layout, .db-layout {
    grid-template-columns: 1fr !important;
  }
  .sidebar, .db-sidebar {
    display: none !important;
  }
  .main-content, .db-main {
    padding: 20px 4% !important;
  }
}
@media (max-width: 768px) {
  .stats-row, .db-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  .chart-grid, .db-charts {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 480px) {
  .stats-row, .db-stats {
    grid-template-columns: 1fr !important;
  }
}

/* ── CARBON TOOL / BLOG ── */
@media (max-width: 768px) {
  .tool-container, .blog-container, .content-wrap {
    padding: 20px 5% !important;
  }
  .tool-grid, .form-grid {
    grid-template-columns: 1fr !important;
  }
  table { font-size: 0.82rem !important; }
  th, td { padding: 10px 8px !important; }
}

/* ── MODAL ── */
@media (max-width: 480px) {
  .modal-card {
    padding: 32px 22px !important;
    border-radius: 18px !important;
  }
  .modal-title { font-size: 1.3rem !important; }
}

/* ── GLOBAL TOUCH IMPROVEMENTS ── */
@media (max-width: 768px) {
  /* Bigger tap targets */
  button, .btn-submit, .btn-primary, .btn-ghost, .mbtn, .btn-primary-dark {
    min-height: 48px !important;
  }
  input[type="text"],
  input[type="email"],
  input[type="password"] {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    padding: 14px 16px !important;
  }
  /* Section titles */
  .section-title {
    font-size: clamp(1.5rem, 6vw, 2.2rem) !important;
  }
  .form-title {
    font-size: clamp(1.5rem, 7vw, 2rem) !important;
  }
}
