/* === Variables Globales === */
:root {
  --header-h: 90px;
  --main-white: #fff;
  --main-light-grey: #d9dfe4;
  --main-dark-blue: #030a58;
}

main {
  padding-top: var(--header-h) !important;
  padding-bottom: 2rem;
}

section[id]{ 
  scroll-margin-top: calc(var(--header-h) + 8px); 
}

/* === Reset & Global === */
html,
body {
  overflow-x: hidden;
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--main-white);
  color: var(--main-dark-blue);
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* === Conteneur fluide responsive === */
.container {
  width: 100%;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

@media (min-width: 1200px) {
  .container {
    padding: 0 5rem;
  }
}

/* === Links & Buttons Globaux === */
a {
  text-decoration: none;
}

.btn,
button {
  display: inline-block;
  background-color: var(--main-dark-blue);
  color: var(--main-white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .08s ease;
}

.btn:hover,
button:hover {
  background-color: var(--main-light-grey);
  color: var(--main-dark-blue);
}

/* === Header === */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--main-light-grey);
  transform: translateY(0);
  transition: transform .28s ease, box-shadow .2s ease, background-color .2s ease;
}

#site-header.is-scrolled {
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

#site-header.is-hidden {
  transform: translateY(-100%);
}

#site-header.compact .header-inner {
  padding: .5rem .75rem;
  min-height: 54px;
  transition: padding .2s ease, min-height .2s ease;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  padding: 1rem;
}

.header-inner .logo img {
  width: 160px;
}

.header-inner nav {
  flex: 1;
  margin-left: 2rem;
}

.header-inner nav ul {
  display: flex;
  justify-content: space-evenly;
  list-style: none;
}

.header-inner nav a {
  color: var(--main-dark-blue);
  font-weight: 500;
  transition: color 0.2s;
}

.header-inner nav a:hover {
  color: var(--main-white);
}

@media (prefers-reduced-motion: reduce) {
  #site-header {
    transition: none;
  }
}

/* Lang switcher */
.lang-switcher {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
}

.lang-switcher img {
  width: 24px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.lang-switcher img:hover {
  border-color: var(--main-dark-blue);
}

/* Header mobile */
@media (max-width: 767px) {
  .header-inner {
    flex-direction: column;
    padding: 1rem;
  }

  .header-inner nav {
    margin: 1rem 0 0;
    width: 100%;
  }

  .header-inner nav ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 auto;
  }

  .lang-switcher {
    margin: 0.5rem 0 0;
  }
}

/* === Sections générales === */
.welcome,
.mission,
.services,
.power-platform,
.training,
.partnerships {
  margin-top: 3rem;
  text-align: center;
}

/* === Welcome ---*/
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.welcome-text {
  text-align: center;
}

