/* HypothequeGo.ca — motion layer (respects reduced motion) */

html {
  -webkit-text-size-adjust: 100%;
}

@keyframes rfm-fade-up {
  from {
    opacity: 0;
    transform: translateY(1.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rfm-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rfm-slide-down {
  from {
    opacity: 0;
    transform: translateY(-0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rfm-ken-burns {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.rfm-header-enter {
  animation: rfm-slide-down 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  padding-top: env(safe-area-inset-top, 0);
}

.rfm-hero-media {
  overflow: hidden;
}

.rfm-hero-media > img:first-child {
  animation: rfm-ken-burns 22s ease-in-out infinite alternate;
  will-change: transform;
}

.rfm-hero-fade > *:nth-child(1) {
  animation: rfm-fade-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}
.rfm-hero-fade > *:nth-child(2) {
  animation: rfm-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}
.rfm-hero-fade > *:nth-child(3) {
  animation: rfm-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}
.rfm-hero-fade > *:nth-child(4) {
  animation: rfm-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
}

.rfm-trust-item {
  animation: rfm-fade-in 0.65s ease-out both;
}
.rfm-trust-item:nth-child(1) { animation-delay: 0.12s; }
.rfm-trust-item:nth-child(2) { animation-delay: 0.22s; }
.rfm-trust-item:nth-child(3) { animation-delay: 0.32s; }
.rfm-trust-item:nth-child(4) { animation-delay: 0.42s; }

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(2rem);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.4s; }
.reveal-delay-6 { transition-delay: 0.48s; }

.rfm-card-lift {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.rfm-card-lift:hover {
  transform: translateY(-0.35rem);
}

.rfm-icon-pop {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.group:hover .rfm-icon-pop {
  transform: scale(1.08);
}

.rfm-pop-in {
  animation: rfm-fade-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.45s both;
}

/* Mobile nav panel — animated open/close (replaces instant .hidden toggle) */
.rfm-mobile-menu-panel {
  transition:
    max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    padding-top 0.28s ease,
    padding-bottom 0.28s ease;
  max-height: min(85vh, 720px);
  opacity: 1;
  overflow: hidden;
}

.rfm-mobile-menu-panel.rfm-mobile-menu-panel--closed {
  max-height: 0 !important;
  opacity: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

/* Mobile drawer: same spacing when open (do not override closed-state padding animation) */
#mobile-menu.rfm-mobile-menu-panel:not(.rfm-mobile-menu-panel--closed) {
  gap: 1rem !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

#mobile-menu.rfm-mobile-menu-panel > a {
  display: block !important;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.75rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
  transform: none !important;
}

#mobile-menu.rfm-mobile-menu-panel > a:not(.cta-gradient) {
  color: rgb(51 65 85) !important;
  border: none !important;
  box-shadow: none !important;
}

#mobile-menu.rfm-mobile-menu-panel > a:not(.cta-gradient):hover {
  background-color: rgb(248 250 252) !important;
  color: rgb(29 78 216) !important;
}

#mobile-menu.rfm-mobile-menu-panel > a.text-blue-700,
#mobile-menu.rfm-mobile-menu-panel > a.border-blue-700 {
  background-color: rgb(239 246 255) !important;
  color: rgb(29 78 216) !important;
  font-weight: 600 !important;
}

#mobile-menu.rfm-mobile-menu-panel > a.cta-gradient {
  margin-top: 0.25rem !important;
  text-align: center !important;
  font-weight: 600 !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

/* Primary / secondary CTAs — use alongside existing cta-gradient / borders */
.rfm-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0061a5 0%, #0095f8 100%);
  color: #fff;
  font-weight: 700;
  border-radius: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 28px rgba(0, 97, 165, 0.22);
}

.rfm-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 97, 165, 0.28);
}

.rfm-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-weight: 700;
  border-radius: 0.75rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.rfm-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* Rate trend pills (taux actuels) */
.rfm-rate-trend {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.rfm-rate-trend--down {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.rfm-rate-trend--stable {
  background: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

.rfm-rate-trend--up {
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}

@media (prefers-reduced-motion: reduce) {
  .rfm-header-enter,
  .rfm-hero-media > img:first-child,
  .rfm-hero-fade > *,
  .rfm-trust-item {
    animation: none !important;
    opacity: 1;
  }

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .rfm-pop-in {
    animation: none !important;
    opacity: 1;
  }

  .rfm-mobile-menu-panel {
    transition: none;
  }

  .rfm-card-lift,
  .rfm-icon-pop,
  .rfm-cta-primary,
  .rfm-cta-secondary {
    transition: none !important;
  }

  .rfm-card-lift:hover,
  .group:hover .rfm-icon-pop,
  .rfm-cta-primary:hover,
  .rfm-cta-secondary:hover {
    transform: none !important;
  }
}
