body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url('../img/fond.jpg') no-repeat center center;
  background-size: cover;
  opacity: 0.6;
  z-index: -1;
}

/* Couleurs principales */
:root {
  --primary: #c00000;
  --primary-dark: #900000;
  --bg-light: #ffffff;
  --text-light: #333;
  --bg-dark: #1e1e1e;
  --text-dark: #f1f1f1;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  transition: background-color 0.6s ease, color 0.6s ease;
}

.second-black-bar {
  background-color: #000;
  color: white;
  padding: 10px;
  text-align: center;
  font-size: 16px;
}

/* Logo */
.logo {
  display: block;
  margin: 20px auto;
  width: 120px;
  height: auto;
}

body.light {
  background: var(--bg-light);
  color: var(--text-light);
}
body.dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

header {
  background: var(--primary);
  color: white;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
header h1 {
  margin: 0;
  font-size: 1.8em;
  flex: 1;
  text-align: center;
}

/* Conteneur principal */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  margin: 50px auto;
  max-width: 1000px;
  transition: opacity 0.6s ease;
}

/* Cartes */
.card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  text-align: center;
  padding: 30px 20px;
  width: 250px;
  transition: transform 0.3s, box-shadow 0.3s, background 0.4s ease, color 0.4s ease;
  border: 2px solid var(--primary);
  backdrop-filter: blur(4px);
}
body.dark .card {
  background: rgba(43, 43, 43, 0.85);
  color: var(--text-dark);
  border-color: #ff5555;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

/* Titres et textes */
.card h2 {
  color: var(--primary);
  margin-bottom: 15px;
  font-size: 1.3em;
  transition: color 0.6s ease;
}
body.dark .card h2 {
  color: #ff5555;
}
.card p {
  font-size: 0.95em;
  margin-bottom: 20px;
}

/* Boutons dans les cartes */
.card a, .btn_login {
  display: inline-block;
  padding: 10px 18px;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s, transform 0.2s;
  border: none;
  cursor: pointer;
}
.card a:hover, .btn_login:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* Pied de page */
footer {
  text-align: center;
  padding: 15px;
  background: #fff;
  color: #000;
  margin-top: 30px;
  transition: background 0.6s ease;
}
body.dark footer {
  background: #111;
  color: #eee;
}

/* Badges Nouveauté / Bientôt */
.last-card, .bientot {
  position: relative;
}
.nouveaute-img {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 70px;
    height: auto;
    z-index: 2;
    pointer-events: none;
}

/* Structure page pleine hauteur */
html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}
body > .container {
  flex: 1;
}

/* Overlay vidéo plein écran */
#videoOverlay {
  display:none;
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:black;
  z-index:9999;
}
#videoOverlay iframe {
  width:100%;
  height:100%;
  border:none;
}
#videoOverlay button {
  position:absolute;
  top:20px;
  right:20px;
  z-index:10000;
  background:red;
  color:white;
  border:none;
  padding:10px;
  font-size:18px;
  cursor:pointer;
}

.nouveaute-img {
    width: 80px;
    height: 80px;
}

/* Formulaire d'authentification */
.auth-form-container {
  display: block;
  position: fixed;
  top: 60px;
  right: 20px;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10000;
  width: 480px;
  transition: all 0.3s ease;
}

#authFormContainer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  padding: 20px;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10000;
  display: block;
}

/* Labels du formulaire auth */
#authFormContainer label {
  display: block;
  font-weight: bold;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 1em;
}

/* Inputs du formulaire auth */
#authFormContainer input[type="text"],
#authFormContainer input[type="password"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 1em;
  border: 2px solid var(--primary);
  border-radius: 6px;
  margin-bottom: 15px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

#authFormContainer input[type="text"]:focus,
#authFormContainer input[type="password"]:focus {
  border-color: var(--primary-dark);
  outline: none;
}

#authFormContainer p {
  color: #c00000;
  font-weight: bold;
  margin-bottom: 15px;
}

.login-img {
  width: 40px;
  height: 40px;
  vertical-align: middle;
}

/* Bouton de login dans le header */
.login-button {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.login-button img {
  width: 40px;
  height: 40px;
  transition: opacity 0.3s ease;
}

.login-button:hover img {
  opacity: 0.8;
}

/* Bouton de logout dans le header */
.logout-button {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.logout-button img {
  width: 40px;
  height: 40px;
  transition: opacity 0.3s ease;
}

.logout-button:hover img {
  opacity: 0.8;
}

/* Classe hidden pour cacher les éléments */
.hidden {
  display: none !important;
}

.error-message {
  color: red;
  margin-bottom: 10px;
  font-weight: bold;
}

.authError {display: none;}