/* ════════════════════════════════════════════════════════════
   FastFundLoans – Main Stylesheet
   Palette:
     Navy:   #1B3A6B
     Teal:   #22C7A9
     Light:  #F4F7FB
     Text:   #1C2B40
   ════════════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1C2B40;
  background: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; background: none; border: none; font-family: inherit; }

/* ── Container ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: #1B3A6B;
  color: #fff;
  padding: 9px 20px;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(27,58,107,.2);
}
.btn-primary:hover { background: #163063; box-shadow: 0 4px 16px rgba(27,58,107,.3); }

.btn-cta {
  background: #22C7A9;
  color: #fff;
  padding: 14px 28px;
  font-size: 1rem;
  box-shadow: 0 4px 20px rgba(34,199,169,.35);
  border-radius: 10px;
}
.btn-cta:hover { background: #1ab39a; box-shadow: 0 6px 24px rgba(34,199,169,.45); }

.btn-ghost {
  color: #1B3A6B;
  padding: 14px 24px;
  font-size: 1rem;
  border: 1.5px solid rgba(27,58,107,.25);
  border-radius: 10px;
}
.btn-ghost:hover { border-color: #1B3A6B; background: rgba(27,58,107,.04); }

.btn-sm { padding: 8px 18px; font-size: 0.875rem; }
.btn-lg { padding: 15px 32px; }

/* ── Section Label ────────────────────────────────────────── */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #22C7A9;
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
  color: #1B3A6B;
  line-height: 1.2;
  margin-bottom: 14px;
}

.section-desc {
  font-size: 1rem;
  color: #4A5B6F;
  max-width: 600px;
  margin-bottom: 48px;
  line-height: 1.65;
}

/* ════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(27,58,107,.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1B3A6B;
  letter-spacing: -0.02em;
}
.logo-accent { color: #22C7A9; }

/* Desktop nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: #4A5B6F;
  transition: color 0.15s;
}
.nav-link:hover { color: #1B3A6B; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1B3A6B;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(27,58,107,.08);
  background: #fff;
}
.mobile-nav.is-open { display: flex; }
.mobile-nav-link {
  padding: 10px 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: #1C2B40;
  border-bottom: 1px solid rgba(27,58,107,.06);
}
.btn-mobile-cta {
  margin-top: 8px;
  background: #22C7A9;
  color: #fff;
  text-align: center;
  padding: 13px;
  border-radius: 8px;
  font-weight: 700;
  border-bottom: none;
}

/* ════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  background: linear-gradient(160deg, #f4f7fb 0%, #eaf1ff 60%, #d8edea 100%);
  padding-top: 72px;
  padding-bottom: 0;
  overflow: hidden;
}

.hero-inner {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  padding-bottom: 72px;
}

.hero-badge {
  display: inline-block;
  background: rgba(27,58,107,.08);
  color: #1B3A6B;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.hero-headline {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 800;
  color: #1B3A6B;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.headline-accent {
  color: #22C7A9;
  display: inline-block;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: #4A5B6F;
  max-width: 580px;
  margin-inline: auto;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.trust-chips {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.trust-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1C2B40;
  background: rgba(255,255,255,.8);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid rgba(34,199,169,.25);
}

.hero-wave {
  height: 60px;
  margin-top: -1px;
}
.hero-wave svg { width: 100%; height: 100%; }

/* ════════════════════════════════════════════════════════════
   FORM SECTION
   ════════════════════════════════════════════════════════════ */
.form-section {
  background: #fff;
  padding: 72px 0 56px;
}

.form-section .section-desc { margin-bottom: 32px; }

