/********** Template CSS **********/
:root {
  /* Remplacez ces valeurs après extraction depuis le logo */
  --brand-1: #004aad; /* couleur principale (ex: bleu) */
  --brand-2: #2f9a6a; /* couleur secondaire (ex: vert) */
  --brand-3: #f4f3f3; /* fonds clair */
  --brand-4: #545454; /* texte sombre */
  --accent: #ffb547; /* accent chaud (optionnel) */

  /* compatibilité */
  --primary: var(--brand-1);
  --secondary: var(--brand-2);
  --light: var(--brand-3);
  --dark: var(--brand-4);
}

/*** Spinner ***/
.spinner {
  width: 40px;
  height: 40px;
  background: var(--primary);
  margin: 100px auto;
  -webkit-animation: sk-rotateplane 1.2s infinite ease-in-out;
  animation: sk-rotateplane 1.2s infinite ease-in-out;
}

@-webkit-keyframes sk-rotateplane {
  0% {
    -webkit-transform: perspective(120px);
  }
  50% {
    -webkit-transform: perspective(120px) rotateY(180deg);
  }
  100% {
    -webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg);
  }
}

@keyframes sk-rotateplane {
  0% {
    transform: perspective(120px) rotateX(0deg) rotateY(0deg);
    -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
  }
  50% {
    transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
    -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
  }
  100% {
    transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
  }
}

#spinner {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-out, visibility 0s linear 0.5s;
  z-index: 99999;
}

#spinner.show {
  transition: opacity 0.5s ease-out, visibility 0s linear 0s;
  visibility: visible;
  opacity: 1;
}

/*** Heading ***/
h1,
h2,
.fw-bold {
  font-weight: 800 !important;
}

h3,
h4,
.fw-semi-bold {
  font-weight: 700 !important;
}

h5,
h6,
.fw-medium {
  font-weight: 600 !important;
}

/*** Button ***/
.btn {
  font-family: "Nunito", sans-serif;
  font-weight: 600;
  transition: 0.5s;
}

.btn-primary,
.btn-secondary {
  color: #f4f3f3;
  box-shadow: inset 0 0 0 50px transparent;
}

.btn-primary:hover {
  box-shadow: inset 0 0 0 0 var(--primary);
}

.btn-secondary:hover {
  box-shadow: inset 0 0 0 0 var(--secondary);
}

.btn-square {
  width: 36px;
  height: 36px;
}

.btn-sm-square {
  width: 30px;
  height: 30px;
}

