:root {
  --primary: #cf1002;
  --secondary: #757575;
  --light: #f3f6f8;
  --dark: #0c2b4b;
}

.py-6 {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

.my-6 {
  margin-top: 6rem;
  margin-bottom: 6rem;
}

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

/*** Spinner ***/
#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;
}

/*** Button ***/
.btn {
  font-weight: 500;
  transition: 0.5s;
}

.btn.btn-primary,
.btn.btn-outline-primary:hover {
  color: #ffffff;
}

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

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

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

.btn-square,
.btn-sm-square,
.btn-lg-square {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: normal;
}

/*** Navbar ***/
.navbar.sticky-top {
  top: -100px;
  transition: 0.5s;
}

.navbar .navbar-brand,
.navbar a.btn {
  height: 80px;
}

.navbar .navbar-nav .nav-link {
  margin-right: 30px;
  padding: 25px 0;
  color: var(--dark);
  font-weight: 500;
  text-transform: uppercase;
  outline: none;
}

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

.navbar .dropdown-toggle::after {
  border: none;
  content: "\f107";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  vertical-align: middle;
  margin-left: 8px;
}

@media (max-width: 991.98px) {
  .navbar .navbar-nav .nav-link {
    margin-right: 0;
    padding: 10px 0;
  }

  .navbar .navbar-nav {
    border-top: 1px solid #eeeeee;
  }
}

@media (min-width: 992px) {
  .navbar .nav-item .dropdown-menu {
    display: block;
    border: none;
    margin-top: 0;
    top: 150%;
    opacity: 0;
    visibility: hidden;
    transition: 0.5s;
  }

  .navbar .nav-item:hover .dropdown-menu {
    top: 100%;
    visibility: visible;
    transition: 0.5s;
    opacity: 1;
  }
}

/*** Header ***/
.carousel-caption {
  height: 9rem;

  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(39, 39, 39, 0.459);
  z-index: 1;
}

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

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
  background-color: var(--primary);
  border: 10px solid var(--primary);
}

@media (max-width: 768px) {
  #header-carousel .carousel-item {
    position: relative;
    min-height: 450px;
  }

  #header-carousel .carousel-item img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.page-header {
  background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.75)),
    url(../img/carousel-1.jpg) center center no-repeat;
  background-size: cover;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: #999999;
}

/*** Facts ***/
@media (min-width: 991.98px) {
  .facts {
    position: relative;
    margin-top: -75px;
    z-index: 1;
  }
}

/*** Courses ***/
.courses {
  min-height: 100vh;
  background: linear-gradient(
      rgba(255, 255, 255, 0.9),
      rgba(255, 255, 255, 0.9)
    ),
    url(../img/carousel-1.jpg) center center no-repeat;
  background-attachment: fixed;
  background-size: cover;
}

.courses-item .courses-overlay {
  position: absolute;
  width: 100%;
  height: 0;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  opacity: 0;
  transition: 0.5s;
}

.courses-item:hover .courses-overlay {
  height: 100%;
  opacity: 1;
}

/*** Team ***/
.team-items {
  margin: -0.75rem;
}

.team-item {
  padding: 0.75rem;
}

.team-item::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 0;
  top: 0;
  left: 0;
  background: #ffffff;
  transition: 0.5s;
  z-index: -1;
}

.team-item:hover::after {
  height: 100%;
  background: var(--primary);
}

.team-item .team-social {
  position: absolute;
  width: 100%;
  height: 0;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  overflow: hidden;
  opacity: 0;
  transition: 0.5s;
}

.team-item:hover .team-social {
  height: 100%;
  opacity: 1;
}

/*** Testimonial ***/
.testimonial-carousel .owl-dots {
  height: 40px;
  margin-top: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.testimonial-carousel .owl-dot {
  position: relative;
  display: inline-block;
  margin: 0 5px;
  width: 20px;
  height: 20px;
  background: transparent;
  border: 2px solid var(--primary);
  transition: 0.5s;
}

.testimonial-carousel .owl-dot.active {
  width: 40px;
  height: 40px;
  background: var(--primary);
}

.testimonial-carousel .owl-item img {
  width: 150px;
  height: 150px;
}

/*** Footer ***/
.footer .btn.btn-link {
  display: block;
  margin-bottom: 5px;
  padding: 0;
  text-align: left;
  color: var(--light);
  font-weight: normal;
  text-transform: capitalize;
  transition: 0.3s;
}

.footer .btn.btn-link::before {
  position: relative;
  content: "\f105";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--light);
  margin-right: 10px;
}

