/* =============================================================
   Orgiro — CSS GLOBAL

   TABLE DES MATIÈRES
   1) Global
   2) Header
   3) Footer
   4) boutons
   5) Modales & Popups
   6) Bulle d'aide
  7) Thème sombre
  8) Emojis personnalisés
  9) Alertes personnalisées
  10) Autres
  11) Responsive
  12) Animations (keyframes)
  ============================================================= */

/* =====================================
   1) GLOBAL
   ===================================== */
/* 1.1 Variables couleurs */
:root {
  --bleu-principal: #1E3A8A;
  --violet-accent: #6D28D9;
  --fond-clair: #ffffff;
  --fond-cartes: #f4f4f9;
  --texte-principal: #222222;
  --texte-secondaire: #555555;
  --blanc: #ffffff;
  --navbar-height: 70px;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
  --transition: 0.25s ease;
  --vert: #4CAF50;
  --rouge: #e53e3e;
  --orange: #ed8936;
}

/* 1.2 Reset + base typographique */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Roboto, sans-serif;
}

/* 1.3 Base body */
body {
  background-color: var(--fond-clair);
  color: var(--texte-principal);
  line-height: 1.6;
  padding-top: var(--navbar-height);
}


strong {
  color: #6D28D9;
}

ul li {
  list-style: none;
}

#generation-message {
  margin-top: 1em;
  font-weight: bold;
  color: var(--violet-accent);
}

#generation-message.hidden {
  display: none;
}


/* =====================================
   2) HEADER
   ===================================== */
/* 2.1 Container navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  color: var(--blanc);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.brand-group {
  display: flex;
  align-items: center;
}

/* 2.2 Logo & nom du site */
.logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.logo {
  width: 50px;
  margin-right: 0.3rem;
}

.site-name {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--blanc);
  margin-right: 0.5rem;
}

.plan-switch {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

/* 2.3 Sélecteur de langue (centré) */
.langue-select {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}


/* 2.4 Bouton langue + hover */
.langue-select button {
  background: #ffffff;
  color: #1E3A8A;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  align-items: center;
  transition: all 0.3s ease;
}

.langue-select button:hover {
  transform: translateY(-2px) scale(1.05);
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.4);
  color: #ffffff;
}

/* 2.5 Menu déroulant langues */
#liste-langues {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fond-cartes);
  border-radius: 8px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
  display: none;
  min-width: 150px;
  z-index: 1000;
  overflow: hidden;
}

#liste-langues li {
  padding: 0.6rem 1rem;
  cursor: pointer;
  color: #1E3A8A;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease;
  background: #ffffff;
}

#liste-langues li:hover {
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  color: white;
  border-radius: 8px;
}

#liste-langues.show {
  display: block !important;
}

/* 2.6 Liens de navigation */
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a,
.nav-profile-label {
  position: relative;
  color: var(--blanc);
  text-decoration: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: inherit;
  transition: opacity 0.2s ease;
}

/* soulignement animé */
.nav-links a::after,
.nav-profile-label::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 1.5px;
  width: 100%;
  height: 1px;
  background-color: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-links a:hover::after,
.nav-profile:hover .nav-profile-label::after {
  transform: scaleX(1);
}

.nav-links-co {
  position: relative;
  color: var(--blanc);
  text-decoration: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: inherit;
  transition: opacity 0.2s ease;
}

.nav-links-co::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background-color: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-links-co:hover::after {
  transform: scaleX(1);
}

.nav-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-profile .emoji-img {
  width: 1.7rem;
  height: 1.7rem;
  transition: transform 0.2s ease;
}

.nav-profile-label {
  display: inline-block;
}

.nav-profile-icon {
  display: none;
}

.nav-profile:hover .emoji-img,
.nav-profile:focus-visible .emoji-img {
  transform: scale(1.18);
}

.nav-profile:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
  border-radius: 4px;
}

.custom-alert .alert-link {
  color: #6D28D9;
  font-weight: 700;
  text-decoration: underline;
}

/* 2.7 Hamburger (icône mobile) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  cursor: pointer;
  z-index: 1000;
  font-size: 2rem;
  padding-bottom: 3rem;
}

.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(135deg, #1E3A8A, #6D28D9);
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* 2.9 Section bloc générique (espacement max) */
section {
  padding: 3rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

section h2 {
  text-align: center;
  margin-bottom: 2rem;
}

/* =====================================
   3) FOOTER
   ===================================== */
footer {
  background: linear-gradient(135deg, #1E3A8A, #6D28D9);
  color: #fff;
  padding: 2.5rem 1rem 3rem 1rem;
  border-radius: 20px 20px 0 0;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  gap: 2rem;
}

.footer-section {
  flex: 1 1 220px;
  min-width: 200px;
}

.footer-section h3 {
  margin-bottom: 0.7em;
  font-size: 1.2em;
  color: #fff;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  width: fit-content;
  column-gap: 0.8rem;
  row-gap: 0.15rem;
}

.footer-section a {
  position: relative;
  color: #fff;
  text-decoration: none;
  transition: color 0.2s;
}

/* soulignement animé */
.footer-section a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 1.5px;
  width: 100%;
  height: 1px;
  background-color: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.footer-section a:hover::after {
  transform: scaleX(1);
}

.footer-action {
  text-align: right;
}

/* =====================================
   4) BOUTONS
   ===================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  color: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.boutons {
  text-align: center;
  align-items: center;
}


.btn-annuler {
  background: transparent;
  border: 2px solid var(--violet-accent);
  color: var(--violet-accent);
  box-shadow: none;
}

.btn-annuler:hover {
  background: var(--violet-accent);
  color: #fff;
}


/* Bouton de génération (accueil) */
.btn-generer {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  background: #4CAF50;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
  text-align: center;
  align-items: center;
  margin-left: 3rem;
}

.btn-generer:hover {
  background: #45a049;
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Bouton dans tableau planning (pages) */
.btn-planning {
  margin-bottom: 2rem;
}

.btn-ajouter {
  width: 100%;
  font-weight: bold;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--violet-accent);
  color: var(--violet-accent);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--violet-accent);
  color: #fff;
}



.btn-download {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.password-wrapper {
  position: relative;
}

.password-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  cursor: pointer;
  opacity: 0.35;
  user-select: none;
  transition: opacity 0.2s ease;
}

.password-eye:hover {
  opacity: 0.8;
}




/* =====================================
   5) MODALES & POPUPS
   ===================================== */
/* 5.1 Modale générique */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-contenu {
  background: var(--fond-clair);

  padding: 2rem;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.25s ease;
  position: relative;
}

.modal-contenu {
  border-radius: 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal-contenu::-webkit-scrollbar { display: none; }

.modal-contenu h2 {
  margin-bottom: 1.2rem;
  color: var(--bleu-principal);
}

.modal-section-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--texte-secondaire);
  margin: 1.2rem 0 0.5rem;
  font-weight: 600;
}

