/* ============================================================
   UPLOANMITRA Financial Advisors
   Pixel-Perfect Universal Responsive Stylesheet
   Covers All Breakpoints: 320px, 375px, 390px, 414px, 480px, 576px, 768px, 992px, 1200px, 1400px
   ============================================================ */

/* ── Universal Reset & Strict Overflow Prevention ── */
*, *::before, *::after {
  box-sizing: border-box !important;
}

html {
  max-width: 100% !important;
  width: 100% !important;
  overflow-x: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  max-width: 100% !important;
  width: 100% !important;
  overflow-x: hidden !important;
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  -webkit-tap-highlight-color: transparent;
}

#main-content,
main,
header,
footer,
section,
.section,
.hero-section,
.page-hero,
.site-header,
.announcement-bar,
.container {
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

/* ── Responsive Images & Media Scaling ── */
img, svg, iframe, canvas, video {
  max-width: 100% !important;
  height: auto !important;
}

/* ── Prevent iOS Safari Auto-Zoom on Form Inputs ── */
@media (max-width: 768px) {
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* ── Horizontal Table Touch Scrolling Containers ── */
.rate-table-wrap,
.admin-table-container,
.amort-table-wrap,
.table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin-bottom: 1rem;
}

.rate-table,
.admin-table,
.amort-table {
  min-width: 580px;
}

/* ── Absolute Background Blobs Containment ── */
.hero-bg,
.hero-blob,
.page-hero-shapes,
.page-hero-shape,
.cta-bg-shapes,
.error-bg-blobs,
.blob {
  max-width: 100% !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* ── Floating Buttons & Notifications Overflow Safety ── */
.toast-container {
  max-width: calc(100vw - 32px) !important;
  right: 16px !important;
  left: 16px !important;
  margin: 0 auto !important;
}

.toast {
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
}

.whatsapp-float {
  bottom: 20px !important;
  left: 20px !important;
}

.ai-chatbot-float {
  bottom: 20px !important;
  right: 20px !important;
}

.ai-chat-window {
  max-width: calc(100vw - 32px) !important;
  right: 16px !important;
}

/* ============================================================
   1400px BREAKPOINT (Large Desktops)
   ============================================================ */
@media (max-width: 1400px) {
  .container {
    max-width: 1200px;
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* ============================================================
   1200px BREAKPOINT (Laptops & Small Desktops)
   ============================================================ */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero-inner {
    gap: 32px;
  }

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

  .loans-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
  }
}

/* ============================================================
   992px BREAKPOINT (Tablets Landscape)
   ============================================================ */
@media (max-width: 992px) {
  .container {
    max-width: 720px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .desktop-nav,
  .header-phone {
    display: none !important;
  }

  .hamburger {
    display: flex !important;
  }

  .hero-inner {
    grid-template-columns: 1fr !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 40px;
  }

  .hero-left {
    max-width: 100%;
    text-align: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta,
  .hero-trust,
  .hero-stats {
    justify-content: center;
  }

  .hero-right {
    width: 100%;
    display: flex;
    justify-content: center;
    height: auto;
  }

  .hero-illustration {
    transform: scale(0.9);
    margin-bottom: 0;
  }

  .float-card--approved {
    right: 0 !important;
    top: -20px !important;
  }

  .float-card--emi {
    left: 0 !important;
    bottom: -20px !important;
  }

  .float-card--partners {
    display: none !important;
  }

  .loans-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px !important;
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px !important;
  }

  .steps-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  .steps-connector {
    display: none;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 32px !important;
  }

  .footer-brand {
    grid-column: span 2 !important;
  }
}

/* ============================================================
   768px BREAKPOINT (Tablets Portrait)
   ============================================================ */
@media (max-width: 768px) {
  .container {
    max-width: 540px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-header {
    height: 68px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(12px) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06) !important;
  }

  .site-logo img {
    height: 38px !important;
  }

  .section {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }

  .section-title {
    font-size: clamp(1.45rem, 4.5vw, 2.1rem) !important;
  }

  .hero-section {
    padding-top: 28px !important;
    padding-bottom: 20px !important;
    min-height: auto !important;
  }

  .hero-right {
    height: auto !important;
    min-height: auto !important;
    margin-top: 16px !important;
    margin-bottom: 12px !important;
  }

  .hero-title {
    font-size: clamp(1.8rem, 5.5vw, 2.6rem) !important;
    margin-bottom: 12px !important;
  }

  .hero-desc {
    margin-bottom: 20px !important;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin-top: 16px !important;
  }

  .hero-illustration {
    transform: scale(0.95) !important;
    margin: 0 auto !important;
  }

  .steps-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .step-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 20px 16px !important;
    background: #FFFFFF !important;
    border: 1.5px solid var(--color-border) !important;
    border-radius: 20px !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.03) !important;
  }

  .step-desc {
    max-width: 100% !important;
    font-size: 0.92rem !important;
    line-height: 1.6 !important;
  }

  .steps-connector {
    display: none !important;
  }

  .loans-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .loan-card {
    padding: 20px !important;
  }

  .why-grid,
  .benefits-grid,
  .documents-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .doc-category {
    grid-column: span 1 !important;
  }

  .page-hero {
    padding-top: 80px !important;
    padding-bottom: 40px !important;
  }

  .page-hero-inner {
    grid-template-columns: 1fr !important;
    text-align: center;
  }

  .page-hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .cta-section {
    padding: 48px 0 !important;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .cta-buttons .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

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

  .footer-brand {
    grid-column: span 1 !important;
  }

  .apply-form-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* ============================================================
   576px BREAKPOINT (Small Tablets / Landscape Phones)
   ============================================================ */
@media (max-width: 576px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header-right #header-apply-btn {
    display: none !important;
  }

  .hero-title {
    font-size: clamp(1.65rem, 6.5vw, 2.25rem) !important;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

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

  .hero-illustration {
    transform: scale(0.7);
  }

  .float-card--approved,
  .float-card--emi {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 8px auto !important;
    width: 100% !important;
    max-width: 280px !important;
  }
}

/* ============================================================
   480px BREAKPOINT (Large Mobile Phones)
   ============================================================ */
@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(1.55rem, 7vw, 2.05rem) !important;
  }

  .hero-badge {
    font-size: 11px !important;
    padding: 4px 10px !important;
  }

  .hero-trust {
    flex-direction: column !important;
    align-items: center;
    gap: 10px !important;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 12px 8px !important;
  }

  .hero-stat-number {
    font-size: 1.15rem !important;
  }

  .hero-illustration {
    transform: scale(0.62);
  }

  .mobile-drawer {
    width: 100% !important;
    border-radius: 0 !important;
  }

  .page-hero-stats {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* ============================================================
   414px BREAKPOINT (iPhone Plus / Max & Android Flagships)
   ============================================================ */
@media (max-width: 414px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-title {
    font-size: 1.6rem !important;
    line-height: 1.25 !important;
  }

  .btn--lg {
    padding: 12px 18px !important;
    font-size: 0.9rem !important;
  }

  .loan-card {
    padding: 16px !important;
  }
}

/* ============================================================
   390px BREAKPOINT (iPhone Pro & Standard Android Phones)
   ============================================================ */
@media (max-width: 390px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-title {
    font-size: 1.5rem !important;
  }

  .section-title {
    font-size: 1.35rem !important;
  }

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

/* ============================================================
   375px BREAKPOINT (iPhone SE / Compact Mobile Phones)
   ============================================================ */
@media (max-width: 375px) {
  .hero-title {
    font-size: 1.42rem !important;
  }

  .hero-illustration {
    transform: scale(0.55);
  }

  .btn {
    padding: 10px 14px !important;
    font-size: 0.85rem !important;
  }
}

/* ============================================================
   320px BREAKPOINT (Galaxy Fold / Ultra Small Phones)
   ============================================================ */
@media (max-width: 320px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero-title {
    font-size: 1.3rem !important;
  }

  .hero-illustration {
    display: none !important;
  }

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

  .announcement-bar {
    display: none !important;
  }
}

/* ============================================================
   DESKTOP SITE / DESKTOP MODE OVERRIDE (min-width: 993px)
   ============================================================ */
@media (min-width: 993px) {
  .desktop-nav {
    display: flex !important;
    align-items: center;
    gap: 24px;
  }

  .header-phone {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
  }

  .hamburger {
    display: none !important;
  }

  .hero-inner {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    align-items: center !important;
    text-align: left !important;
    justify-content: space-between !important;
  }

  .hero-left {
    max-width: 580px !important;
    text-align: left !important;
  }

  .hero-right {
    display: flex !important;
    width: auto !important;
    height: 580px !important;
  }

  .hero-illustration {
    transform: scale(1) !important;
    margin-bottom: 0 !important;
  }

  .loans-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .why-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .steps-container {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: var(--space-6) !important;
  }

  .steps-connector {
    display: block !important;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.2fr !important;
  }

  .footer-brand {
    grid-column: auto !important;
  }
}
