/* U-Insurance UI animations — respects reduced motion */

:root {
  --ui-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ui-duration: 0.65s;
}

/* Page loader */
body:not(.loaded) .page-loader .spinner-grow {
  animation: ui-loader-pulse 0.85s ease-in-out infinite;
}

body:not(.loaded) .page-loader .spinner-grow:nth-child(2) {
  animation-delay: 0.15s;
}

body:not(.loaded) .page-loader .spinner-grow:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ui-loader-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.55;
  }
}

/* Header entrance */
.ui-navbar {
  animation: ui-nav-in 0.7s var(--ui-ease-out) both;
  animation-delay: 0.15s;
}

@keyframes ui-nav-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll reveal base */
.ui-animate {
  opacity: 0;
  transition:
    opacity var(--ui-duration) var(--ui-ease-out),
    transform var(--ui-duration) var(--ui-ease-out);
  transition-delay: var(--ui-delay, 0ms);
  will-change: opacity, transform;
}

.ui-animate.is-inview {
  opacity: 1;
  transform: none;
}

.ui-fade-up {
  transform: translateY(28px);
}

.ui-fade-in {
  transform: none;
}

.ui-scale-in {
  transform: scale(0.92);
}

.ui-fade-left {
  transform: translateX(-24px);
}

.ui-fade-right {
  transform: translateX(24px);
}

/* Partner cards */
.partner-brand-card {
  transition:
    transform 0.25s var(--ui-ease-out),
    box-shadow 0.25s var(--ui-ease-out);
}

.partner-brand-card:hover {
  transform: translateY(-4px) scale(1.02);
}

.partner-brand-card:hover .partner-brand-logo {
  animation: ui-logo-pop 0.45s var(--ui-ease-out);
}

@keyframes ui-logo-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

/* Service / feature cards */
.in-cirro-8 .card,
.in-cirro-17 .card,
.in-cirro-7 .card {
  transition: transform 0.3s var(--ui-ease-out), box-shadow 0.3s var(--ui-ease-out);
}

.in-cirro-8 .card:hover,
.in-cirro-17 .card:hover,
.in-cirro-7 .card:not(.card-body):hover {
  transform: translateY(-3px);
}

/* Primary CTAs */
.btn-info,
.btn-warning {
  transition:
    transform 0.2s var(--ui-ease-out),
    box-shadow 0.2s var(--ui-ease-out);
}

.btn-info:hover,
.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.35rem 1rem rgba(26, 92, 150, 0.25);
}

.btn-info:active,
.btn-warning:active {
  transform: translateY(0);
}

/* Carousel caption */
#main-slideshow .carousel-item.active .carousel-caption h1,
#main-slideshow .carousel-item.active .carousel-caption h2,
#main-slideshow .carousel-item.active .carousel-caption .lead,
#main-slideshow .carousel-item.active .carousel-caption .btn {
  animation: ui-caption-in 0.75s var(--ui-ease-out) both;
}

#main-slideshow .carousel-item.active .carousel-caption .lead {
  animation-delay: 0.1s;
}

#main-slideshow .carousel-item.active .carousel-caption .btn {
  animation-delay: 0.2s;
}

@keyframes ui-caption-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Accordion (FAQ) */
.accordion-style-5 .accordion-item {
  transition: box-shadow 0.25s ease;
}

.accordion-style-5 .accordion-button:not(.collapsed) {
  transition: color 0.2s ease;
}

/* To-top button */
.to-top {
  transition: transform 0.25s var(--ui-ease-out), opacity 0.25s ease;
}

.to-top:hover {
  transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ui-animate {
    opacity: 1;
    transform: none;
  }

  .ui-navbar {
    animation: none;
  }
}