.tranche-group {
  background: var(--fond-cartes);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.8rem;
}

.tranche-group h4 {
  font-size: 0.88rem;
  margin-bottom: 0.6rem;
  color: var(--bleu-principal);
}

.fermer {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: var(--texte-secondaire);
  line-height: 1;
  transition: color var(--transition);
}

.fermer:hover {
  transform: scale(1.05);
}

/* ---------- Formulaires ---------- */

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--texte-principal);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--fond-clair);
  color: var(--texte-principal);
  transition: border-color var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--violet-accent);
}

body.dark-theme .form-group input,
body.dark-theme .form-group select,
body.dark-theme .form-group textarea {
  background: #2a2a3e;
  border-color: #3a3a5e;
  color: var(--texte-principal);
}


.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1.5px solid #d1d5db;
  transition: background var(--transition), border-color var(--transition);
  margin-bottom: 0;
}

.checkbox-group label:has(input:checked),
.checkbox-group label.checked {
  background: rgba(109, 40, 217, 0.1);
  border-color: var(--violet-accent);
  color: var(--violet-accent);
  font-weight: 600;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  accent-color: var(--violet-accent);
}

/* Style spécifique pour les préférences horaires */
#preference {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  gap: 0.5rem;
}

#preference label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  padding: 0.7rem 0.8rem;
  border-radius: 6px;
  border: 1.5px solid #d1d5db;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  line-height: 1.5;
}

#preference label input[type="radio"] {
  flex-shrink: 0;
  margin: 0;
  width: 18px;
  height: 18px;
}

#preference label:has(input:checked) {
  background: rgba(109, 40, 217, 0.1);
  border-color: var(--violet-accent);
  color: var(--violet-accent);
  font-weight: 600;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}


/* 5.2 Modale Paramètres (footer) */
.modal-parametres {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-parametres.hidden {
  display: none;
}

.modal-content {
  background: var(--fond-cartes);
  color: var(--texte-principal);
  border-radius: 15px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: popup 0.3s ease;
}

.modal-header {
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  color: white;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1rem;
}

.close-modal {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
}

.option-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
}

.toggle-theme {
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  border: none;
  border-radius: 8px;
  color: white;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-weight: bold;
}

/* 5.3 Popup (accueil) */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup.hidden {
  display: none;
}

.popup-content {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  max-width: 500px;
  max-height: 300px;
  width: 90%;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.popup-content h2 {
  margin-bottom: 10px;
  color: var(--bleu-principal);
}

.popup-content p {
  margin-bottom: 20px;
  font-size: 1rem;
  color: #444;
}

.popup-actions {
  display: flex;
  justify-content: space-around;
  gap: 15px;
}


.popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  font-size: 1.4rem;
  color: #666;
  transition: color 0.2s;
}

.popup-close:hover {
  color: var(--violet-accent);
}

.sous-titre a {
  position: relative;
  color: #6D28D9;
  /* adapte si besoin */
  text-decoration: none;
}

/* soulignement animé */
.sous-titre a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 1.5px;
  width: 100%;
  height: 1px;
  background-color: #6D28D9;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.sous-titre a:hover::after {
  transform: scaleX(1);
}



/* =====================================
   6) BULLE D'AIDE
   ===================================== */
.help-button {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  color: white;
  border: none;
  border-radius: 50%;
  width: 55px;
  height: 55px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.25);
  z-index: 1301;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.help-button .emoji-img {
  pointer-events: none;
}

.help-button:hover {
  transform: scale(1.1);
  box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.3);
}

.help-bubble {
  position: fixed;
  bottom: 90px;
  right: 25px;
  width: 300px;
  max-height: 420px;
  background: var(--fond-cartes);
  border-radius: 15px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
  z-index: 800;
}

.help-bubble.show {
  transform: scale(1);
}

.help-header {
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  color: white;
  padding: 0.8rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.help-header h2 {
  font-size: 1rem;
  margin: 0;
}

.help-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
}

.help-close:hover {
  transform: scale(1.1);
}

.help-body {
  padding: 1rem;
  font-size: 0.95rem;
  color: var(--texte-principal);
  overflow-y: auto;
}

.help-body ol {
  padding-left: 1.2rem;
  margin-bottom: 1rem;
}

/* =====================================
   7) THÈME SOMBRE
   ===================================== */
body.dark-theme {
  --fond-clair: #141417;
  --fond-cartes: #1a1a2e;
  --texte-principal: #e8e8f0;
  --texte-secondaire: #a0a0c0;
}

body.dark-theme {
  background-color: #0e0e10;
  color: #e5e5e5;
}

body.dark-theme .modal-content {
  background-color: #1a1a1d;
  color: #e5e5e5;
}

body.dark-theme main {
  background-color: #0e0e10;
  color: var(--texte-principal);
}

body.dark-theme details {
  background-color: #000000;
  color: var(--texte-principal);
}


body.dark-theme .custom-alert {
  background: #1a1a1d;
  border: 1px solid #333;
  border-left-color: #6D28D9;
  color: #e5e5e5;
}


body.dark-theme .confirm-box {
  background: #1a1a1d;
  border: 1px solid #333;
  border-left-color: #6D28D9;
  color: #e5e5e5;
}


/* Menu langue paramètre */

body.dark-theme .user-menu-langs {
  background: #1a1a2e;
  color: #e5e5e5;
}

body.dark-theme .user-menu-langs button {
  background: #1a1a2e;
  color: #e5e5e5;
}

body.dark-theme .user-menu .user-menu-langs button:hover {
  background: rgba(54, 44, 78, 0.164);
}

body.dark-theme .user-menu .user-menu-langs button.active-lang {
  background: rgba(109, 40, 217, 0.12);
  color: var(--violet-accent);
}

/* Menu langue header */
body.dark-theme #liste-langues li {
  background: #1a1a2e;
  color: #e5e5e5;
}

body.dark-theme #liste-langues li:hover {
  background: rgba(54, 44, 78, 0.164);
}


/* =====================================
   8) Emojis personnalisés
   ===================================== */
.emoji-img {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.30rem;
  display: inline-block;
  object-fit: contain;
  background: transparent;
}

/* =====================================
   9) Alertes personnalisées
   ===================================== */
/* 9.1 alertes */
.custom-alert {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #ddd;
  border-left: 5px solid #6D28D9;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  font-weight: 500;
  z-index: 1000;
}

.custom-alert img {
  width: 18px;
  height: 18px;
}

/* ------------------ Floating user menu (bottom-left) ------------------ */
.user-menu-container {
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
  margin-left: 25px;
  z-index: 1200;
}

