:root {
  --main-bg: #101836;
  --accent: #ffe180;
  --title: #fff;
  --card-bg: #2b3e68;
  --text-main: #fff;
  --text-accent: #ffe180;
  --footer-bg: #0e1427f2;
  --menu-bg: #0e1427f2;
  --btn-bg: #5f6270;
  --btn-txt: #101836;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--main-bg);
  color: var(--text-main);
  font-family: 'Montserrat', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  width: 100%;
  background: var(--menu-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  z-index: 20;
  padding-left: 16px;
  padding-right: 12px;
  border-bottom: 1px solid #474b5f;
  box-sizing: border-box;
}

/* Logo Mystia à gauche */
.logo {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 2.7em;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 2px 8px #0005;
  line-height: 1;
  margin-top: 3px;
  margin-bottom: 3px;
  user-select: none;
}

/* Menu desktop centré */
nav.nav-desktop {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
  gap: 38px;
}
nav.nav-desktop a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  padding: 4px 10px;
}
nav.nav-desktop a:hover,
nav.nav-desktop a.active {
  color: var(--accent);
}

/* Actions (lang-switch, burger) à droite */
.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 0;
}

/* Bouton switch langue */
.lang-switch {
  background: var(--btn-bg);
  color: var(--text-main);
  border: none;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1em;
  padding: 5px 18px;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: unset;
  max-width: 210px;
  white-space: nowrap;
  margin-right: 0;
}
.lang-switch:hover {
  background: #fff7d4;
}

/* Burger button (mobile only) */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  background: var(--btn-bg);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  z-index: 1100;
  transition: background 0.2s;
  margin-left: 0;
}
.burger span {
  display: block;
  width: 22px;
  height: 3.2px;
  background: var(--title);
  border-radius: 2px;
  transition: 0.3s;
}

/* Mobile navigation (menu burger) */
nav.nav-mobile {
  display: none;
}

@media (max-width: 700px) {
  header {
    padding: 0 0 0 0;
    height: 62px;
    justify-content: flex-start;
    gap: 0;
  }
  .logo {
    font-size: 2.1em;
    margin: 0 0 0 14px;
  }
  .header-actions {
    margin-left: auto;
    gap: 10px;
    padding-right: 10px;
  }
  .lang-switch {
    font-size: 0.98em;
    padding: 5px 15px;
  }
  nav.nav-desktop {
    display: none !important;
  }
  .burger {
    display: flex;
    z-index: 1200;
    margin-right: 0;
  }
  nav.nav-mobile {
    position: fixed;
    top: 56px;
    right: 8px;
    background: var(--card-bg);
    box-shadow: 0 4px 32px #0007;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 13px 7px 13px 7px;
    z-index: 1500;
    min-width: 180px;
    opacity: 1;
    visibility: visible;
  }
  nav.nav-mobile a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.05em;
    padding: 11px 17px;
    border-radius: 9px;
    margin-bottom: 2px;
    transition: background 0.2s;
  }
  nav.nav-mobile a:hover,
  nav.nav-mobile a.active {
    background: var(--accent);
    color: var(--btn-txt);
  }
  nav.nav-mobile.hide {
    display: none !important;
  }
}

/* Hide burger et mobile nav sur desktop */
@media (min-width: 701px) {
  nav.nav-mobile, .burger {
    display: none !important;
  }
}

/* CONTENU PRINCIPAL */
main {
  padding: 90px 20px 30px 20px;
  max-width: 780px;
  margin: 0 auto;
  flex: 1 0 auto;
}
section {
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 6px 44px #21304e99;
  padding: 36px 26px;
  margin-bottom: 20px;
  z-index: 2;
}
h1, h2 {
  color: var(--title);
  margin-top: 0;
  font-weight: 700;
  text-shadow: 0 2px 8px #0003;
}
h1 {
  font-size: 2.3em;
  margin-bottom: 8px;
}
h2 {
  font-size: 1.6em;
  margin-bottom: 15px;
}

.home-title {
  color: #fff;
  font-size: 2.4em;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 10px;
  margin-top: 24px;
  text-shadow: 0 6px 36px #0009;
  text-align: center;
}
.home-desc {
  font-size: 1.18em;
  color: var(--accent);
  margin-bottom: 25px;
  margin-top: 6px;
  font-weight: 500;
  text-shadow: 0 2px 12px #0006;
  text-align: center;
}
.home-app-badges {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.app-badge {
  height: 42px;
  opacity: 0.95;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0006;
}

.contact-address {
  font-size: 1.15em;
  color: var(--text-main);
  background: #ffe18022;
  display: inline-block;
  padding: 9px 15px;
  border-radius: 14px;
  margin-top: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* --------- FOOTER --------- */
footer {
  background: var(--footer-bg);
  border-top: 1px solid #222b46;
  color: #bfc5df;
  font-size: 0.97em;
  margin-top: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  padding: 0;
}
.footer-link {
  color: #bfc5df;
  text-decoration: underline;
  font-weight: 500;
  font-size: 1em;
  cursor: pointer;
  transition: color 0.2s;
  padding: 20px 0;
  display: inline-block;
}
.footer-link:hover {
  color: var(--accent);
}

/* --- BACKGROUND STARS --- */
#bg-stars {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
  pointer-events: none;
  background: transparent;
}

/* ensure content above background */
header, main, footer {
  position: relative;
  z-index: 2;
}

/* --------- RESPONSIVE POUR MOBILE --------- */
@media (max-width: 600px) {
  header {
    flex-direction: row;
    align-items: center;
    height: 56px;
    padding: 0 0 0 0;
  }
  .logo {
    font-size: 1.7em;
    margin: 0 0 0 10px;
  }
  .header-actions {
    padding-right: 6px;
    gap: 6px;
  }
  .lang-switch {
    font-size: 0.96em;
    padding: 4px 10px;
  }
  main {
    padding: 78px 4vw 10vw 4vw;
  }
  section {
    padding: 13px 6vw;
    border-radius: 13px;
    font-size: 0.97em;
  }
  h1 {
    font-size: 1.55em;
    margin-bottom: 10px;
  }
  h2 {
    font-size: 1.18em;
    margin-bottom: 12px;
  }
  .home-title {
    font-size: 1.75em;
    margin-bottom: 10px;
    margin-top: 14px;
  }
  .home-desc {
    font-size: 1em;
    margin-bottom: 20px;
    margin-top: 4px;
  }
}
#pdf-container {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  padding: 2rem 1rem;
  background-color: white;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}
#pdf-container canvas {
  width: 100% !important;  /* rend responsive */
  height: auto !important;
  display: block;
  margin-bottom: 2rem;
  background-color: white;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  border-radius: 4px;
}

.legal-details {
  white-space: pre-line;
}