.btn-lg-square {
  width: 48px;
  height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

/*** Navbar ***/
.navbar-dark .navbar-nav .nav-link {
  font-family: "Nunito", sans-serif;
  position: relative;
  margin-left: 25px;
  padding: 35px 0;
  color: #f4f3f3;
  font-size: 18px;
  font-weight: 600;
  outline: none;
  transition: 0.5s;
}

.sticky-top.navbar-dark .navbar-nav .nav-link {
  padding: 20px 0;
  color: var(--dark);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: var(--primary);
}

.navbar-dark .navbar-brand h1 {
  color: #f4f3f3;
}

.navbar-dark .navbar-toggler {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

@media (max-width: 991.98px) {
  .sticky-top.navbar-dark {
    position: relative;
    background: #f4f3f3;
  }

  .navbar-dark .navbar-nav .nav-link,
  .navbar-dark .navbar-nav .nav-link.show,
  .sticky-top.navbar-dark .navbar-nav .nav-link {
    padding: 10px 0;
    color: var(--dark);
  }

  .navbar-dark .navbar-brand h1 {
    color: var(--primary);
  }
}

@media (min-width: 992px) {
  .navbar-dark {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    border-bottom: 1px solid rgba(256, 256, 256, 0.1);
    z-index: 999;
  }

  .sticky-top.navbar-dark {
    position: fixed;
    background: #f4f3f3;
  }

  .navbar-dark .navbar-nav .nav-link::before {
    position: absolute;
    content: "";
    width: 0;
    height: 2px;
    bottom: -1px;
    left: 50%;
    background: var(--primary);
    transition: 0.5s;
  }

  .navbar-dark .navbar-nav .nav-link:hover::before,
  .navbar-dark .navbar-nav .nav-link.active::before {
    width: 100%;
    left: 0;
  }

  .navbar-dark .navbar-nav .nav-link.nav-contact::before {
    display: none;
  }

  .sticky-top.navbar-dark .navbar-brand h1 {
    color: var(--primary);
  }
}

/*** Carousel ***/
.carousel-caption {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 30, 62, 0.7);
  z-index: 1;
}

@media (max-width: 576px) {
  .carousel-caption h5 {
    font-size: 14px;
    font-weight: 500 !important;
  }

  .carousel-caption h1 {
    font-size: 30px;
    font-weight: 600 !important;
  }
}

.carousel-control-prev,
.carousel-control-next {
  width: 10%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
}

/*** Section Title ***/
.section-title::before {
  position: absolute;
  content: "";
  width: 150px;
  height: 5px;
  left: 0;
  bottom: 0;
  background: var(--primary);
  border-radius: 2px;
}

.section-title.text-center::before {
  left: 50%;
  margin-left: -75px;
}

.section-title.section-title-sm::before {
  width: 90px;
  height: 3px;
}

.section-title::after {
  position: absolute;
  content: "";
  width: 6px;
  height: 5px;
  bottom: 0px;
  background: #f4f3f3;
  -webkit-animation: section-title-run 5s infinite linear;
  animation: section-title-run 5s infinite linear;
}

.section-title.section-title-sm::after {
  width: 4px;
  height: 3px;
}

.section-title.text-center::after {
  -webkit-animation: section-title-run-center 5s infinite linear;
  animation: section-title-run-center 5s infinite linear;
}

.section-title.section-title-sm::after {
  -webkit-animation: section-title-run-sm 5s infinite linear;
  animation: section-title-run-sm 5s infinite linear;
}

@-webkit-keyframes section-title-run {
  0% {
    left: 0;
  }
  50% {
    left: 145px;
  }
  100% {
    left: 0;
  }
}

@-webkit-keyframes section-title-run-center {
  0% {
    left: 50%;
    margin-left: -75px;
  }
  50% {
    left: 50%;
    margin-left: 45px;
  }
  100% {
    left: 50%;
    margin-left: -75px;
  }
}

@-webkit-keyframes section-title-run-sm {
  0% {
    left: 0;
  }
  50% {
    left: 85px;
  }
  100% {
    left: 0;
  }
}

/*** Service ***/
.service-item {
  position: relative;
  height: 300px;
  padding: 0 30px;
  transition: 0.5s;
}

.service-item .service-icon {
  margin-bottom: 30px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: 2px;
  transform: rotate(-45deg);
}

.service-item .service-icon i {
  transform: rotate(45deg);
}

.service-item a.btn {
  position: absolute;
  width: 60px;
  bottom: -48px;
  left: 50%;
  margin-left: -30px;
  opacity: 0;
}

.service-item:hover a.btn {
  bottom: -24px;
  opacity: 1;
}

/*** Miscellaneous ***/
@media (min-width: 991.98px) {
  .facts {
    position: relative;
    /* ===== Responsive improvements ===== */

    /* Fluid base font for better scaling */
    html {
      font-size: clamp(14px, 1.6vw, 18px);
      -webkit-text-size-adjust: 100%;
      -moz-text-size-adjust: 100%;
      text-size-adjust: 100%;
    }

    body {
      font-family: "Nunito", sans-serif;
      line-height: 1.6;
      color: var(--secondary);
      background-color: #f4f3f3;
    }

    /* Container padding */
    .container,
    .container-fluid {
      padding-left: 1rem;
      padding-right: 1rem;
      margin-left: auto;
      margin-right: auto;
      max-width: 1200px;
    }

    /* Make images responsive */
    img,
    .team-item .team-img img,
    .blog-item .blog-img img,
    .carousel-inner img {
      max-width: 100%;
      height: auto;
      display: block;
    }

    /* Spinner responsive */
    .spinner {
      width: 40px;
      height: 40px;
    }
    @media (max-width: 576px) {
      .spinner {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        margin: 40px auto;
      }
    }

    /* Service cards - use auto height and responsive spacing */
    .service-item {
      height: auto;
      min-height: 220px;
      padding: 20px;
    }
    .service-item .service-icon {
      width: 60px;
      height: 60px;
      margin-bottom: 20px;
    }
    .service-item a.btn {
      width: 56px;
      bottom: -32px;
      margin-left: -28px;
    }

    /* Team items & social - better behaviour on small screens */
    .team-item {
      height: auto;
      padding-bottom: 1rem;
    }
    .team-social a.btn {
      margin-top: 60px;
      opacity: 0;
    }
    .team-item:hover .team-social a.btn {
      opacity: 1;
      margin-top: 0;
    }

    /* Carousel caption responsive padding and text scale */
    .carousel-caption {
      padding: 2rem;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
    }
    .carousel-caption h1 {
      font-size: clamp(1.5rem, 3.8vw, 3rem);
      line-height: 1.05;
    }
    .carousel-caption h5 {
      font-size: clamp(0.9rem, 1.8vw, 1.25rem);
    }

    /* Navbar responsive tweaks */
    .navbar-dark .navbar-nav .nav-link {
      padding: 18px 0;
      margin-left: 16px;
      font-size: clamp(14px, 1.4vw, 18px);
    }
    .navbar-brand h1 {
      font-size: clamp(1.2rem, 2.4vw, 2rem);
    }

    /* Buttons sizing on small devices */
    .btn,
    .btn-primary,
    .btn-secondary {
      padding: 0.6rem 1rem;
    }
    .btn-square {
      width: 36px;
      height: 36px;
    }
    @media (max-width: 576px) {
      .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
      }
      .btn-square {
        width: 30px;
        height: 30px;
      }
    }

    /* Section title responsive bar length */
    .section-title::before {
      width: 120px;
    }
    .section-title.section-title-sm::before {
      width: 70px;
    }

    /* Testimonial dots spacing on small screens */
    .testimonial-carousel .owl-dots {
      margin-top: 12px;
    }

    /* Back to top - always visible on larger screens, smaller on mobiles */
    .back-to-top {
      right: 30px;
      bottom: 30px;
      padding: 0.6rem 0.75rem;
    }
    @media (max-width: 576px) {
      .back-to-top {
        right: 16px;
        bottom: 16px;
        padding: 0.45rem 0.5rem;
        border-radius: 8px;
      }
    }

    /* Card responsive */
    .card {
      width: 100%;
      box-sizing: border-box;
    }

    /* Wave decoration adaptative height */
    .wave-decoration::before {
      height: 80px;
      background-size: 200% 100%;
    }

    /* Utility: stacked columns on small screens */
    .row-responsive {
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
    }
    .row-responsive > [class*="col-"] {
      flex: 1 1 100%;
      max-width: 100%;
    }

    /* Breakpoints for layout adjustments */
    @media (max-width: 991.98px) {
      .navbar-dark {
        position: relative;
      }

      .carousel-control-prev,
      .carousel-control-next {
        width: 13%;
      }

      .service-item {
        padding: 18px;
        min-height: 200px;
      }

      .team-social a.btn {
        margin-top: 50px;
      }
    }

    @media (max-width: 767.98px) {
      .navbar-dark .navbar-nav .nav-link,
      .sticky-top.navbar-dark .navbar-nav .nav-link {
        padding: 12px 0;
        margin-left: 8px;
      }

      .carousel-caption {
        padding: 1.2rem;
        background: linear-gradient(
          135deg,
          rgba(0, 102, 204, 0.85),
          rgba(26, 26, 26, 0.85)
        );
      }

      .section-title::before {
        left: 50%;
        margin-left: -45px;
        width: 90px;
      }

      .service-item .service-icon {
        width: 54px;
        height: 54px;
      }

      .team-item .team-img img {
        transform: none;
      }
    }

    @media (max-width: 479.98px) {
      .navbar-dark .navbar-brand h1 {
        font-size: 1.1rem;
      }

      .carousel-caption h1 {
        font-size: 1.4rem;
      }

      .section-title::before {
        width: 70px;
        margin-left: -35px;
      }

      .service-item {
        padding: 14px;
        min-height: 180px;
      }
    }

    /* small accessibility tweaks */
    a,
    button {
      -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
      outline-offset: 2px;
    }
    margin-top: -75px;
    z-index: 1;
  }
}

.back-to-top {
  position: fixed;
  display: none;
  right: 45px;
  bottom: 45px;
  z-index: 99;
}

.bg-header {
  background: linear-gradient(rgba(7, 23, 42, 0.6), rgba(7, 23, 42, 0.6)),
    url(../img/carousel-1.jpg) center center no-repeat;
  background-size: cover;
  color: var(--brand-3);
}

/* Utiliser les variables pour éléments clés */
a,
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active,
.text-brand {
  color: var(--primary);
}

.bg-header {
  color: var(--light);
}

.bg-brand {
  background-color: var(--primary) !important;
  color: #f4f3f3;
}
.bg-brand-2 {
  background-color: var(--secondary) !important;
  color: #f4f3f3;
}

.btn-primary {
  background: var(--primary) !important;
  border-color: transparent !important;
  color: #f4f3f3 !important;
  box-shadow: none;
}
.btn-secondary {
  background: var(--secondary) !important;
  border-color: transparent !important;
  color: #f4f3f3 !important;
}