.welcome-text h1 {
  font-size: 4.5em;
  color: var(--main-dark-blue);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.welcome-text p {
  font-size: 1.1em;
  color: var(--main-dark-blue);
  line-height: 1.6;
}

.icon {
  margin-left: auto;
  margin-top: -60px;
}

.icon img {
  width: 100px;
  height: auto;
  color: var(--main-dark-blue);
}

/* mobile → une colonne, icône et texte centrés */
@media (max-width: 767px) {
  .welcome {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .icon {
    justify-self: center;
  }
}

/* === Services Section === */
.services {
  margin-top: 3rem;
  text-align: center;
}

.services h2 {
  font-size: 4.5em;
  margin-top: 3rem;
  text-align: center;
}

.services-subtitle {
  color: var(--main-dark-blue);
  font-size: 1.1em;
  margin-bottom: 1rem;
}

.services-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.service-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: left;
}

.service-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-content h3 {
  margin: 0;
  color: var(--main-dark-blue);
  font-size: 1.1em;
}

.service-content p {
  margin: 0;
  color: var(--main-dark-blue);
  font-size: 0.95em;
  line-height: 1.4;
}

.service-item:nth-child(2),
.service-item:nth-child(4),
.service-item:nth-child(6) {
  background-color: var(--main-light-grey);
}

.service-icon img {
  width: 70px;
  flex: 0 0 auto;
}

@media (min-width: 768px) {
  .services-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* === Power Platform Section === */
.power-platform {
  padding: 3rem 1rem;
}

.power-platform h2 {
  font-size: 4.5em;
}

.pp-subtitle {
  margin-bottom: 2rem;
}

.pp-cards {
  display: grid;
  gap: 1.5rem;
  margin: 0 auto;
}

.pp-cards {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .pp-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pp-card {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.75rem 2rem;
  background-color: var(--main-dark-blue);
  border-radius: 8px;
}

.pp-icon img {
  width: 60px;
}

.pp-card h3 {
  color: var(--main-white);
  font-size: 1.6em;
  margin-bottom: 0.5rem;
}

.pp-card p {
  color: var(--main-light-grey);
  font-size: 1em;
}

/* boutton Contact */
.btn-container {
  margin-top: 2rem;
}

/* === Partnerships Section === */
.partnerships h2 {
  font-size: 4.5em;
}

.partnerships-subtitle {
  color: var(--main-dark-blue);
  margin-bottom: 2rem;
}

.partnerships-list {
  display: grid;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  justify-items: center;
}

.partner-card {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--main-white);
  box-shadow: 10px 5px 5px var(--main-dark-blue);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 600px;
  width: 100%;
}

.partner-card .partner-link {
  margin: 0 1rem;
}

.partner-logo {
  max-height: 140px;
  height: auto;
}

/* === Training Section === */
.training-header {
  background-color: var(--main-dark-blue);
  color: var(--main-white);
  padding: 2rem 1rem;
  border-radius: 8px 8px 0 0;
}

.training-header h2 {
  font-size: 2em;
}

.training-grid {
  display: grid;
  gap: 1.5rem;
  background: var(--main-white);
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 1.5rem 1rem 2rem;
}

.training-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .training-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .training-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.training-card {
  background: var(--main-white);
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1.5rem 1rem;
  text-align: center;
}

.training-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.training-card h3 {
  color: var(--main-dark-blue);
  font-size: 1.2em;
}

.training-card .btn {
  margin-top: 1rem;
}

/* détails masqués */
.training-detail {
  display: none;
}

.training-card.expanded {
  background-color: var(--main-dark-blue);
  color: var(--main-white);
  border-color: transparent;
}

.training-card.expanded .training-detail {
  display: block;
  padding: 1rem;
}

/* Notes sous la grille */
.training-notes {
  font-size: 0.9em;
  color: var(--main-dark-blue);
}

/* === About Us Section === */
.about {
  margin-top: 3rem;
}

.about-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 5rem;
}

.about-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
}

.about-icon img {
  width: 250px;
  height: auto;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-title h2 {
  font-size: 3.5em;
  margin-bottom: 0.5rem;
}

.about-title h3 {
  font-size: 2em;
  margin-bottom: 1rem;
}

.about-text {
  background-color: var(--main-light-grey);
  color: var(--main-dark-blue);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 800px;
}

.about-text p {
  font-size: 1.2em;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Desktop : side-by-side */
@media (min-width: 768px) {
  .about-wrapper {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
  }

  .about-icon {
    flex: 0 0 auto;
  }

  .about-text {
    flex: 1;
  }
}

/* === Footer === */
.site-footer {
  background-color: var(--main-dark-blue);
  color: var(--main-white);
  text-align: center;
  padding: 1rem 0;
  font-size: 0.9em;
  margin-top: 3rem;
}

.site-footer a {
  color: var(--main-white);
}

.site-footer a:hover {
  color: var(--main-light-grey);
}

/* === GoTop === */
#top {
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  background-color: var(--main-dark-blue);
  color: var(--main-white);
  width: 50px;
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity .25s ease,
    transform .25s ease,
    visibility 0s linear .25s;
}

#top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    opacity .25s ease,
    transform .25s ease,
    visibility 0s;
}

#top:hover {
  background-color: var(--main-light-grey);
  color: var(--main-dark-blue);
}

#top:active {
  transform: scale(.98);
}

#top:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .6);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #top,
  #top.show {
    transition: none;
    transform: none;
  }
}

/* === Cookie Banner === */
#cookie-banner {
  position: fixed;
  inset: auto 10px 10px;
  background: var(--main-white);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  display: none;
  text-align: center;
}

.cookie-btn {
  margin: 5px;
  padding: 10px;
  border-radius: 5px;
}

/* === Cookie Modal === */
.cookie-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.cookie-modal-content {
  background: var(--main-white);
  color: var(--main-dark-blue);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.cookie-modal-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.cookie-modal[hidden] {
  display: none;
}