.footer .btn.btn-link:hover {
  color: var(--primary);
  letter-spacing: 1px;
  box-shadow: none;
}

.copyright {
  background: #092139;
}

.copyright a {
  color: var(--primary);
}

.copyright a:hover {
  color: var(--light);
}

/* ESTILIZANDO POR FORA======================================== */

.logo-img {
  max-height: 70px; /* ajusta conforme o layout do header */
  width: auto;
  object-fit: contain;
}

.hero-content {
  color: #fff;
  text-align: center;
  max-width: 900px;
  padding: 2rem 1rem;
  animation: fadeInUp 0.8s ease-in-out;
}

.hero-title {
  color: #eeeeee;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 2rem;
  opacity: 0.85;
}

/* Galeria de Alunos */
.gallery-item {
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item img {
  width: 100%;
  height: 250px; /* Altura fixa para desktop */
  object-fit: cover; /* Mantém a proporção e preenche o espaço */
  object-position: top center; /* Mantém a parte superior da imagem visível */
  display: block;
  transition: transform 0.3s;
}

/* Responsividade: ajusta a altura em telas menores */
@media (max-width: 768px) {
  .gallery-item img {
    height: 200px;
  }
}

@media (max-width: 576px) {
  .gallery-item img {
    height: 450px;
  }
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1050;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  border-radius: 10px;
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.close:hover {
  color: #bbb;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: none; /* aparece apenas ao rolar */
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  z-index: 999;
  transition: all 0.3s ease;
}

.back-to-top:hover {
  transform: translateY(-5px);
}

/* ================= HERO ANIMADO - versão final sincronizada ================= */

/* ================= HERO ANIMADO - Via Pública ================= */
/* Variáveis de controlo */
:root {
  --vp-vehicle-dur: 12s;
  --vp-sky-color-top: #0b2a33;
  --vp-sky-color-bottom: #07121a;
}

/* manter overflow visível (bootstrap pode cortar) */
#header-carousel,
#header-carousel .carousel-inner,
#header-carousel .carousel-item {
  overflow: visible !important;
}

/* hero container */
.hero-animated-bg {
  position: relative;
  width: 100%;
  height: 520px;
  min-height: 360px;
  overflow: visible;
  background-color: var(--vp-sky-color-bottom);
  pointer-events: none; /* caption mantém pointer-events:auto */
  z-index: 0;
}

/* SVG sky fills area */
.hero-animated-bg .sky-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Clouds (light, slow movement) */
.hero-animated-bg .cloud {
  will-change: transform;
  opacity: 0.92;
}
.hero-animated-bg .cloud.c1 {
  animation: cloudMove 56s linear infinite;
  transform-origin: center;
}
.hero-animated-bg .cloud.c2 {
  animation: cloudMove 88s linear infinite;
  opacity: 0.85;
}
.hero-animated-bg .cloud.c3 {
  animation: cloudMove 110s linear infinite;
  opacity: 0.78;
}

@keyframes cloudMove {
  from {
    transform: translate3d(-12%, 0, 0);
  }
  to {
    transform: translate3d(112%, 0, 0);
  }
}

/* city skyline parallax */
.hero-animated-bg .city-svg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 120px;
  width: 220%;
  height: 180px;
  z-index: 1;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  animation: citySlide 120s linear infinite;
  opacity: 0.96;
}
@keyframes citySlide {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-45%, 0, 0);
  }
}

/* road layer */
.hero-animated-bg .road-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 200px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(10, 12, 14, 0) 0%,
    #14181b 45%,
    #0b0d0f 100%
  );
  overflow: visible;
}

/* lane stripes moving */
.hero-animated-bg .lane-stripes {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 88px;
  width: 80%;
  height: 6px;
  background-image: linear-gradient(
    to right,
    transparent 0 32px,
    #f8f8f8 32px 40px
  );
  background-size: 72px 100%;
  animation: laneMove 0.9s linear infinite;
  opacity: 0.95;
  filter: drop-shadow(0 2px 1px rgba(255, 255, 255, 0.35));
  will-change: background-position;
}
@keyframes laneMove {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -72px 0;
  }
}

