/* ==========================================================================
  Efectes i components globals
  ========================================================================== */

/* --- Línies daurades per <hr> (Solució Final) --- */
.gradient-title,
.gradient-title-alt {
  position: relative;
  display: inline-block;
}

.gradient-title::after,
.gradient-title-alt::after {
  content: "";
  display: block;
  width: clamp(120px, 45%, 220px);
  height: 4px;
  margin-top: 0.45rem;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    var(--color-gold) 0%,
    rgba(183, 154, 84, 0.15) 80%,
    transparent 100%
  );
  box-shadow: 0 6px 20px rgba(183, 154, 84, 0.28);
  margin-right: auto;
}

.gradient-title--center::after,
.gradient-title-alt--center::after {
  margin-left: auto;
  margin-right: auto;
}

.gradient-title-alt--end::after {
  margin-left: auto;
  margin-right: 0;
}

/* Variants d'alineació per a la línia sota els títols */
.gradient-title--center::after,
.gradient-title-alt--center::after{
  margin-left: auto;
  margin-right: auto;      /* centra la barra */
}

.gradient-title--end::after,
.gradient-title-alt--end::after{
  margin-left: auto;       /* empeny la barra cap a la dreta */
  margin-right: 0;
}

/* (opcional) start explícit si el vols forçar en algun cas */
.gradient-title--start::after,
.gradient-title-alt--start::after{
  margin-left: 0;
  margin-right: auto;
}

/* --- Animacions Fade-in amb Scroll --- */
.fade-section {
  opacity: 0;
  transform: translateY(12px);
  will-change: opacity, transform;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Botó de Crida a l'Acció --- */
.button-cta {
  display: inline-block;
  color: var(--color-white);
  background: var(--color-gold) !important;
  border: 1px solid rgba(183, 154, 84, 0.95);
  border-radius: 14px;
  padding: 1rem 1.4rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 2px rgba(183, 154, 84, 0.12),
    0 12px 28px rgba(183, 154, 84, 0.28);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.button-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: inset 0 0 0 2px rgba(183, 154, 84, 0.16),
    0 16px 36px rgba(183, 154, 84, 0.34);
}

.button-cta::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -30%;
  width: 30%;
  transform: skewX(-20deg);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0)
  );
  transition: left 0.4s ease;
  opacity: 0.75;
  pointer-events: none;
}

.button-cta:hover::after {
  left: 110%;
}

/* --- Estil de Text de Títol Compartit --- */
.sec2 h2,
.sec3 h2,
.sec4 h2,
.sec5 h2,
.sec-cta h2 {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  text-shadow: 0 0 10px rgba(183, 154, 84, 0.45);
}

/* ==========================================================================
  Layout de seccions
  ========================================================================== */
.sec1,
.sec2,
.sec3,
.sec4,
.sec5,
.sec-cta {
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* --- Colors de Fons i Text --- */
.sec1 {
  background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 55%, #f0f0f0 100%) !important;
  color: var(--color-black) !important;
}

.sec2,
.sec4,
.sec-cta {
  background: var(--color-black) !important;
  color: var(--color-white) !important;
}

.sec3,
.sec5 {
  background: var(--color-white) !important;
  color: var(--color-black) !important;
}

/* El contingut de les seccions ha d'estar per sobre dels fons i efectes */
.sec1 .container,
.sec2 .container,
.sec3 .container,
.sec4 .container,
.sec5 .container,
.sec-cta .container {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
  Estils específics de seccions
  ========================================================================== */

/* --- SEC1: Hero amb efecte Ripple --- */
#ripple-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.sec1 h1 {
  background-image: linear-gradient(to right, var(--color-gold), #000000b1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

.sec1 h2 {
  color: var(--color-gold);
  font-weight: 800;
}

.img-spin {
  animation: spin 6s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
    box-shadow: 0 0 10px 0 rgba(223, 187, 7, 0.45);
  }
  50% {
    transform: rotate(180deg);
    box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.65);
  }
  100% {
    transform: rotate(360deg);
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.45);
  }
}

/* --- SEC2: Parallax amb Pane --- */
.sec2-pane {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--img);
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.glass-box {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  border-radius: 12px;
}

.sec2 h2 {
  color: var(--color-white);
  text-shadow: 0 0 10px rgba(183, 154, 84, 0.45);
}

.sec2 p {
  color: var(--color-white);
  font-weight: 400;
  font-size: 24px;
}

@media (max-width: 767.98px) {
  .sec2 p {
    font-size: 16px;
  }
}

/* --- SEC3: Centre de formació --- */
/* ... (altres estils) ... */

/* --- SEC3: Centre de formació --- */
.sec3 {
  /* Fons i color de text ja definits a la secció de "Layout de seccions" */
  background: var(--color-white) !important;
  color: var(--color-black) !important;
  position: relative;
  overflow: hidden;
}

