/* ===================== BASE & RESET ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================== NAVBAR ===================== */
.navbar-scrolled,
.navbar-menu-open {
  background: rgba(8, 18, 50, 0.95) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.logo-wordmark {
  color: #ffffff;
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 800;
  margin-left: 0.075rem;
  white-space: nowrap;
  text-shadow:
    -1px 0 0 #264482,
    1px 0 0 #264482,
    0 -1px 0 #264482,
    0 1px 0 #264482,
    -1px -1px 0 #264482,
    1px -1px 0 #264482,
    -1px 1px 0 #264482,
    1px 1px 0 #264482;
  transition:
    color 0.3s ease,
    text-shadow 0.3s ease;
}

.navbar-scrolled .logo-wordmark,
.navbar-menu-open .logo-wordmark {
  color: #264482;
  text-shadow:
    -1px 0 0 rgba(255, 255, 255, 0.95),
    1px 0 0 rgba(255, 255, 255, 0.95),
    0 -1px 0 rgba(255, 255, 255, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.95),
    -1px -1px 0 rgba(255, 255, 255, 0.95),
    1px -1px 0 rgba(255, 255, 255, 0.95),
    -1px 1px 0 rgba(255, 255, 255, 0.95),
    1px 1px 0 rgba(255, 255, 255, 0.95);
}

#navbar a {
  min-width: 0;
}

#mobileMenuBtn {
  flex-shrink: 0;
}

.nav-link {
  position: relative;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-link:hover {
  transform: translateY(-2px);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* ===================== FLOATING ANIMATION ===================== */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* ===================== STROBE FLASH ===================== */
@keyframes strobeFlash {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(32, 65, 132, 0);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 20px 8px rgba(32, 65, 132, 0.35);
  }
}

.strobe-flash {
  animation: strobeFlash 2s ease-in-out infinite;
}

/* ===================== SCROLL REVEAL ANIMATIONS ===================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Slide in from left */
.slide-in-left {
  transform: translateX(-60px) translateY(0);
}

.slide-in-left.revealed {
  transform: translateX(0) translateY(0);
}

/* Slide in from right */
.slide-in-right {
  transform: translateX(60px) translateY(0);
}

.slide-in-right.revealed {
  transform: translateX(0) translateY(0);
}

/* ===================== CAROUSEL ===================== */
.carousel-slide {
  will-change: opacity;
}

.carousel-slide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(
      280px,
      var(--hero-media-col-max, 640px)
    );
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.carousel-copy {
  max-width: 42rem;
  text-align: left;
}

.carousel-copy h4 {
  margin-left: 0;
  margin-right: 0;
}

.authorized-badge {
  border: 1px solid transparent;
  font-family: "Arial Black", Arial, sans-serif;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.hero-slide-image {
  width: var(--hero-image-width, 420px);
  max-width: 100%;
  height: var(--hero-image-height, auto);
  max-height: 30rem;
  justify-self: center;
}

.carousel-dot.active-dot {
  background: white;
  width: 2rem;
  border-radius: 9999px;
}

/* ===================== PRODUCT CARDS ===================== */
.product-card {
  will-change: transform, box-shadow;
}

.product-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #332086, #207386);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover::after {
  transform: scaleX(1);
}

/* ===================== PRODUCT TABS ===================== */
.product-tab {
  cursor: pointer;
  user-select: none;
}

.product-tab.active-tab {
  background: #204184;
  color: white;
  border-color: #204184;
}

/* ===================== PARTNER LOGOS ===================== */
.partner-logo {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.partner-logo:hover {
  transform: scale(1.05);
}

/* ===================== FORM STYLES ===================== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-text-fill-color: white;
  -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.1) inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* ===================== BACK TO TOP ===================== */
#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===================== CUSTOM SCROLLBAR ===================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* ===================== SELECTION ===================== */
::selection {
  background: rgba(32, 65, 132, 0.2);
  color: #081232;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1280px) {
  #navbar img {
    width: 5rem;
    height: 5rem;
  }

  .logo-wordmark {
    font-size: 1rem;
    line-height: 1.15;
  }

  #beranda {
    min-height: 720px;
  }

  .carousel-slide > .relative {
    padding-top: 6rem;
    padding-bottom: 6.5rem;
  }

  .carousel-slide-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    justify-items: center;
  }

  .carousel-copy {
    max-width: 42rem;
    text-align: center;
  }

  .carousel-copy h3 {
    font-size: 2.75rem;
    line-height: 1.05;
  }

  .carousel-copy h4 {
    max-width: 34rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
  }

  .carousel-copy a {
    justify-content: center;
  }

  .hero-slide-image {
    width: min(72vw, var(--hero-image-width, 360px));
    height: auto;
    max-height: 16rem;
    order: -1;
  }

  #prevSlide,
  #nextSlide {
    top: auto;
    bottom: 4.75rem;
    width: 2.75rem;
    height: 2.75rem;
    transform: none;
  }
}