.form-wrapper {
  position: relative;
  background: #fff;
  border: 1.5px solid rgba(27,58,107,.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(27,58,107,.08);
  min-height: 400px; /* Let embed.js handle height */
}

/* Loader */
.iframe-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #f8fafc;
  z-index: 2;
  transition: opacity 0.4s;
}
.iframe-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.iframe-loader p { font-size: 0.9rem; color: #6B7C93; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(27,58,107,.12);
  border-top-color: #22C7A9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Slow-load notice */
.iframe-slow-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.875rem;
  color: #4A3B00;
  margin-top: 12px;
}
.reload-btn {
  font-weight: 600;
  color: #1B3A6B;
  text-decoration: underline;
  font-size: 0.875rem;
  margin-left: 4px;
}
.reload-btn:hover { color: #22C7A9; }

.form-provider-note {
  margin-top: 14px;
  font-size: 0.78rem;
  color: #8A99AA;
  text-align: center;
}

/* ════════════════════════════════════════════════════════════
   HOW IT WORKS
   ════════════════════════════════════════════════════════════ */
.how-section {
  background: #F4F7FB;
  padding: 80px 0;
}

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

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.step-card {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 2px 16px rgba(27,58,107,.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(27,58,107,.07);
  transition: box-shadow 0.2s;
}
.step-card:hover { box-shadow: 0 8px 32px rgba(27,58,107,.1); }

.step-number {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  font-weight: 800;
  color: rgba(27,58,107,.07);
  line-height: 1;
  user-select: none;
}

.step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1B3A6B;
}

.step-desc {
  font-size: 0.9rem;
  color: #4A5B6F;
  line-height: 1.65;
}

/* ════════════════════════════════════════════════════════════
   INFO SECTION
   ════════════════════════════════════════════════════════════ */
.info-section {
  background: #fff;
  padding: 80px 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.info-card {
  border: 1.5px solid rgba(27,58,107,.1);
  border-radius: 14px;
  padding: 28px 24px;
  transition: box-shadow 0.2s;
}
.info-card:hover { box-shadow: 0 6px 28px rgba(27,58,107,.09); }

.info-card-icon {
  margin-bottom: 16px;
}

.info-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1B3A6B;
  margin-bottom: 10px;
}

.info-card-body {
  font-size: 0.875rem;
  color: #4A5B6F;
  line-height: 1.65;
}

.info-link {
  color: #22C7A9;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════
   FAQ SECTION
   ════════════════════════════════════════════════════════════ */
.faq-section {
  background: #F4F7FB;
  padding: 80px 0;
}

.faq-inner { max-width: 760px; }

.faq-list { display: flex; flex-direction: column; gap: 0; }

.faq-item {
  border-bottom: 1px solid rgba(27,58,107,.1);
}
.faq-item:first-child { border-top: 1px solid rgba(27,58,107,.1); }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1B3A6B;
  text-align: left;
  transition: color 0.15s;
}
.faq-question:hover { color: #22C7A9; }
.faq-question[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); }

.faq-chevron {
  flex-shrink: 0;
  color: #22C7A9;
  transition: transform 0.25s ease;
}

.faq-answer {
  font-size: 0.9rem;
  color: #4A5B6F;
  line-height: 1.7;
  padding-bottom: 20px;
  animation: fadeSlide 0.2s ease;
}
.faq-answer a { color: #22C7A9; text-decoration: underline; text-underline-offset: 2px; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.site-footer {
  background: #0F2347;
  color: rgba(255,255,255,.85);
}

.footer-inner {
  display: flex;
  gap: 48px;
  padding-top: 56px;
  padding-bottom: 48px;
  flex-wrap: wrap;
}

.footer-brand {
  flex: 1;
  min-width: 220px;
}
.logo--footer .logo-text { color: #fff; }
.footer-tagline {
  margin-top: 14px;
  font-size: 0.85rem;
  color: rgba(255,255,255,.6);
  line-height: 1.7;
}

.footer-nav {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}
.footer-nav-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-nav-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 4px;
}
.footer-link {
  font-size: 0.875rem;
  color: rgba(255,255,255,.75);
  transition: color 0.15s;
}
.footer-link:hover { color: #22C7A9; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-bottom-inner {
  padding-top: 24px;
  padding-bottom: 28px;
}
.footer-disclaimer {
  font-size: 0.75rem;
  color: rgba(255,255,255,.45);
  line-height: 1.7;
  max-width: 820px;
  margin-bottom: 10px;
}
.footer-copy {
  font-size: 0.78rem;
  color: rgba(255,255,255,.4);
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }

  .hero { padding-top: 48px; }
  .hero-inner { padding-bottom: 56px; }
  .hero-headline { font-size: 2.2rem; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .btn-lg { width: 100%; max-width: 320px; justify-content: center; }

  .form-section { padding: 48px 0 40px; }
  .form-wrapper { border-radius: 12px; min-height: 400px; }

  .how-section { padding: 56px 0; }
  .steps-list { grid-template-columns: 1fr; }

  .info-section { padding: 56px 0; }
  .info-grid { grid-template-columns: 1fr; }

  .faq-section { padding: 56px 0; }

  .footer-inner { flex-direction: column; gap: 32px; padding-top: 40px; padding-bottom: 32px; }
  .footer-nav { gap: 32px; }
}

@media (max-width: 480px) {
  .trust-chips { gap: 8px; }
  .trust-chip { font-size: 0.75rem; padding: 5px 12px; }
}

/* ════════════════════════════════════════════════════════════
   IFRAME — styles moved from body (P0 fix)
   ════════════════════════════════════════════════════════════ */
#application-form {
  height: 840px; /* Fallback before JS loads */
  width: 100%;
  border: none;
  display: block;
}
@media (max-width: 768px) {
  #application-form {
    height: 1000px;
  }
}

/* ════════════════════════════════════════════════════════════
   SCROLL MARGIN — prevents sticky header (64px) from
   covering section headings when navigating via anchor links
   ════════════════════════════════════════════════════════════ */
#application,
#how-it-works,
#important-info,
#faqs,
#top {
  scroll-margin-top: 72px;
}

/* ════════════════════════════════════════════════════════════
   INFO SECTION — heading spacing
   ════════════════════════════════════════════════════════════ */
.info-section .section-title {
  margin-bottom: 32px;
}

/* ════════════════════════════════════════════════════════════
   ACCESSIBILITY — prefers-reduced-motion
   ════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .spinner {
    animation: none;
    border-top-color: transparent;
    border-color: #22C7A9;
  }
}

/* ════════════════════════════════════════════════════════════
   FOCUS STYLES — keyboard navigation
   ════════════════════════════════════════════════════════════ */
:focus-visible {
  outline: 3px solid #22C7A9;
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #22C7A9;
  outline-offset: 3px;
}

/* ------------------------------------------------------------
   STICKY BOTTOM CTA (Mobile)
   ------------------------------------------------------------ */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px 20px;
  /* env(safe-area-inset-bottom) ensures it sits above the iPhone home indicator */
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 24px rgba(27, 58, 107, 0.12);
  z-index: 90;
  display: flex;
  justify-content: center;
  transform: translateY(150%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s;
  opacity: 0;
  pointer-events: none; /* prevent clicks when hidden */
}

.sticky-cta.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sticky-cta .btn {
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(34, 199, 169, 0.3);
}

/* Ensure the footer has enough padding at the bottom so it doesn't get covered by the CTA */
.site-footer {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
  /* Increase padding on mobile just in case */
  .site-footer {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

/* (Optional) Hide on desktop, but since it's responsive and logic controls it, it's fine to show on desktop if the window is small or if they scroll past everything. But typically we hide on desktop. */
@media (min-width: 769px) {
  .sticky-cta {
    display: none !important;
  }
}
