/* ══════════════════════════════════════════════════════════════
   IsonAI Global Mobile Optimization
   Link from ALL pages: <link rel="stylesheet" href="/authstatic/mobile-global.css">
   ══════════════════════════════════════════════════════════════ */

/* ── dvh fix for all pages ── */
html, body { height: 100vh; height: 100dvh; }

/* ── Disable double-tap zoom globally ── */
* { touch-action: manipulation; }

/* ── Safe area insets ── */
.page, .hero, body { padding-bottom: env(safe-area-inset-bottom); }
.nav { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* ── Momentum scroll ── */
.page, .modal-body, .sb-list, .services {
  -webkit-overflow-scrolling: touch;
}

/* ── Suppress long-press on interactive ── */
button, a, .btn, .btn-submit, .nav-btn, .code-input {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Allow text selection in content ── */
p, .sub, .field-static, .svc-desc, .meta, .card-footer, .form-hint {
  -webkit-user-select: text;
  user-select: text;
}

/* ── PWA overscroll ── */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: contain; }
}

/* ══════════════════ MOBILE (≤768px) ══════════════════ */
@media (max-width: 768px) {

  /* ── Prevent iOS auto-zoom on input focus ── */
  input, textarea, select, .form-input, .field-input, .code-input {
    font-size: 16px !important;
  }

  /* ── Touch feedback on interactive elements ── */
  button:active, a:active, .btn:active, .btn-submit:active,
  .nav-btn:active, .sug:active, .feat:active, .svc:active {
    opacity: 0.7 !important;
    transform: scale(0.97) !important;
    transition: transform 0.08s, opacity 0.08s !important;
  }

  /* ── NAV: mobile optimized ── */
  .nav {
    padding: 10px 12px !important;
    gap: 6px;
  }
  .nav-logo img { height: 22px; }
  .nav-logo span { font-size: 1.1rem; }
  .nav-right { gap: 4px; }
  .nav-btn {
    padding: 7px 10px !important;
    font-size: .78rem !important;
  }

  /* ── HERO: tighter on mobile ── */
  .hero {
    padding: 80px 16px 40px !important;
    min-height: auto !important;
  }
  .hero h1, h1 {
    font-size: 2rem !important;
    letter-spacing: -0.5px !important;
  }
  .hero-sub {
    font-size: .9rem !important;
    margin-bottom: 24px !important;
  }
  .hero-logo {
    width: 56px !important;
    height: 56px !important;
    margin-bottom: 20px !important;
  }
  .hero-badge { font-size: .72rem; padding: 5px 12px; }
  .hero-cta {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  .btn-h {
    text-align: center !important;
    padding: 12px 24px !important;
  }

  /* ── FEATURES grid: single column ── */
  .features {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 32px !important;
    max-width: 100% !important;
  }
  .feat {
    padding: 18px 16px !important;
  }
  .feat-icon { width: 34px; height: 34px; margin-bottom: 10px; }

  /* ── STATS: compact ── */
  .stats {
    gap: 20px !important;
    margin-top: 32px !important;
  }
  .stat-val { font-size: 1.2rem !important; }

  /* ── CARDS (auth pages): full width ── */
  .card {
    padding: 24px 18px !important;
    border-radius: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .card h1 { font-size: 1.4rem !important; }
  .card .sub { font-size: .85rem !important; margin-bottom: 20px !important; }
  .card-logo { margin-bottom: 20px; }
  .card-logo img { height: 28px; }
  .card-logo span { font-size: 1.2rem; }

  /* ── CODE INPUTS: responsive sizing ── */
  .code-inputs {
    gap: 8px !important;
  }
  .code-input {
    width: 52px !important;
    height: 58px !important;
    font-size: 1.5rem !important;
    border-radius: 10px !important;
  }

  /* ── FORM: touch-friendly spacing ── */
  .form-group { margin-bottom: 14px; }
  .form-input, .field-input {
    padding: 13px 14px !important;
    border-radius: 10px !important;
  }
  .btn-submit {
    padding: 14px !important;
    font-size: .95rem !important;
    border-radius: 12px !important;
  }

  /* ── PROFILE page ── */
  .page { padding: 20px 12px !important; }
  .container { max-width: 100%; }
  .page-title { font-size: 1.5rem !important; margin-bottom: 20px !important; }
  .section {
    padding: 18px 16px !important;
    border-radius: 14px !important;
    margin-bottom: 14px !important;
  }
  .section-title { font-size: .95rem !important; }
  .avatar {
    width: 52px !important;
    height: 52px !important;
    font-size: 1.3rem !important;
  }
  .btn-row {
    flex-direction: column;
    gap: 8px;
  }
  .btn-row .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .confirm-box { padding: 14px !important; }

  /* ── STATUS page ── */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .overall { font-size: .82rem; }
  .svc {
    padding: 14px 16px !important;
    gap: 10px !important;
  }
  .svc-name { font-size: .88rem; }
  .meta { font-size: .72rem; padding: 12px 14px !important; }

  /* ── MODAL: full-width on mobile ── */
  .modal-bg .modal, .modal {
    width: 96% !important;
    max-width: 100% !important;
    padding: 24px 18px !important;
    border-radius: 16px !important;
    max-height: 90dvh;
    overflow-y: auto;
  }

  /* ── FOOTER ── */
  .footer {
    padding: 24px 16px;
    gap: 16px;
    font-size: .72rem;
  }

  /* ── Landscape ── */
  @media (orientation: landscape) {
    .hero { min-height: auto; padding-top: 60px !important; padding-bottom: 30px !important; }
    .features { grid-template-columns: repeat(3, 1fr) !important; }
    .hero-cta { flex-direction: row !important; }
  }
}

/* ── Very small screens (≤360px) ── */
@media (max-width: 360px) {
  .code-input {
    width: 44px !important;
    height: 50px !important;
    font-size: 1.3rem !important;
  }
  .code-inputs { gap: 6px !important; }
  .card { padding: 20px 14px !important; }
  .nav-btn:last-child { display: none; } /* hide "Get Started" on tiny screens */
}
