/* ================================================
   FLOATING UI — Indigo Card USA
   Mobile (<768px): sticky "Apply Now" pill
   Tablet/Desktop (>=768px): back-to-top button w/ progress ring
   Both stay hidden while the hero is on screen.
   ================================================ */

/* ---------- Mobile: Apply Now pill ---------- */
.fab-apply {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  display: none;
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
  transition: transform .45s cubic-bezier(.2,.9,.3,1.2), opacity .3s ease;
}
.fab-apply.show { transform: translateY(0); opacity: 1; pointer-events: auto; }

.fab-apply-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 60px;
  padding: 0 64px 0 28px;
  border-radius: 999px;
  background: var(--lime, #C7F26B);
  color: var(--forest-900, #0A1F14);
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 800; font-size: 1.08rem; letter-spacing: -0.01em;
  text-decoration: none !important;
  border: 2px solid var(--forest-900, #0A1F14);
  box-shadow: 0 16px 34px rgba(10,31,20,.32), 0 4px 10px rgba(10,31,20,.18);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease;
}
.fab-apply-btn:active { transform: scale(.97); }
.fab-apply-btn:hover { color: var(--forest-900, #0A1F14); }

/* Arrow badge on the right */
.fab-apply-ico {
  position: absolute; right: 7px; top: 50%;
  width: 44px; height: 44px; margin-top: -22px;
  border-radius: 50%;
  background: var(--forest-900, #0A1F14);
  color: var(--lime, #C7F26B);
  display: grid; place-items: center;
}
.fab-apply-ico svg { width: 20px; height: 20px; animation: fabNudge 2.4s ease-in-out infinite; }

/* Small lock badge on the left */
.fab-apply-lock {
  position: absolute; left: 10px; top: 50%;
  width: 36px; height: 36px; margin-top: -18px;
  border-radius: 50%;
  background: rgba(10,31,20,.08);
  display: grid; place-items: center;
}
.fab-apply-lock svg { width: 16px; height: 16px; }

/* Soft shine sweep */
.fab-apply-btn::after {
  content: '';
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg);
  animation: fabShine 4.5s ease-in-out infinite;
}
@keyframes fabShine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
@keyframes fabNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }

/* ---------- Tablet / Desktop: back to top ---------- */
.fab-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 9998;
  width: 58px; height: 58px;
  border: 0; padding: 0;
  border-radius: 50%;
  background: var(--forest-900, #0A1F14);
  color: var(--lime, #C7F26B);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(10,31,20,.28);
  opacity: 0;
  transform: translateY(18px) scale(.85);
  pointer-events: none;
  transition: opacity .3s ease, transform .35s cubic-bezier(.2,.9,.3,1.3), background .2s, color .2s;
}
.fab-top.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.fab-top:hover { background: var(--lime, #C7F26B); color: var(--forest-900, #0A1F14); transform: translateY(-4px) scale(1); }
.fab-top:focus-visible { outline: 3px solid var(--lime, #C7F26B); outline-offset: 3px; }
.fab-top .fab-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.fab-top .fab-ring circle { fill: none; stroke-width: 3; }
.fab-top .fab-ring .trk { stroke: rgba(199,242,107,.18); }
.fab-top .fab-ring .bar { stroke: var(--lime, #C7F26B); stroke-linecap: round; stroke-dasharray: 157.08; stroke-dashoffset: 157.08; transition: stroke-dashoffset .1s linear; }
.fab-top:hover .fab-ring .trk { stroke: rgba(10,31,20,.15); }
.fab-top:hover .fab-ring .bar { stroke: var(--forest-900, #0A1F14); }
.fab-top .fab-arrow { width: 22px; height: 22px; position: relative; }
.fab-top .fab-tip {
  position: absolute; right: 70px; top: 50%; transform: translateY(-50%);
  background: var(--forest-900, #0A1F14); color: #fff;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
  padding: 6px 12px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.fab-top:hover .fab-tip { opacity: 1; }

/* ---------- Breakpoints ---------- */
@media (max-width: 767px) {
  .fab-apply { display: block; }
  .fab-top { display: none; }
  .site-footer, .legal-footer { padding-bottom: 110px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .fab-apply, .fab-top { transition: opacity .2s; }
  .fab-apply-btn::after, .fab-apply-ico svg { animation: none; }
}