.user-menu-button {
  position: relative;
  z-index: 1201;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  color: white;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.user-menu {
  position: absolute;
  bottom: 55px;
  left: 0;
  background: var(--fond-cartes, #fff);
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
  min-width: 180px;
  overflow: visible;
  font-size: 0.92rem;
  z-index: 1202;
}

.user-menu.hidden {
  display: none;
}

.user-menu .user-menu-item {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.user-menu .user-menu-item:hover {
  background: rgba(0, 0, 0, 0.03);
  cursor: pointer;
}

.user-menu .user-menu-langs {
  position: absolute;
  left: calc(100% + 0px);
  bottom: calc(100% - 115px);
  margin-left: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
  min-width: 150px;
  overflow: hidden;
  z-index: 1300;
  display: flex;
  flex-direction: column;
}


.user-menu .user-menu-langs.hidden {
  display: none;
}

.user-menu .user-menu-langs button {
  width: 100%;
  padding: 0.5rem 0.8rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.user-menu .user-menu-langs button:hover {
  background: rgba(0, 0, 0, 0.04);
}

.user-menu .user-menu-langs button.active-lang {
  background: rgba(109, 40, 217, 0.12);
  color: var(--violet-accent);
  font-weight: 700;
}

.lang-check {
  font-weight: 700;
  color: var(--violet-accent);
}

.user-menu-item a {
  color: inherit;
  text-decoration: none;
}

.menu-emoji {
  display: inline-block;
  margin-right: 0.5rem;
}

#user-menu-signout:hover {
  background: rgba(229, 62, 62, 0.1);
  color: var(--rouge);
  font-weight: 600;
}



/* 17.2 Confirmation */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
  z-index: 10001;
}

.confirm-box {
  background: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  min-width: 260px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.confirm-buttons {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.confirm-buttons button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* bouton oui */
#confirm-yes {
  background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
  color: white;
}

#confirm-yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* bouton annuler */
#confirm-no {
  background: #e5e7eb;
}

#confirm-no:hover {
  transform: translateY(-2px);
  background: #d1d5db;
}

.hidden {
  display: none;
}

/* =====================================
   10) AUTRES
   ===================================== */

.confirmation-msg {
  background: #e7f7e9;
  border-left: 4px solid #28a745;
  padding: 12px 16px;
  margin-top: 15px;
  border-radius: 6px;
  color: #155724;
  font-size: 0.95rem;
}

.confirmation-msg a {
  color: #007bff;
  font-weight: 500;
  text-decoration: none;
}

.confirmation-msg a:hover {
  text-decoration: underline;
}

/* Plan actif badge */
#currentPlanLabel {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  margin-left: 0.5rem;
  margin-top: 0.2rem;
  vertical-align: middle;
}

/* =====================================
   11) RESPONSIVE
   ===================================== */
/* 11.1 Mobile ≤ 768px (menu, footer, langues) */
@media (max-width: 1164px) {
  .nav-links {
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    left: 0;
    background: #ffffff;
    padding: 0;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-110%);
    transform-origin: top;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
    border-radius: 0;
  }

  .nav-links a {
    color: var(--bleu-principal);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    width: 100%;
    display: block;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .nav-profile-label {
    color: var(--bleu-principal);
    font-size: 1rem;
  }

  .nav-profile-icon {
    display: none;
  }

  .nav-profile:not(.is-connected) {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 48px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .nav-profile:not(.is-connected) .nav-links-co {
    color: var(--bleu-principal);
  }

  .nav-profile:not(.is-connected) .nav-links-co::after {
    display: none;
  }

  .nav-profile:not(.is-connected):hover {
    background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
    color: #fff;
  }

  .nav-profile:not(.is-connected):hover .nav-links-co {
    color: #fff;
  }


  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links a::after,
  .nav-profile-label::after {
    display: none;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    font-size: 1.5rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transition: background 0.2s ease;
  }

  body.dark-theme .nav-links {
    background: #1a1a2e;
    color: #e5e5e5;
  }

  body.dark-theme .nav-links a {
    background: #1a1a2e;
    color: #e5e5e5;
  }

  body.dark-theme .nav-links a:hover {
    background: rgba(54, 44, 78, 0.164);
    color: #e5e5e5;
  }

  .btn-generer {
    display: block;
    margin: 1.5rem auto;
    text-align: center;
  }

  footer {
    padding: 1.2rem 0.5rem;
    padding-bottom: 3rem;
  }

  .footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    text-align: center;
  }

  .footer-section {
    font-size: 0.9em;
  }

  .footer-section h3 {
    font-size: 1em;
    margin-bottom: 0.4em;
  }

  .footer-section p,
  .footer-section li {
    margin: 0.2em 0;
  }

  footer>p {
    margin-top: 1rem;
    font-size: 0.8em;
    text-align: center;
  }


  .navbar {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
  }

  .langue-select {
    position: static;
    transform: none;
    margin: 0.5rem auto;
  }

  .langue-select button {
    width: 100%;
  }

  #liste-langues {
    position: absolute;
    top: 100%;
    left: 63%;
    transform: translateX(-50%);
    width: 80%;
    background: var(--fond-cartes);
    border-radius: 8px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    max-width: 30px;
  }

  #liste-langues li {
    padding: 0.8rem;
  }



  .nav-links a::after {
    display: none;
    text-decoration: none;
  }

  .nav-links a:hover {
    background: linear-gradient(135deg, var(--bleu-principal), var(--violet-accent));
    color: #fff;
  }

  .no-planning {
    margin: 3rem 1rem;
    padding: 1.5rem;
    margin-bottom: 10rem;
  }
}

/* 11.2 À propos — ajustements tablette */
@media (max-width: 700px) {
  .a-propos {
    padding: 1.5rem;
    margin: 1.5rem;
  }

  .a-propos h1 {
    font-size: 1.6rem;
  }
}

/* 11.3 Petits écrans (spinner + overlay) */
@media (max-width: 420px) {
  .spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
  }

  .overlay-contenu {
    padding: 1rem;
    min-width: 200px;
    align-items: center;
    text-align: center;
    justify-content: center;
  }

  .overlay-titre {
    font-size: 1rem;
  }
}



/* =====================================
   MOBILE ≤ 768px — Général
   ===================================== */
