/* =============================================================================
   SERVICEBIRD — COMPREHENSIVE MOBILE-FIRST RESPONSIVE ENGINE (2026/2027 STANDARD)
   Supports: 320px (XS Phones), 375px/414px (iPhones/Android), 768px (Tablets),
             1024px (Laptops/iPad Pro), 1200px+ (Desktops/Wide Screens).
   ============================================================================= */

/* =============================================================================
   01. GLOBAL MOBILE SAFETY & FLUID FOUNDATION (Zero Horizontal Overflow)
   ============================================================================= */
html,
body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: clip !important;
  position: relative !important;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

*,
*::before,
*::after {
  box-sizing: border-box !important;
}

/* Fluid Media Protection */
img,
video,
canvas,
svg,
picture {
  max-width: 100% !important;
  height: auto;
  display: block;
}

svg {
  overflow: visible;
}

/* Responsive Containers */
.container {
  width: 100% !important;
  max-width: 1240px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: clamp(14px, 4vw, 24px) !important;
  padding-right: clamp(14px, 4vw, 24px) !important;
  box-sizing: border-box !important;
}

/* Typography Word Break Safety */
h1, h2, h3, h4, h5, h6,
p, span, a, label, li, blockquote {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Code & Tables Scrolling Safety */
pre, code, table, .table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* =============================================================================
   02. TOUCH-FRIENDLY INTERACTION TARGETS (>= 44x44px Standard)
   ============================================================================= */
button:not(.hamburger-toggle),
.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-pill,
.back-to-top-btn,
.mobile-nav-links a,
.sb-signin-btn,
.portal-tab-btn,
.tab-btn {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  cursor: pointer;
}

.hamburger-toggle {
  display: none !important;
}

/* Mobile Form Inputs (Prevents iOS Safari auto-zoom by enforcing >= 16px) */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea,
  .form-input,
  .sb-input,
  .sb-select,
  .sb-textarea {
    font-size: 16px !important;
    min-height: 46px;
    border-radius: 10px;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Touch-friendly Checkbox & Radio Labels */
  .checkbox-label,
  .radio-label,
  .form-check-label {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
  }
}

/* =============================================================================
   03. NAVBAR & MOBILE DRAWER (<= 1200px)
   ============================================================================= */
@media (max-width: 1200px) {
  .navbar {
    padding: 12px 0 !important;
  }
  
  .navbar-inner {
    padding: 0 4px !important;
    gap: 12px !important;
  }

  .nav-links,
  .nav-cta-btn,
  .navbar-actions .sb-signin-dropdown,
  .navbar-actions .btn {
    display: none !important;
  }

  .hamburger-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
  }

  /* Mobile Navigation Drawer */
  .mobile-nav-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 86vw);
    background: #FFFFFF;
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.18);
    padding: 24px 20px 32px;
    z-index: 1100;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav-drawer.active {
    transform: translateX(0);
  }

  .mobile-overlay-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }

  .mobile-overlay-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
  }

  .mobile-nav-links a {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading, #0F172A);
    text-decoration: none;
    transition: background 0.2s;
  }

  .mobile-nav-links a:active,
  .mobile-nav-links a:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--brand-blue-vibrant, #2563EB);
  }
}

/* =============================================================================
   04. DESKTOP & LARGE SCREENS (>= 1440px)
   ============================================================================= */
@media (min-width: 1440px) {
  .container {
    max-width: 1360px;
  }
  h1, .hero-main-title {
    font-size: 4.2rem;
  }
}

/* =============================================================================
   05. TABLET LANDSCAPE & MEDIUM SCREENS (769px – 1024px)
   ============================================================================= */
@media (min-width: 769px) and (max-width: 1024px) {
  .stats-grid-4col {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px !important;
  }
  
  .hero-trust-triplet-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  
  .flow-interactive-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px !important;
  }
  
  .footer-main-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 32px !important;
  }

  .sb-svc-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .sb-auth-grid {
    grid-template-columns: 1fr 1.2fr !important;
    gap: 28px !important;
  }
}

/* =============================================================================
   06. TABLETS & PHABLETS (<= 768px)
   ============================================================================= */