/* vehicles base */
.hero-animated-bg .vehicle {
  position: absolute;
  bottom: 92px;
  width: 120px;
  height: auto;
  left: 0;
  z-index: 4;
  pointer-events: none;
  will-change: transform, opacity;
  transform: translate3d(var(--start, -40vw), 0, 0) scale(var(--scale, 1));
  animation-name: drive;
  animation-duration: var(--dur, var(--vp-vehicle-dur));
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-delay: var(--delay, -4s);
  animation-fill-mode: both;
  backface-visibility: hidden;
  filter: drop-shadow(0 10px 12px rgba(255, 255, 255, 0.45));
  opacity: 1;
}

/* tweaks for bike */
.hero-animated-bg .vehicle.v-bike {
  width: 90px;
  bottom: 82px;
}

/* default per-vehicle vars */
.hero-animated-bg .v1 {
  --dur: 12s;
  --delay: -4s;
  --start: -40vw;
  --end: 140vw;
  --scale: 1;
  --y: -6px;
}
.hero-animated-bg .v2 {
  --dur: 12s;
  --delay: -8s;
  --start: -48vw;
  --end: 140vw;
  --scale: 0.92;
  --y: -10px;
}
.hero-animated-bg .v3 {
  --dur: 12s;
  --delay: 0s;
  --start: -30vw;
  --end: 140vw;
  --scale: 0.86;
  --y: -4px;
}

/* animation uses CSS vars */
@keyframes drive {
  0% {
    transform: translate3d(var(--start), 0, 0) scale(var(--scale));
    opacity: 1;
  }
  50% {
    transform: translate3d(
        calc((var(--start) + var(--end)) / 2),
        var(--y, 0),
        0
      )
      scale(calc(var(--scale) + 0.02));
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--end), 0, 0) scale(var(--scale));
    opacity: 1;
  }
}

/* headlight glow */
.hero-animated-bg .vehicle .headlight {
  position: absolute;
  width: 40px;
  height: 14px;
  bottom: 16px;
  background: radial-gradient(
    ellipse at left,
    rgba(255, 240, 190, 0.95) 0%,
    rgba(255, 240, 190, 0.12) 40%,
    rgba(255, 255, 255, 0.03) 70%,
    transparent 100%
  );
  filter: blur(8px);
  opacity: 0.85;
  pointer-events: none;
}
.hero-animated-bg .vehicle .headlight.left {
  left: 62px;
  transform: rotate(-12deg);
}
.hero-animated-bg .vehicle .headlight.right {
  left: 88px;
  transform: rotate(12deg);
}

.carousel-caption {
  position: absolute;
  z-index: 6;
  top: 50%; /* centraliza verticalmente */
  left: 50%; /* centraliza horizontalmente */
  transform: translate(-50%, -50%);
  width: 90%; /* ocupa quase toda a tela em mobile */
  max-width: 900px; /* limite em desktop */
  text-align: center;
  color: #fff;
  text-shadow: 0 6px 18px rgba(255, 255, 255, 0.6);
  pointer-events: auto;
  padding: 0 1rem; /* garante espaçamento em telas pequenas */
  overflow-wrap: normal;
  word-break: keep-all;
  white-space: normal;
}

/* mobile tweaks */
@media (max-width: 575.98px) {
  .carousel-caption {
    width: 95%; /* mais espaço em telas pequenas */
    padding: 0 0.5rem;
  }

  .hero-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
  }

  .hero-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  }
}

/* Buttons layout */
.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  pointer-events: auto;
}
.hero-buttons .btn {
  white-space: nowrap;
  min-width: 150px;
}

/* Typography scaling */
.hero-title {
  font-size: clamp(1.25rem, 5vw, 2.6rem);
  margin: 0 0 0.3rem 0;
}
.hero-subtitle {
  font-size: clamp(0.95rem, 2.6vw, 1.25rem);
  margin: 0 0 0.8rem 0;
}

/* ================= Responsividade / performance ================= */