@media (max-width: 768px) {

  /* --- Prevent horizontal overflow --- */
  html,
  body {
    overflow-x: hidden;
    width: 100%;
  }

  /* --- Navbar : layout propre hamburger --- */
  .navbar {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: var(--navbar-height);
    gap: 0;
  }

  .logo-container {
    flex-shrink: 0;
  }

  .logo {
    width: 36px;
    margin-right: 0.5rem;
  }

  .site-name {
    font-size: 1.2rem;
  }

  /* Langue : repositionnée entre logo et hamburger */
  .langue-select {
    position: static;
    transform: none;
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0;
  }

  .langue-select button {
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
    width: auto;
  }

  /* Menu déroulant langues : repositionné correctement */
  #liste-langues {
    position: absolute;
    top: calc(var(--navbar-height) + 2px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 130px;
    max-width: 160px;
    width: auto;
  }

  #liste-langues li {
    padding: 0.7rem 1rem;
    white-space: nowrap;
  }

  /* Hamburger : bien visible, pas de padding-bottom excessif */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    font-size: 1.5rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    transition: background 0.2s ease;
  }

  .hamburger:hover {
    background: rgba(255, 255, 255, 0.25);
  }

  /* Menu nav déroulant mobile */
  .nav-links {
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    left: 0;
    background: #ffffff;
    padding: 0;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-110%);
    transform-origin: top;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
    border-radius: 0;
  }

  .nav-links a {
    color: var(--bleu-principal);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    width: 100%;
    display: block;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links a::after {
    display: none;
  }

  /* --- Sections génériques --- */
  section {
    padding: 2rem 1rem;
  }

  /* --- Boutons : taille confortable sur mobile --- */
  .btn {
    min-height: 44px;
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
  }

  /* --- Modales : plein écran sur mobile --- */
  .modal-contenu {
    width: 95%;
    max-width: 95vw;
    padding: 1.5rem 1.2rem;
    max-height: 92vh;
  }

  .modal-content {
    width: 95%;
    max-width: 95vw;
  }

  /* --- Form rows → colonne sur mobile --- */
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  /* --- Préférence horaire : scrollable si trop large --- */
  #preference {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  #preference label {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 0;
    font-size: 0.82rem;
    padding: 0.55rem 0.5rem;
  }

  /* --- Checkbox group : wrap correct --- */
  .checkbox-group {
    gap: 0.4rem;
  }

  .checkbox-group label {
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem;
  }

  /* --- Footer : grille compacte comme avant --- */
  footer {
    padding: 1.2rem 0.5rem;
    padding-bottom: 3rem;
  }

  .footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    text-align: center;
  }

  .footer-section {
    min-width: 0;
    width: 100%;
    font-size: 0.9em;
  }

  .footer-section h3 {
    font-size: 1em;
    margin-bottom: 0.4em;
  }

  .footer-section p,
  .footer-section li {
    margin: 0.2em 0;
  }

  .footer-action {
    text-align: right;
    margin-right: 0;
    padding: 0 0.5rem;
  }

  footer>p {
    margin-top: 1rem;
    font-size: 0.8em;
    text-align: center;
  }

  /* --- Alertes : full-width sur mobile --- */
  .custom-alert {
    width: 90%;
    top: 80px;
    font-size: 0.9rem;
  }

  /* --- Bulle d'aide : repositionnée --- */
  .help-button {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .help-bubble {
    position: fixed;
    bottom: 90px;
    right: 25px;
    width: 150;
    max-height: 420px;
    background: var(--fond-cartes);
    border-radius: 15px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
    z-index: 800;
  }

  /* --- User menu --- */
  .user-menu-container {
    margin-left: 16px;
    margin-bottom: 12px;
  }

  .user-menu .user-menu-langs {
    left: 0;
    bottom: calc(100% + 4px);
  }


  /* --- Popup --- */
  .popup-content {
    padding: 1.5rem 1.2rem;
    max-height: 90vh;
    overflow-y: auto;
  }

  .popup-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .popup-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* =====================================
   MOBILE ≤ 768px — Page Accueil (index)
   ===================================== */
@media (max-width: 768px) {

  /* Présentation hero */
  .presentation {
    padding: 2rem 1.2rem 1.5rem;
    border-radius: 14px;
  }

  /* Plage horaire : empilée */
  #plage-horaire {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
    border-radius: 12px;
  }

  #plage-horaire label {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  #plage-horaire input[type="time"] {
    flex: 1;
    min-width: 100px;
  }

  .btn-generer-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .btn-generer {
    display: block;
    width: 100%;
    margin: 0;
    text-align: center;
  }

  /* Colonnes créneaux + tâches : empilées */
  .colonne {
    min-width: 0;
    width: 100%;
    flex: none;
  }

  #emploi-du-temps,
  #taches {
    min-height: 200px;
  }

  /* Import section */
  .import-box {
    flex-direction: column;
    gap: 0.6rem;
  }

  .import-label {
    margin-right: 0;
    width: 100%;
    justify-content: center;
  }

  .import-label+.btn {
    width: 100%;
    justify-content: center;
  }
}

/* =====================================
   MOBILE ≤ 768px — Page Planning
   ===================================== */
@media (max-width: 768px) {

  /* Contrôles de navigation : empilés */
  .calendar-controls {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .calendar-controls .btn {
    width: 100%;
    justify-content: center;
  }

  #weekLabel {
    text-align: center;
    padding: 0.3rem 0;
  }

  /* Téléchargement : colonne */
  .download-planning {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }

  .download-planning .btn {
    width: 100%;
    justify-content: center;
  }



  .cell-label {
    font-size: 0.65rem;
    padding: 2px 3px;
  }

  /* Message no-planning */
  .no-planning {
    padding: 2rem 1rem;
    margin: 1.5rem 0.5rem 5rem;
  }

  .no-planning p {
    font-size: 0.95rem;
  }
}

/* =====================================
   MOBILE ≤ 768px — Page To-do (Kanban)
   ===================================== */
