/* ============================================================
   Nex Nest AI — Mobile Responsive Stylesheet
   Targets: 375px–768px (phones & small tablets)
   ============================================================ */


/* ===== HAMBURGER BUTTON ===== */

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: var(--accent-soft, #dcfce7);
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink, #0a0a0a);
  border-radius: 2px;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* X animation when open */
.hamburger-btn.open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-btn.open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ===== MOBILE MENU OVERLAY ===== */

.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(10, 10, 10, 0.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.mobile-menu-overlay.open {
  display: block;
  animation: mobileOverlayIn 0.2s ease;
}

@keyframes mobileOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mobile-menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--surface, white);
  border-bottom: 1px solid var(--border, #e7e5e4);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  padding-bottom: 16px;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.mobile-menu-overlay.open .mobile-menu-panel {
  transform: translateY(0);
  pointer-events: all;
}

.mobile-menu-nav-row {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border, #e7e5e4);
}

.mobile-menu-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink, #0a0a0a);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-menu-close {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  font-size: 1.2rem;
  color: var(--muted, #78716c);
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-close:hover {
  background: var(--border, #e7e5e4);
}

.mobile-menu-links {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-menu-links a {
  padding: 13px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink, #0a0a0a);
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-links a:hover,
.mobile-menu-links a.active {
  background: var(--accent-soft, #dcfce7);
  color: var(--accent, #16a34a);
}

/* Landing page mobile links use blue accent */
.mobile-menu-links a.mobile-link-blue:hover,
.mobile-menu-links a.mobile-link-blue.active {
  background: #dbeafe;
  color: #2563eb;
}

.mobile-menu-divider {
  height: 1px;
  background: var(--border, #e7e5e4);
  margin: 8px 12px;
}

.mobile-menu-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-user-info {
  font-size: 0.82rem;
  color: var(--muted, #78716c);
  font-weight: 500;
  padding-left: 2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-logout-btn {
  padding: 9px 16px;
  background: white;
  border: 1px solid var(--border, #e7e5e4);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--muted, #78716c);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.mobile-logout-btn:hover {
  border-color: var(--muted, #78716c);
  color: var(--ink, #0a0a0a);
}

.mobile-menu-cta {
  display: block;
  margin: 4px 12px 0;
  padding: 14px;
  background: var(--accent, #2563eb);
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-cta:hover {
  background: var(--accent-hover, #1d4ed8);
}


/* ===== GLOBAL MOBILE RULES ===== */

@media (max-width: 768px) {

  /* Show hamburger, hide desktop nav */
  .hamburger-btn {
    display: flex;
  }

  .nav-links {
    display: none !important;
  }

  .nav-user {
    display: none !important;
  }

  /* Landing page: keep only the CTA in nav-right, hide login link */
  .nav-right .nav-login {
    display: none !important;
  }

  .nav-right .nav-cta {
    padding: 9px 16px;
    font-size: 0.82rem;
  }

  /* Nav mobile-hide class on landing */
  .nav-mobile-hide {
    display: none !important;
  }

  /* ---- Global body/containers ---- */
  body {
    font-size: 16px; /* Prevent iOS zoom on focus */
  }

  input, textarea, select {
    font-size: 16px !important; /* Prevent iOS zoom */
  }

  /* ---- Buttons min tap target ---- */
  button,
  .btn,
  [role="button"],
  a.btn-primary,
  a.btn-ghost,
  a.btn-action,
  a.btn-pricing-free,
  a.btn-pricing-pro,
  a.next-step-arrow {
    min-height: 44px;
  }


  /* ---- LANDING PAGE ---- */

  .hero {
    padding: 100px 20px 72px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 9vw, 3rem);
  }

  .hero-sub {
    font-size: 1.05rem;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
    padding: 16px 24px;
  }

  .btn-ghost {
    text-align: center;
    padding: 12px 24px;
  }

  .hero-social-proof {
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 32px;
    font-size: 0.82rem;
  }

  /* How it works: single column */
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .step-card {
    padding: 28px 24px;
  }

  /* Features */
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* Stats counter */
  .proof-counter {
    gap: 24px;
    padding: 32px 16px 0;
  }

  .counter-value {
    font-size: 1.8rem;
  }

  /* Pricing */
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .pricing-card {
    padding: 32px 24px;
  }

  /* Footer */
  .footer-top {
    flex-direction: column;
    gap: 24px;
  }

  .footer-nav {
    gap: 28px;
    flex-wrap: wrap;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  /* Section spacing */
  .how-section,
  .features-section,
  .proof-section,
  .pricing-section {
    padding: 72px 20px;
  }

  .closing-section {
    padding: 80px 20px;
  }

  .section-desc {
    margin-bottom: 40px;
  }


  /* ---- DASHBOARD ---- */

  .main {
    padding: 88px 16px 60px;
  }

  .health-hero {
    padding: 28px 20px;
  }

  .health-stats {
    gap: 16px;
  }

  .category-bars {
    grid-template-columns: 1fr 1fr;
  }

  .next-step-card {
    padding: 22px 18px;
  }

  .next-step-card h2 {
    font-size: 1.1rem;
  }

  .next-step-meta {
    gap: 8px;
  }


  /* ---- BLUEPRINT PAGE ---- */

  .blueprint-container {
    padding: 88px 16px 60px;
  }

  .wizard-container {
    padding: 88px 16px 60px;
  }

  .wizard-card {
    padding: 22px 18px;
  }

  .wizard-header h1 {
    font-size: 1.25rem;
  }

  .action-bar {
    gap: 8px;
  }

  .btn-action {
    padding: 10px 14px;
    font-size: 0.82rem;
    flex: 1;
    justify-content: center;
  }

  .blueprint-hero h1 {
    font-size: 1.5rem;
  }

  .blueprint-meta {
    gap: 8px;
  }

  .meta-chip {
    font-size: 0.75rem;
    padding: 6px 12px;
  }


  /* ---- SETTINGS PAGE ---- */

  .section-card {
    padding: 20px 18px;
  }

  .profile-overview {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .modal {
    padding: 24px 20px;
    margin: 0;
    border-radius: 16px;
  }

  .modal-actions {
    flex-direction: column;
  }

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


  /* ---- ONBOARDING ---- */

  .wizard {
    padding: 88px 16px 60px;
  }

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

  .btn-row {
    flex-direction: column;
  }

  .btn-row .btn-back,
  .btn-row .btn-next {
    width: 100%;
    justify-content: center;
  }

  /* ---- MODAL OVERLAY — bottom-sheet feel on mobile ---- */

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-overlay .modal {
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 100%;
    padding: 28px 20px 32px;
  }

  /* Milestone modal */
  .milestone-modal {
    padding: 32px 20px !important;
    margin: 16px;
    border-radius: 20px !important;
  }

}


/* ===== SMALL PHONES (375px) ===== */

@media (max-width: 420px) {

  .hero h1 {
    font-size: 2.1rem;
  }

  .proof-counter {
    grid-template-columns: 1fr 1fr;
    display: grid;
    gap: 20px;
  }

  .pricing-card {
    padding: 28px 18px;
  }

  .step-card {
    padding: 24px 18px;
  }

  .feature-card {
    padding: 24px 18px;
  }

  .health-hero {
    padding: 22px 16px;
  }

  .next-step-card {
    padding: 18px 16px;
  }

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

  .action-bar .btn-action {
    font-size: 0.8rem;
    padding: 9px 12px;
  }

}


/* ===== PREVENT HORIZONTAL SCROLL ===== */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}