@media (max-width: 1280px) and (orientation: landscape) and (max-height: 820px) {
  #beranda {
    min-height: 620px;
  }

  .carousel-slide > .relative {
    padding-top: 4.75rem;
    padding-bottom: 4.75rem;
  }

  .carousel-slide-layout {
    gap: 0.875rem;
  }

  .carousel-copy h3 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .carousel-copy h4 {
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 1rem;
  }

  .carousel-copy .mb-8 {
    margin-bottom: 1rem;
  }

  .authorized-badge {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
  }

  .hero-slide-image {
    width: min(42vw, var(--hero-image-width, 240px));
    max-height: 10rem;
  }

  #prevSlide,
  #nextSlide {
    bottom: 3.25rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  #carousel > .absolute.bottom-8 {
    bottom: 1.75rem;
  }
}

@media (max-width: 1280px) {
  .hidden.xl\:flex {
    display: none !important;
  }

  button.xl\:hidden {
    display: inline-block !important;
  }

  #mobileMenu.xl\:hidden:not(.hidden) {
    display: block !important;
  }

  .xl\:grid-cols-2,
  .xl\:grid-cols-3,
  .xl\:grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }

  .xl\:col-span-2 {
    grid-column: span 1 / span 1 !important;
  }

  .xl\:flex-row {
    flex-direction: column !important;
  }
}

@media (hover: none) and (pointer: coarse) and (max-width: 1366px) {
  #navbar img {
    width: 5rem;
    height: 5rem;
  }

  .logo-wordmark {
    font-size: 1rem;
    line-height: 1.15;
  }

  #beranda {
    min-height: 720px;
  }

  .carousel-slide > .relative {
    padding-top: 6rem;
    padding-bottom: 6.5rem;
  }

  .hidden.xl\:flex {
    display: none !important;
  }

  button.xl\:hidden {
    display: inline-block !important;
  }

  #mobileMenu.xl\:hidden:not(.hidden) {
    display: block !important;
  }

  .xl\:grid-cols-2,
  .xl\:grid-cols-3,
  .xl\:grid-cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }

  .xl\:col-span-2 {
    grid-column: span 1 / span 1 !important;
  }

  .xl\:flex-row {
    flex-direction: column !important;
  }

  .carousel-slide-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    justify-items: center;
  }

  .carousel-copy {
    max-width: 42rem;
    text-align: center;
  }

  .carousel-copy h3 {
    font-size: 2.75rem;
    line-height: 1.05;
  }

  .carousel-copy h4 {
    max-width: 34rem;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
  }

  .carousel-copy a {
    justify-content: center;
  }

  .hero-slide-image {
    width: min(72vw, var(--hero-image-width, 360px));
    height: auto;
    max-height: 16rem;
    order: -1;
  }

  #prevSlide,
  #nextSlide {
    top: auto;
    bottom: 4.75rem;
    width: 2.75rem;
    height: 2.75rem;
    transform: none;
  }
}

@media (hover: none) and (pointer: coarse) and (max-width: 1366px) and (orientation: landscape) and (max-height: 820px) {
  #beranda {
    min-height: 620px;
  }

  .carousel-slide > .relative {
    padding-top: 4.75rem;
    padding-bottom: 4.75rem;
  }

  .carousel-slide-layout {
    gap: 0.875rem;
  }

  .carousel-copy h3 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .carousel-copy h4 {
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 1rem;
  }

  .carousel-copy .mb-8 {
    margin-bottom: 1rem;
  }

  .authorized-badge {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
  }

  .hero-slide-image {
    width: min(42vw, var(--hero-image-width, 240px));
    max-height: 10rem;
  }

  #prevSlide,
  #nextSlide {
    bottom: 3.25rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  #carousel > .absolute.bottom-8 {
    bottom: 1.75rem;
  }
}

@media (hover: none) and (pointer: coarse) and (max-width: 932px) {
  #navbar img {
    width: 3.25rem;
    height: 3.25rem;
  }

  .logo-wordmark {
    font-size: 0.75rem;
    line-height: 1.2;
    margin-left: 0.075rem;
  }
}

@media (max-width: 640px) {
  #navbar img {
    width: 3.25rem;
    height: 3.25rem;
  }

  .logo-wordmark {
    font-size: 0.75rem;
    line-height: 1.2;
    margin-left: 0.075rem;
  }

  #beranda {
    min-height: 680px;
  }

  .carousel-slide > .relative {
    padding-top: 5.5rem;
    padding-bottom: 6rem;
  }

  .carousel-slide-layout {
    gap: 1.25rem;
  }

  .carousel-copy h3 {
    font-size: 2.25rem;
  }

  .carousel-copy h4 {
    font-size: 1rem;
    line-height: 1.5;
  }

  .authorized-badge {
    padding: 0.625rem 1rem;
  }

  .authorized-badge span {
    font-size: 0.75rem;
  }

  .hero-slide-image {
    width: min(76vw, var(--hero-image-width, 300px));
    max-height: 13rem;
  }

  #prevSlide {
    left: 1rem;
  }

  #nextSlide {
    right: 1rem;
  }
}

@media (max-width: 380px) {
  #navbar img {
    width: 2.75rem;
    height: 2.75rem;
  }

  .logo-wordmark {
    font-size: 0.65rem;
    margin-left: 0.05rem;
  }
}

/* ===================== REDUCED MOTION ===================== */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .animate-float {
    animation: none;
  }

  .strobe-flash {
    animation: none;
  }

  .carousel-slide {
    transition: none;
  }

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