@media (max-width: 768px) {

  .todo-main {
    padding: 0 0.75rem;
    margin: 1rem auto;
  }

  /* Kanban : 1 colonne */
  .kanban-board {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .kanban-col {
    min-height: 150px;
    margin-bottom: 0;
  }

  /* Bouton nouveau : centré */
  .btn-new {
    justify-content: center;
  }

  /* Stats : wrap */
  .todo-stats {
    flex-wrap: wrap;
    font-size: 0.85rem;
  }
}

/* =====================================
   MOBILE ≤ 768px — Page Plans/Connexion
   ===================================== */
@media (max-width: 768px) {

  /* Grille plans : 1 colonne */
  .plans-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  /* Carte plan mise à l'échelle normale */
  .plan-card.best-value {
    transform: scale(1);
  }

  .plan-card.best-value:hover {
    transform: translateY(-4px);
  }

  /* Toggle mensuel/annuel */
  .toggle-switch {
    width: 100%;
  }

  .toggle-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  /* Current plan line */
  .current-plan-line {
    font-size: 0.9rem;
    padding: 0.6rem 0.9rem;
  }

  /* Options paiement */
  .paiement-options {
    flex-direction: column;
  }

  .paiement-option {
    min-width: 0;
  }
}

/* =====================================
   MOBILE ≤ 768px — Page À propos
   ===================================== */
@media (max-width: 768px) {

  .a-propos {
    margin: 1.5rem 0.75rem;
    padding: 1.5rem 1.2rem;
    border-radius: 14px;
  }

  .a-propos h1 {
    font-size: 1.5rem;
  }

  .a-propos h2 {
    font-size: 1.1rem;
  }

  .a-propos p {
    font-size: 0.95rem;
  }

  .about-faq {
    padding: 1rem 0.5rem 2rem;
  }

  .about-top {
    padding: 1.2rem 1rem;
  }

  .about-accordions details {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
  }

  .about-accordions summary {
    padding: 0.8rem 0;
    padding-right: 2rem;
    font-size: 0.95rem;
  }

  .faq-content {
    font-size: 0.9rem;
  }
}

/* =====================================
   PETITS ÉCRANS ≤ 480px — Ajustements fins
   ===================================== */
@media (max-width: 480px) {

  .site-name {
    font-size: 1.1rem;
  }

  .logo {
    width: 30px;
    margin-right: 0.4rem;
  }

  section {
    padding: 1.5rem 0.8rem;
  }

  .modal-contenu {
    padding: 1.2rem 1rem;
    
  }

  /* Checkbox jours : 4 par ligne max */
  .checkbox-group label {
    font-size: 0.78rem;
    padding: 0.35rem 0.5rem;
  }



  /* Kanban cards : padding réduit */
  .kanban-col-header {
    padding: 0.8rem 0.8rem 0.6rem;
  }

  /* Footer compact : conserver le layout en grille */
  footer {
    padding: 1.2rem 0.5rem 3rem;
  }

  .footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    text-align: center;
  }

  .footer-section {
    font-size: 0.9em;
  }

  .footer-section h3 {
    font-size: 1em;
    margin-bottom: 0.4em;
  }

  .footer-section p,
  .footer-section li {
    margin: 0.2em 0;
  }

  footer>p {
    margin-top: 1rem;
    font-size: 0.8em;
    text-align: center;
  }

}


/* =====================================
   12) ANIMATIONS (KEYFRAMES)
   ===================================== */