@media (max-width: 768px) {
  /* Headings */
  h1, .hero-main-title {
    font-size: clamp(2rem, 5.8vw, 2.6rem);
    line-height: 1.15;
  }

  h2, .section-title {
    font-size: clamp(1.5rem, 4.5vw, 2rem);
    line-height: 1.25;
  }

  h3 {
    font-size: clamp(1.18rem, 3.6vw, 1.45rem);
  }

  .section-header {
    text-align: center;
    margin-bottom: clamp(28px, 5vw, 42px);
  }

  /* Grid Stacking */
  .dive-inner,
  .dive-areas-grid,
  .flow-interactive-grid,
  .benefits-two-column-layout,
  .providers-layout-grid,
  .contact-layout-grid,
  .stats-grid-4col,
  .hero-trust-triplet-grid,
  .sb-svc-grid,
  .sb-const-pillars {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Service Features */
  .svc-feature {
    grid-template-columns: 1fr !important;
  }
  
  .svc-feature__media {
    order: -1;
    min-height: 240px;
    max-height: 360px;
  }

  /* Contact Section */
  .contact-info-card,
  .contact-form-glass-card {
    padding: 24px 20px !important;
  }

  .contact-form-cta-row {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .contact-btn-submit,
  .contact-btn-email {
    width: 100% !important;
    flex: none !important;
    justify-content: center !important;
  }

  /* AI Section Device Cluster */
  .sb-ai__stage {
    flex-direction: column !important;
    align-items: center !important;
    gap: 20px !important;
  }

  .sb-ai__desktop {
    width: 100% !important;
    max-width: 100% !important;
  }

  .sb-ai__phone {
    width: 130px !important;
  }

  .sb-ai__badge {
    position: static !important;
    margin: 0 auto !important;
  }

  /* Choice Cards */
  .sb-choice {
    grid-template-columns: 1fr !important;
    max-width: 440px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Sector Bubbles */
  .sb-sectors {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  /* Auth Grid (Showcase + Form) */
  .sb-auth-section {
    padding-top: clamp(96px, 11vw, 130px) !important;
    padding-bottom: clamp(40px, 6vw, 64px) !important;
  }

  .sb-auth-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    max-width: 540px !important;
    margin: 0 auto !important;
  }

  .sb-auth-card {
    padding: clamp(24px, 5vw, 36px) clamp(18px, 4vw, 28px) !important;
  }

  /* Footer Layout */
  .footer-main-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  .footer-bottom-bar {
    flex-direction: column !important;
    text-align: center !important;
    gap: 14px !important;
  }

  .footer-bottom-links {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 10px 16px !important;
  }

  .back-to-top-btn {
    width: 46px !important;
    height: 46px !important;
    bottom: 20px !important;
    right: 16px !important;
  }
}

/* =============================================================================
   07. SMARTPHONES PORTRAIT (<= 560px & <= 480px)
   ============================================================================= */
@media (max-width: 560px) {
  .hero-dual-cta-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  
  .dual-cta-card {
    padding: 18px 20px !important;
  }

  .dual-cta-text h3 {
    font-size: 1.125rem !important;
  }

  .sb-choice__trust {
    text-align: center !important;
  }

  .hero-j__cta .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .hero-j__trust {
    border-radius: 20px !important;
    gap: 10px 16px !important;
    padding: 14px 18px !important;
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  /* Fluid Typography */
  h1, .hero-main-title {
    font-size: clamp(1.75rem, 6.8vw, 2.15rem) !important;
    line-height: 1.18 !important;
  }

  h2 {
    font-size: clamp(1.35rem, 5.2vw, 1.7rem) !important;
  }

  h3 {
    font-size: clamp(1.08rem, 4.2vw, 1.35rem) !important;
  }

  .hero-uber-pill,
  .hero-j__eyebrow {
    font-size: 0.75rem !important;
    padding: 6px 14px !important;
    max-width: 100% !important;
  }

  .hero-sub-description,
  .hero-j__sub {
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
  }

  /* Full Width Buttons */
  .btn,
  .btn-lg {
    padding: 13px 18px !important;
    font-size: 0.9375rem !important;
    width: 100% !important;
    justify-content: center !important;
  }

  /* Single Column Form Rows */
  .form-row-2col,
  .form-row-grid,
  .sb-form-row--2col {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .contact-info-card,
  .contact-form-glass-card {
    padding: 20px 16px !important;
  }

  .stats-grid-4col {
    grid-template-columns: 1fr !important;
  }

  .hero-stats-card {
    padding: 18px 14px !important;
  }

  /* Sector Bubbles */
  .sb-sectors {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .sb-sector {
    padding: 12px 8px !important;
    font-size: 0.8rem !important;
  }

  .sb-emph {
    grid-template-columns: 1fr !important;
  }

  .app-badges {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .app-badge {
    flex: 1 1 140px !important;
  }

  .prov-card {
    padding: 18px 14px !important;
  }

  /* Footer 5 Accreditation Logos (Clean 2-Col + Wide Banner) */
  .footer-accred-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .footer-accred-item {
    height: 52px !important;
    padding: 6px 10px !important;
  }

  .footer-accred-item--wide {
    height: 50px !important;
    padding: 6px 14px !important;
  }

  .footer-accred-item img,
  .footer-accred-item svg {
    max-height: 38px !important;
  }

  .footer-accred-item--wide img,
  .footer-accred-item--wide svg {
    max-height: 32px !important;
  }

  /* Wordmark & Flying Bird Responsive Scaling */
  .ftr__word,
  .sb-footer-wordmark {
    font-size: clamp(2rem, 8.8vw, 4.2rem) !important;
    margin-top: 24px !important;
    margin-bottom: 8px !important;
  }

  .sb-footer-wordmark__glow {
    width: 60% !important;
    height: 70px !important;
  }

  .sb-wordmark-bird-flyer {
    width: clamp(22px, 3.8vw, 36px) !important;
    height: clamp(18px, 3.2vw, 32px) !important;
  }
}

/* =============================================================================
   08. EXTRA SMALL PHONES (<= 360px down to 320px) — Pixel-Perfect Guarantee
   ============================================================================= */
@media (max-width: 360px) {
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Navbar */
  .navbar-inner {
    padding: 0 2px !important;
  }

  .navbar-logo-wrap img {
    max-width: 115px !important;
    height: auto !important;
  }

  .hamburger-toggle {
    width: 44px !important;
    height: 44px !important;
  }

  /* Hero */
  h1, .hero-main-title {
    font-size: 1.62rem !important;
    line-height: 1.18 !important;
  }

  h2 {
    font-size: 1.28rem !important;
  }

  h3 {
    font-size: 1.05rem !important;
  }

  .btn {
    font-size: 0.875rem !important;
    padding: 12px 14px !important;
  }

  /* Hero 5-Step Journey on 320px */
  .j5__row,
  .j5.j5--4 .j5__row {
    max-width: 270px !important;
    gap: 6px !important;
  }

  .j5__scene {
    max-width: 125px !important;
  }

  .j5__cap,
  .j5__cap:nth-of-type(1),
  .j5__cap:nth-of-type(2),
  .j5__cap:nth-of-type(3),
  .j5__cap:nth-of-type(4) {
    padding: 10px 12px !important;
    gap: 8px !important;
    grid-template-columns: 28px 1fr !important;
  }

  .j5__num {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.75rem !important;
  }

  .j5__cap b {
    font-size: 0.8125rem !important;
  }

  .j5__cap small {
    font-size: 0.725rem !important;
  }

  /* Role selector cards on register */
  .sb-role-select {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .sb-role-card {
    padding: 12px 14px !important;
  }

  /* Contact & Form Padding */
  .contact-info-card,
  .contact-form-glass-card,
  .sb-auth-card {
    padding: 18px 12px !important;
  }

  .contact-form-cta-row {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .contact-btn-submit,
  .contact-btn-email {
    width: 100% !important;
    justify-content: center !important;
  }

  /* 5 Accreditation Logos on 320px */
  .footer-accred-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .footer-accred-item {
    height: 48px !important;
    padding: 4px 8px !important;
  }

  .footer-accred-item--wide {
    height: 46px !important;
    padding: 4px 10px !important;
  }

  .footer-accred-item img,
  .footer-accred-item svg {
    max-height: 34px !important;
  }

  .footer-accred-item--wide img,
  .footer-accred-item--wide svg {
    max-height: 28px !important;
  }

  /* Wordmark */
  .ftr__word,
  .sb-footer-wordmark {
    font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
  }

  .sb-wordmark-bird-flyer {
    width: 22px !important;
    height: 18px !important;
  }
}