.sec3 .ripple-effect {
  position: absolute;
  top: 50%; /* Centrat per defecte */
  left: 50%; /* Centrat per defecte */
  width: 150px; /* Una mida inicial visible */
  height: 150px; /* Una mida inicial visible */
  background-color: var(--gold); /* Un color sòlid per assegurar-nos que es veu */
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.85;
  transform: translate(-50%, -50%) scale(0.25); /* Comencem petit i al centre */
  animation: ripple-expand-sec3 0.9s ease-out forwards;
}

/* L'animació del degradat */
@keyframes ripple-expand-sec3 {
  from {
    transform: translate(-50%, -50%) scale(0.25);
    opacity: 0.85;
    background-color: rgba(183, 154, 84, .5);
  }
  to {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
    background-color: transparent;
  }
}


.sec3 h2 {
  color: var(--color-black);
}



/* --- SEC4: Confiança --- */
#aurora-sec4 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.sec4 h2 {
  color: var(--color-white);
}

/* --- SEC5: Professionals --- */
.bg-auras {
  position: absolute;
  inset: -12%;
  z-index: 0;
  pointer-events: none;
}

.aura {
  position: absolute;
  border-radius: 9999px;
  width: clamp(160px, 22vmin, 340px);
  height: clamp(160px, 22vmin, 340px);
  background: radial-gradient(
    closest-side,
    rgba(183, 154, 84, 0.22),
    rgba(183, 154, 84, 0.1) 55%,
    rgba(183, 154, 84, 0) 72%
  );
  filter: blur(6px) saturate(1.02);
  opacity: 0.9;
  transform: translate3d(0, 0, 0) scale(1);
  animation: aura-float 18s ease-in-out infinite;
  animation-play-state: paused;
}

/* Variacions de mida, posició i ritme */
.a1 {
  top: 10%;
  left: 6%;
  animation-duration: 24s;
}

.a2 {
  top: 65%;
  left: 12%;
  width: clamp(200px, 26vmin, 420px);
  height: clamp(200px, 26vmin, 420px);
  animation-duration: 28s;
}

.a3 {
  top: 20%;
  right: 8%;
  width: clamp(180px, 24vmin, 360px);
  height: clamp(180px, 24vmin, 360px);
  animation-duration: 22s;
}

.a4 {
  bottom: 6%;
  right: 14%;
  animation-duration: 26s;
}

.a5 {
  top: 35%;
  left: 42%;
  animation-duration: 24s;
}

.a6 {
  top: 85%;
  left: 82%;
  width: clamp(200px, 26vmin, 420px);
  height: clamp(200px, 26vmin, 420px);
  animation-duration: 28s;
}

.a7 {
  top: 40%;
  right: 68%;
  width: clamp(180px, 24vmin, 360px);
  height: clamp(180px, 24vmin, 360px);
  animation-duration: 22s;
}

.a8 {
  bottom: 16%;
  right: 14%;
  animation-duration: 26s;
}

.dynamic-bg.is-inview .aura {
  animation-play-state: running;
}

@keyframes aura-float {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.9;
  }
  50% {
    transform: translate3d(20px, -28px, 0) scale(1.06);
    opacity: 0.95;
  }
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.9;
  }
}

.sec5 h2 {
  color: var(--color-black);
}

/* Mòbil: menys càrrega visual (amaga una aura gran) */
@media (max-width: 576px) {
  .a2 {
    display: none;
  }
}

/* --- SEC-CTA: crida a l'acció --- */
/* --- CTA amb fons d'imatge robust --- */
section#cta.sec-cta{
  position: relative;
  isolation: isolate;
  /* alçada generosa perquè es vegi en tots els dispositius */
  min-height: 100vh;
  display: grid;
  place-items: center;

  /* 👇 FEM SERVIR propietats per separat + !important per evitar que cap “background” resumit les tapi */
  background-image: var(--cta-img) !important;  /* --cta-img: url('...') */
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-attachment: scroll !important;     /* mòbil: mai “fixed” */
}

/* Contingut per sobre de l’overlay */
section#cta.sec-cta .container{
  position: relative;
  z-index: 2;
}

/* Enfosquit */
section#cta.sec-cta .overlay{
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(0,0,0,.54) 0%, rgba(0,0,0,.32) 100%);
}

/* Tipografia */
.sec-cta h2,
.sec-cta p{
  color: var(--color-white);
  text-shadow: 0 0 10px rgba(183,154,84,.4);
}
.sec-cta p{
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
}

/* 🖥️ Parallax només en escriptori gran */
@media (min-width: 992px){
  section#cta.sec-cta{
    background-attachment: fixed !important;
  }
}

/* 📱 “Hard fix” iOS: ignora el fixed per evitar el bug */
@supports (-webkit-touch-callout: none){
  section#cta.sec-cta{
    background-attachment: scroll !important;
  }
}


/* ==========================================================================
  Reducció de moviment per a usuaris amb preferències
  ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .sec1 .ripple,
  .sec2__bg,
  .aura {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }

  .fade-section {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }

  .sec2-pane,
  #cta.sec-cta {
    background-attachment: scroll !important;
  }
}