@keyframes apparition {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes popup {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================
   PROFIL UTILISATEUR DANS LE MENU PARAMÈTRES
   ============================================= */
.user-menu-profil {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  background: rgba(109, 40, 217, 0.04);
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  transition: background 0.2s ease;
}

.user-menu-profil:hover {
  background: rgba(0, 0, 0, 0.075);
}

.user-menu-profil:focus-visible {
  outline: 2px solid var(--violet-accent);
  outline-offset: -2px;
}

.user-menu-profil.hidden {
  display: none;
}

.user-menu-profil-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-menu-profil-avatar .emoji-img,
.profil-avatar .emoji-img {
  width: 100%;
  height: 100%;
  vertical-align: middle;
  border-radius: inherit;
}

.user-menu-profil-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.user-menu-profil-email {
  font-size: 0.78rem;
  color: var(--texte-secondaire, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.user-menu-profil-plan {
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  background: #6b7280;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  display: inline-block;
  width: fit-content;
  letter-spacing: 0.02em;
}

body.dark-theme .user-menu-profil {
  background: rgba(109, 40, 217, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .user-menu-profil-email {
  color: rgba(255, 255, 255, 0.55);
}







/* Rappels par e-mail (profil) */
#profil-rappels-group[hidden],
#profil-rappels-options[hidden],
.profil-rappel-ligne[hidden] {
  display: none !important;
}

.profil-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  margin: 0.4rem 0 0.8rem;
}

.profil-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.profil-switch-piste {
  position: relative;
  flex: 0 0 44px;
  height: 24px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.2s;
}

.profil-switch-piste::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.profil-switch input:checked+.profil-switch-piste {
  background: var(--violet-accent);
}

.profil-switch input:checked+.profil-switch-piste::after {
  transform: translateX(20px);
}

.profil-switch input:focus-visible+.profil-switch-piste {
  outline: 2px solid var(--violet-accent);
  outline-offset: 2px;
}

.profil-switch-texte {
  font-size: 0.88rem;
}

.profil-rappel-ligne {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.profil-rappel-ligne select,
.profil-rappel-ligne input[type="time"] {
  padding: 0.5rem 0.6rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
}

/* Profil : seul le menu défile, la boîte garde ses coins arrondis */
.modal-contenu.profil-contenu {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  max-height: 90dvh;
  overflow: hidden;
}

.modal-contenu.profil-contenu .profil-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.profil-menu .profil-panel.is-open {
  max-height: none;
}

/* Interrupteur : on force la mise en page pour passer devant les règles générales */
#profil-rappels-group .profil-switch {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.4rem 0 0.8rem;
}

#profil-rappels-group .profil-switch-piste {
  display: block;
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 24px;
}

#profil-rappels-group .profil-switch-texte {
  display: block;
  flex: 1 1 auto;
}







/* =====================================================================
   Listes déroulantes personnalisées (script/select-custom.js)
   ===================================================================== */
.cs-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}

.cs-wrap.cs-bloc {
  display: block;
  width: 100%;
}

/* Le vrai <select> reste dans la page mais n'est plus visible */
.cs-wrap > .cs-native {
  position: absolute !important;
  left: 0;
  bottom: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  min-width: 0;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: var(--fond-clair, #ffffff);
  color: var(--texte-principal, #222222);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* Liste dans une ligne (ex. modale profil) : plus compacte */
.cs-wrap:not(.cs-bloc) .cs-trigger {
  width: auto;
  min-width: 7.5rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
}

.cs-valeur {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-vide .cs-valeur {
  color: var(--texte-secondaire, #6b7280);
}

.cs-chevron {
  flex: 0 0 auto;
  color: var(--texte-secondaire, #6b7280);
  transition: transform 0.2s ease, color 0.2s ease;
}

.cs-trigger:hover {
  border-color: #b8a6ea;
}

.cs-trigger:focus-visible,
.cs-ouvert .cs-trigger {
  outline: none;
  border-color: var(--violet-accent, #6D28D9);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

.cs-ouvert .cs-chevron {
  transform: rotate(180deg);
  color: var(--violet-accent, #6D28D9);
}

.cs-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Champ obligatoire non rempli (classe ajoutée par ton JS sur le select) */
.cs-native.input-error + .cs-trigger {
  border-color: var(--rouge, #e53e3e);
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.12);
}

/* ----- La liste ----- */
.cs-liste {
  position: fixed;
  z-index: 20000;
  box-sizing: border-box;
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--fond-clair, #ffffff);
  color: var(--texte-principal, #222222);
  border: 1px solid rgba(109, 40, 217, 0.14);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(30, 58, 138, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 0.95rem;
  transform-origin: top center;
  animation: cs-entree 0.14s ease-out;
  scrollbar-width: thin;
  scrollbar-color: rgba(109, 40, 217, 0.35) transparent;
}

.cs-liste.cs-haut {
  transform-origin: bottom center;
}

@keyframes cs-entree {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.cs-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  line-height: 1.3;
  cursor: pointer;
}

.cs-option.cs-active {
  background: rgba(109, 40, 217, 0.09);
}

.cs-option[aria-selected="true"] {
  color: var(--violet-accent, #6D28D9);
  font-weight: 600;
}

.cs-option[aria-selected="true"]::after {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5l3.5 3.5 7.5-8' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5l3.5 3.5 7.5-8' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.cs-desactivee {
  opacity: 0.45;
  cursor: not-allowed;
}

.cs-groupe {
  padding: 0.5rem 0.7rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--texte-secondaire, #6b7280);
}

/* ----- Thème sombre ----- */
body.dark-theme .cs-trigger {
  background: #2a2a3e;
  border-color: #3a3a5e;
  color: var(--texte-principal);
}

body.dark-theme .cs-trigger:hover {
  border-color: #5b4b9a;
}

body.dark-theme .cs-trigger:focus-visible,
body.dark-theme .cs-ouvert .cs-trigger {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

body.dark-theme .cs-ouvert .cs-chevron {
  color: #a78bfa;
}

body.dark-theme .cs-liste {
  background: #23233a;
  color: var(--texte-principal);
  border-color: #3a3a5e;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  scrollbar-color: rgba(167, 139, 250, 0.4) transparent;
}

body.dark-theme .cs-option.cs-active {
  background: rgba(167, 139, 250, 0.16);
}

body.dark-theme .cs-option[aria-selected="true"] {
  color: #c4b5fd;
}

@media (prefers-reduced-motion: reduce) {
  .cs-liste { animation: none; }
  .cs-trigger, .cs-chevron { transition: none; }
}

/* ============ Sélecteur d'heure ============ */
.ct-wrap { min-width: 110px; }

.ct-icone {
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  color: var(--bleu-principal, #1e3a8a);
  opacity: 0.75;
}

.cs-ouvert .ct-icone { opacity: 1; color: var(--violet-accent, #6d28d9); }

.ct-icone.ct-img {
  width: 19px;
  height: 19px;
  margin: -3px 0 -3px 6px;
  opacity: 1;
  object-fit: contain;
  pointer-events: none;
}

.ct-popover {
  position: fixed;
  z-index: 20000;
  box-sizing: border-box;
  width: 190px;
  padding: 8px;
  background: var(--fond-clair, #ffffff);
  color: var(--texte-principal, #222222);
  border: 1px solid rgba(109, 40, 217, 0.14);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(30, 58, 138, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 0.95rem;
  animation: cs-entree 0.14s ease-out;
}

.ct-entetes,
.ct-colonnes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.ct-entetes {
  margin-bottom: 4px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
}

.ct-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 208px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(109, 40, 217, 0.3) transparent;
  outline: none;
}

.ct-cell {
  flex: none;
  appearance: none;
  border: 0;
  margin: 0;
  padding: 7px 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}

.ct-cell:hover,
.ct-cell:focus-visible {
  background: rgba(109, 40, 217, 0.1);
  outline: none;
}

.ct-cell[aria-selected="true"] {
  background: linear-gradient(135deg, var(--bleu-principal, #1e3a8a), var(--violet-accent, #6d28d9));
  color: #fff;
  font-weight: 600;
}

.ct-pied {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(109, 40, 217, 0.12);
}

.ct-effacer,
.ct-ok {
  appearance: none;
  border: 0;
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.ct-effacer { background: transparent; color: inherit; opacity: 0.7; }
.ct-effacer:hover { opacity: 1; background: rgba(109, 40, 217, 0.1); }

.ct-ok {
  margin-left: auto;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, var(--bleu-principal, #1e3a8a), var(--violet-accent, #6d28d9));
}

body.dark-theme .ct-popover {
  background: #23233a;
  color: var(--texte-principal);
  border-color: #3a3a5e;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
body.dark-theme .ct-col { scrollbar-color: rgba(167, 139, 250, 0.4) transparent; }
body.dark-theme .ct-cell:hover,
body.dark-theme .ct-cell:focus-visible { background: rgba(167, 139, 250, 0.16); }
body.dark-theme .ct-pied { border-top-color: #3a3a5e; }
body.dark-theme .ct-effacer:hover { background: rgba(167, 139, 250, 0.16); }
body.dark-theme .ct-icone:not(.ct-img) { color: #c4b5fd; }

@media (max-width: 600px) {
  #plage-horaire .cs-wrap { flex: 1; min-width: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-popover { animation: none; }
}

/* ============ Calendrier ============ */
.cd-popover { width: 292px; padding: 10px; }

.cd-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cd-titre { font-weight: 600; font-size: 0.98rem; }

.cd-nav {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--bleu-principal, #1e3a8a);
  cursor: pointer;
  transition: background 0.12s;
}
.cd-nav:hover,
.cd-nav:focus-visible { background: rgba(109, 40, 217, 0.1); outline: none; }

.cd-semaine,
.cd-grille {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cd-semaine {
  margin-bottom: 2px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.55;
}

.cd-jour {
  appearance: none;
  box-sizing: border-box;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.12s;
}
.cd-jour:hover,
.cd-jour:focus-visible { background: rgba(109, 40, 217, 0.1); outline: none; }
.cd-jour.cd-autre { opacity: 0.35; }
.cd-jour.cd-auj { border-color: var(--violet-accent, #6d28d9); font-weight: 600; }
.cd-jour[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--bleu-principal, #1e3a8a), var(--violet-accent, #6d28d9));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  opacity: 1;
}
.cd-jour:disabled { opacity: 0.25; cursor: not-allowed; background: transparent; }

body.dark-theme .cd-nav { color: #c4b5fd; }
body.dark-theme .cd-nav:hover,
body.dark-theme .cd-nav:focus-visible,
body.dark-theme .cd-jour:hover,
body.dark-theme .cd-jour:focus-visible { background: rgba(167, 139, 250, 0.16); }
body.dark-theme .cd-jour.cd-auj { border-color: #a78bfa; }
body.dark-theme .cd-jour[aria-pressed="true"] { background: linear-gradient(135deg, var(--bleu-principal, #1e3a8a), var(--violet-accent, #6d28d9)); }

@media (max-width: 360px) {
  .cd-popover { width: calc(100vw - 20px); }
}










/* --- Modales en thème sombre --- */
body.dark-theme .modal-contenu { color-scheme: dark; }

body.dark-theme .modal-contenu h2,
body.dark-theme .tranche-group h4 { color: #c4b5fd; }

body.dark-theme .checkbox-group label,
body.dark-theme #preference label,
body.dark-theme .rappel-section .rappel-modes label {
  background: #1a1a2e;
  border-color: #3a3a5e;
}

body.dark-theme .checkbox-group label:has(input:checked),
body.dark-theme .checkbox-group label.checked,
body.dark-theme #preference label:has(input:checked),
body.dark-theme .rappel-section .rappel-modes label:has(input:checked) {
  background: rgba(167, 139, 250, 0.16);
  border-color: #a78bfa;
  color: #c4b5fd;
}

body.dark-theme .btn-annuler {
  color: #c4b5fd;
  border-color: #a78bfa;
}
body.dark-theme .btn-annuler:hover {
  background: var(--violet-accent);
  border-color: var(--violet-accent);
  color: #fff;
}

/* --- Modale profil : pas de barre de défilement visible --- */
.profil-contenu,
.profil-contenu * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.profil-contenu::-webkit-scrollbar,
.profil-contenu *::-webkit-scrollbar { display: none; }

.profil-item:focus-visible {
  outline: 2px solid var(--violet-accent);
  outline-offset: 2px;
}
body.dark-theme .profil-item:focus-visible { outline-color: #a78bfa; }

/* Cases à cocher et boutons radio des modales : toujours violets */
.modal-contenu input[type="radio"],
.modal-contenu input[type="checkbox"] {
  accent-color: var(--violet-accent);
}

/* ============ Sélecteur de couleur ============ */
.cc-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 0; vertical-align: middle; }
.cc-wrap .cc-trigger { flex: none; }

.cc-trigger {
  width: 44px;
  height: 40px;
  min-width: 36px;
  padding: 0;
  border-radius: 8px;
  border: 2px solid rgba(109, 40, 217, 0.25);
  background-clip: padding-box;
}
.cc-trigger:hover { border-color: var(--violet-accent, #6d28d9); }

.cc-popover { width: 252px; padding: 10px; }

.cc-sv {
  position: relative;
  height: 150px;
  border-radius: 10px;
  background-image:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
  cursor: crosshair;
  touch-action: none;
  outline: none;
}
.cc-sv:focus-visible,
.cc-teinte:focus-visible { box-shadow: 0 0 0 2px var(--violet-accent, #6d28d9); }

.cc-sv-curseur,
.cc-teinte-curseur {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.cc-teinte {
  position: relative;
  flex: 1;
  height: 12px;
  margin: 0 8px 0 4px;
  border-radius: 999px;
  background: linear-gradient(to right, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00);
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.cc-teinte-curseur { top: 50%; }

.cc-ligne {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.cc-apercu {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(109, 40, 217, 0.25);
}

.cc-champs {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
}
.cc-champ {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.cc-champ span { font-size: 0.72rem; font-weight: 700; opacity: 0.7; }
.cc-val {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 4px;
  text-align: center;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: var(--fond-clair, #fff);
  color: var(--texte-principal, #222);
  font: 0.85rem ui-monospace, Consolas, monospace;
}
.cc-val:focus { outline: none; border-color: var(--violet-accent, #6d28d9); }
.cc-mode {
  flex: none;
  width: 26px;
  height: 31px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.cc-mode:hover { background: rgba(109, 40, 217, 0.1); }

.cc-pipette {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.cc-pipette:hover { background: rgba(109, 40, 217, 0.1); }


body.dark-theme .cc-trigger { border-color: #3a3a5e; }
body.dark-theme .cc-trigger:hover { border-color: #a78bfa; }
body.dark-theme .cc-val { background: #2a2a3e; border-color: #3a3a5e; color: #c4b5fd; }
body.dark-theme .cc-val:focus { border-color: #a78bfa; }
body.dark-theme .cc-apercu { border-color: #3a3a5e; }
body.dark-theme .cc-mode:hover,
body.dark-theme .cc-pipette:hover { background: rgba(167, 139, 250, 0.16); }

/* Barre de défilement fine pour les modales */
.modal-overlay,
.modal-contenu,
.modal-body,
.profil-contenu,
.profil-contenu * {
  scrollbar-width: thin;
  scrollbar-color: rgba(109, 40, 217, 0.45) transparent;
}
.modal-overlay::-webkit-scrollbar,
.modal-contenu::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.profil-contenu::-webkit-scrollbar,
.profil-contenu *::-webkit-scrollbar {
  display: block;
  width: 8px;
}
.modal-overlay::-webkit-scrollbar-track,
.modal-contenu::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.profil-contenu::-webkit-scrollbar-track,
.profil-contenu *::-webkit-scrollbar-track {
  background: transparent;
  margin: 14px 0;
}
.modal-overlay::-webkit-scrollbar-thumb,
.modal-contenu::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.profil-contenu::-webkit-scrollbar-thumb,
.profil-contenu *::-webkit-scrollbar-thumb {
  background: rgba(109, 40, 217, 0.45);
  border-radius: 999px;
}

body.dark-theme .modal-overlay,
body.dark-theme .modal-contenu,
body.dark-theme .modal-body,
body.dark-theme .profil-contenu,
body.dark-theme .profil-contenu * {
  scrollbar-color: rgba(167, 139, 250, 0.5) transparent;
}
body.dark-theme .modal-overlay::-webkit-scrollbar-thumb,
body.dark-theme .modal-contenu::-webkit-scrollbar-thumb,
body.dark-theme .modal-body::-webkit-scrollbar-thumb,
body.dark-theme .profil-contenu::-webkit-scrollbar-thumb,
body.dark-theme .profil-contenu *::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.5);
}

/* ============ Date : saisie au clavier ============ */
/* Clic sur la date (ou sur --.--.----) = on écrit ; clic ailleurs dans la case = calendrier */
.cd-wrap .cs-valeur { visibility: hidden; }

.cd-wrap .cd-saisie {
  position: absolute !important;
  top: 50% !important;
  left: 0.7rem !important;
  transform: translateY(-50%);
  box-sizing: content-box !important;
  min-width: 2ch;
  height: 1.5em !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--texte-principal, #222222);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.5em;
  outline: none;
  cursor: text;
}
.cd-wrap.cs-bloc .cd-saisie {
  left: 0.85rem !important;
  font-size: 0.95rem;
}
.cd-wrap .cd-saisie::placeholder { color: var(--texte-secondaire, #6b7280); opacity: 1; }
.cd-wrap .cd-saisie:disabled { cursor: not-allowed; }

/* L'icône reste visible et ne gêne pas le clic (il ouvre le calendrier) */
.cd-wrap .cd-trigger .ct-icone { pointer-events: none; }

.cd-wrap:focus-within .cd-trigger {
  border-color: var(--violet-accent, #6d28d9);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

body.dark-theme .cd-wrap .cd-saisie { color: #c4b5fd; }
body.dark-theme .cd-wrap:focus-within .cd-trigger {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

/* ============ Heure : saisie au clavier ============ */
.ct-wrap:not(.cd-wrap) .cs-valeur { visibility: hidden; }

.ct-wrap:not(.cd-wrap) .ct-saisie {
  position: absolute !important;
  top: 50% !important;
  left: 0.7rem !important;
  transform: translateY(-50%);
  box-sizing: content-box !important;
  min-width: 2ch;
  height: 1.5em !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--texte-principal, #222222);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.5em;
  outline: none;
  cursor: text;
}
.ct-wrap.cs-bloc:not(.cd-wrap) .ct-saisie {
  left: 0.85rem !important;
  font-size: 0.95rem;
}
.ct-wrap:not(.cd-wrap) .ct-saisie::placeholder { color: var(--texte-secondaire, #6b7280); opacity: 1; }
.ct-wrap:not(.cd-wrap) .ct-saisie:disabled { cursor: not-allowed; }

.ct-wrap:not(.cd-wrap):focus-within .ct-trigger {
  border-color: var(--violet-accent, #6d28d9);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

body.dark-theme .ct-wrap:not(.cd-wrap) .ct-saisie { color: #c4b5fd; }
body.dark-theme .ct-wrap:not(.cd-wrap):focus-within .ct-trigger {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}


/* ============ Mode « écriture » : un seul surlignement (le texte sélectionné) ============ */
.cd-wrap .cd-saisie:focus,
.ct-wrap:not(.cd-wrap) .ct-saisie:focus {
  caret-color: var(--violet-accent, #6d28d9);
}
.cd-wrap .cd-saisie:focus::placeholder,
.ct-wrap:not(.cd-wrap) .ct-saisie:focus::placeholder { color: var(--violet-accent, #6d28d9); }
.cd-wrap .cd-saisie::selection,
.ct-wrap:not(.cd-wrap) .ct-saisie::selection { background: rgba(109, 40, 217, 0.3); }

.cd-wrap:focus-within .ct-icone,
.ct-wrap:not(.cd-wrap):focus-within .ct-icone { opacity: 1; }

body.dark-theme .cd-wrap .cd-saisie:focus,
body.dark-theme .ct-wrap:not(.cd-wrap) .ct-saisie:focus { caret-color: #c4b5fd; }
body.dark-theme .cd-wrap .cd-saisie:focus::placeholder,
body.dark-theme .ct-wrap:not(.cd-wrap) .ct-saisie:focus::placeholder { color: #a78bfa; }
body.dark-theme .cd-wrap .cd-saisie::selection,
body.dark-theme .ct-wrap:not(.cd-wrap) .ct-saisie::selection { background: rgba(167, 139, 250, 0.4); }


/* ============ Calendrier : boutons année précédente / suivante ============ */
.cd-groupe { display: inline-flex; }
.cd-entete .cd-nav { width: 28px; height: 32px; }
.cd-entete .cd-titre { text-align: center; flex: 1; }

/* ===================================================================
 Modales connexion / inscription (auth-modal.js) — communes à toutes les pages
 =================================================================== */
.auth-intro {
  margin: -0.3rem 0 1rem;
  color: var(--texte-secondaire);
  font-size: 0.95rem;
  line-height: 1.55;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1rem;
}

.auth-legal-box {
  margin: 1rem 0 0.4rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(109, 40, 217, 0.05);
  border: 1px solid rgba(109, 40, 217, 0.12);
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.86rem;
  color: var(--texte-secondaire);
  line-height: 1.5;
}

.auth-checkbox input {
  width: auto;
  margin-top: 0.2rem;
  accent-color: var(--violet-accent);
}

.auth-checkbox a {
  color: var(--violet-accent);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.auth-help-text {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--texte-secondaire);
}

.auth-footer-link {
  text-align: center;
  font-size: 0.9rem;
  color: var(--texte-secondaire);
  margin-top: 1rem;
}

.auth-separator {
  text-align: center;
  position: relative;
  margin: 1.2rem 0;
  color: var(--texte-secondaire);
  font-size: 0.85rem;
}

.auth-separator::before,
.auth-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: #d1d5db;
}

.auth-separator::before {
  left: 0;
}

.auth-separator::after {
  right: 0;
}

.auth-link {
position: relative;
color: #6D28D9;
text-decoration: none;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
cursor: pointer;
}

/* soulignement animé */
.auth-link::after {
content: "";
position: absolute;
left: 0;
bottom: 1px;
width: 100%;
height: 1px;
background-color: #6D28D9;
transform: scaleX(0);
transform-origin: left;
transition: transform 0.3s ease;
}

.auth-link:hover::after {
transform: scaleX(1);
}


.mdp-oublie {
position: relative;
display: inline-block;
width: fit-content;
font-size: 0.85rem;
color: var(--texte-secondaire);
text-decoration: none;
cursor: pointer;
margin-top: 0.4rem;
transition: color var(--transition);
}

.mdp-oublie::after {
content: "";
position: absolute;
left: 0;
bottom: 3px;
width: 100%;
height: 1px;
background-color: var(--violet-accent);
transform: scaleX(0);
transform-origin: left;
transition: transform 0.3s ease;
}

.mdp-oublie:hover {
color: var(--violet-accent);
text-decoration: none;
}

.mdp-oublie:hover::after {
transform: scaleX(1);
}

input.input-error,
select.input-error,
textarea.input-error {
  border-color: #e53e3e !important;
  box-shadow: 0 0 0 3px rgba(229,62,62,0.08) !important;
  animation: shake 0.35s ease !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

#otp-cases {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.otp-case {
  width: 52px;
  min-width: 52px;
  height: 58px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--texte-principal, #111827);
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(15, 23, 42, 0.15);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}
.otp-case:focus {
  border-color: var(--bleu-principal);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}
.otp-case.erreur { border-color: #dc2626; }

/* Thème sombre */
body.dark-theme .auth-link { color: #a78bfa; }
body.dark-theme .auth-link::after { background-color: #a78bfa; }
body.dark-theme .auth-legal-box { background: rgba(167, 139, 250, 0.08); border-color: #3a3a5e; }
body.dark-theme .auth-checkbox a { color: #a78bfa; }
body.dark-theme .otp-case { background: #2a2a3e; border-color: #3a3a5e; color: #c4b5fd; box-shadow: none; }
body.dark-theme .otp-case:focus { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2); }
body.dark-theme .auth-separator::before, body.dark-theme .auth-separator::after { background: #3a3a5e; }