/* mobile: reduz a complexidade — mantém céu e skyline, esconde veículos */
@media (max-width: 767.98px) {
  .hero-animated-bg {
    height: 420px;
    min-height: 280px;
  }

  /* mostra veículos, mas reduz custo: esconde apenas v3, reduz escala e velocidade */
  .hero-animated-bg .vehicle {
    display: block;
    opacity: 0.95;
    width: 90px;
    bottom: 72px;
    will-change: transform, opacity;
    animation-timing-function: linear;
    /* aumenta duração geral para reduzir movimentação aparente */
    animation-duration: calc(var(--dur, 12s) * 1.5);
    transform: translate3d(var(--start, -40vw), 0, 0)
      scale(calc(var(--scale, 1) * 0.85));
    pointer-events: none;
  }

  /* mantém só 2 veículos em telas pequenas para poupar */
  .hero-animated-bg .v3 {
    display: none;
  }

  /* garante SVG responsivo dentro do veículo */
  .hero-animated-bg .vehicle svg {
    width: 100%;
    height: auto;
    display: block;
  }

  .hero-animated-bg .lane-stripes {
    bottom: 72px;
    width: 95%;
  }
}

/* muito pequeno: fallback para imagem se preferires (ou mantém o acima) */
@media (max-width: 575.98px) {
  /* se preferires fallback total, descomenta a linha de baixo:
  .hero-animated-bg { background-image:url("img/alunos/12.jpg"); background-size:cover; background-position:center; }
  */
  .carousel-caption {
    padding: 12px;
    max-width: 92%;
    font-size: 0.95rem;
    transform: translate(-50%, -50%);
  }
}

/* altura curta */
@media (max-height: 500px) {
  .hero-animated-bg {
    height: 360px;
    min-height: 240px;
  }
  .hero-animated-bg .lane-stripes {
    bottom: 64px;
  }
  .hero-animated-bg .vehicle {
    bottom: 72px;
  }
}

/* reduced motion: respeitar utilizador */
@media (prefers-reduced-motion: reduce) {
  .hero-animated-bg .cloud,
  .hero-animated-bg .city-svg,
  .hero-animated-bg .lane-stripes,
  .hero-animated-bg .vehicle {
    animation: none !important;
    animation-play-state: paused !important;
  }
  /* opcional: mostrar fallback estático */
  /* .hero-animated-bg { background-image:url("img/alunos/12.jpg"); background-size:cover; background-position:center; } */
}

/* utilitário para pausar via JS quando slide inactivo */
.hero-animated-bg.anim-paused .cloud,
.hero-animated-bg.anim-paused .city-svg,
.hero-animated-bg.anim-paused .lane-stripes,
.hero-animated-bg.anim-paused .vehicle {
  animation-play-state: paused !important;
}

/* cor padrão da moto */
.hero-animated-bg .v-bike {
  color: #ffffff;
}

/* se quiser mudar só as rodas / frame separadamente, use seletores */
.hero-animated-bg .v-bike svg .bike-wheel {
  fill: currentColor;
}
.hero-animated-bg .v-bike svg .bike-frame {
  stroke: currentColor;
}

/* === Mobile: mostra veículos leves e faz a moto colorível via currentColor === */
@media (max-width: 767.98px) {
  .hero-animated-bg {
    height: 420px;
    min-height: 280px;
  }
  .hero-animated-bg .vehicle {
    display: block;
    width: 90px;
    bottom: 72px;
    animation-duration: calc(var(--dur, 12s) * 1.5);
    transform: translate3d(var(--start, -40vw), 0, 0)
      scale(calc(var(--scale, 1) * 0.85));
  }
  .hero-animated-bg .v3 {
    display: none;
  } /* só 2 veículos em mobile */
  .hero-animated-bg .vehicle svg {
    width: 100%;
    height: auto;
    display: block;
  }

  /* cor da moto (padrão) - altere aqui para trocar no site inteiro */
  .hero-animated-bg .v-bike {
    color: #2ecc71;
  }
}

/* --- MAPA RESPONSIVO --- */
.map-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.map-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.hero-animated-bg .city-svg {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  max-width: 2200px;
  height: 180px;
  bottom: 120px;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
}

@media (min-width: 768px) {
  #header-carousel,
  #header-carousel .carousel-inner,
  #header-carousel .carousel-item {
    overflow: visible !important;
  }
}

@media (max-width: 767.98px) {
  .hero-animated-bg {
    overflow-x: hidden;
  }
  .hero-animated-bg .city-svg {
    width: 120%;
  }
}

html,
body {
  overflow-x: hidden;
}

.fundão {
  background: #092139;
}
