/* ============================
   GLOBAL THEME (Inspired by xgrids.com)
   ============================ */

/* ==== BASE FONT & RESET ==== */
/* Réinitialisation des marges, paddings et du box-sizing pour tous les éléments */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Paramètres html généraux : taille base & scroll fluide */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Body : police principale, couleurs du thème, transition douce sur les couleurs */
body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: var(--fs-body);
  transition: background-color 0.3s, color 0.3s;
}
body * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* MAIS on réactive pour les champs de formulaire, sinon c’est l’enfer */
input,
textarea,
select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ==== COLOR PALETTE ==== */
/* Palette et variables globales du thème */
:root {
  /* Thème foncé par défaut */
  --color-bg: #0a0a0a;
  --color-text: #f9f9f9;
  --color-muted: #aaaaaa;
  --color-border: #2a2a2a;
  --color-primary: #3ea6ff;
  --color-primary-dark: #147cd6;
  --color-secondary: #e535ab;
  --color-accent: #00c6a2;
  --color-danger: #ff4d4f;
  --color-danger-text-on-bg: #ffffff;
  --color-success: #52c41a;
  --color-warning: #faad14;

  --radius: 1rem;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --transition: all 0.2s ease;

  /* =========================
     NOUVELLES VARIABLES GLOBALes
     ========================= */
  --container-max: 1240px;
  --container-wide: 1360px;
  --container-narrow: 980px;
  --container-pad: clamp(18px, 2.2vw, 32px);

  --fs-body: clamp(0.88rem, 0.86rem + 0.10vw, 0.95rem);
  --fs-small: clamp(0.78rem, 0.76rem + 0.06vw, 0.84rem);

--fs-h1: clamp(1.72rem, 1.42rem + 1.08vw, 2.45rem);
--fs-h2: clamp(1.36rem, 1.2rem + 0.66vw, 1.88rem);
--fs-h3: clamp(1.02rem, 0.96rem + 0.28vw, 1.26rem);
--fs-h4: clamp(0.95rem, 0.93rem + 0.14vw, 1.06rem);

  --space-section: clamp(3rem, 4vw, 5.5rem);
  --space-block: clamp(1.25rem, 1.6vw, 2rem);
  --space-card: clamp(1.1rem, 1.2vw, 1.8rem);
  --space-gap: clamp(0.9rem, 1.1vw, 1.5rem);
}

/* ==== TYPOGRAPHY ==== */
/* Titres */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.15;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: 1rem; }
h6 { font-size: 0.92rem; }

p,
li,
input,
textarea,
select,
button {
  font-size: var(--fs-body);
}

/* Liens */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition);
}

/* Hover sur liens textuels (hors boutons) */
a:not(.button):not(.btn-main):hover {
  color: var(--color-primary-dark);
}

/* ==== BUTTONS ==== */
/* Styles communs pour tous les boutons */
.button,
button,
input[type="submit"],
input[type="button"] {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: clamp(0.7rem, 0.7rem + 0.2vw, 0.9rem)
           clamp(1.2rem, 1rem + 0.8vw, 1.7rem);
  border-radius: var(--radius);
  font-size: var(--fs-body);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  display: inline-block;
}

/* Effet hover sur boutons */
.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

/* Effet lors du clic */
.button:active,
button:active {
  transform: scale(0.98);
}

/* ==== FORMS ==== */
/* Champs de formulaire principaux */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: var(--fs-body);
  background-color: #1a1d22;
  color: #e0e5ed;
  transition: var(--transition);
}

/* Focus sur les champs : mise en avant */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0,112,243,0.2);
}

/* ==== CONTAINERS / UTILITAIRES ==== */
/* Conteneur principal centré et paddé */
.container {
  width: min(var(--container-max), calc(100% - (var(--container-pad) * 2)));
  margin: 0 auto;
  padding: 0;
}

/* Cartes (cards) : fond, bordure, ombre, arrondis, padding */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-card);
  transition: var(--transition);
}

/* Effet hover sur les cartes */
.card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Badges : petits labels arrondis */
.badge {
  display: inline-block;
  background: var(--color-muted);
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ==== LISTS ==== */
ul, ol {
  color: var(--color-text);
}
li {
  margin-bottom: 0.5rem;
}

/* ===== Laptop / écrans intermédiaires ===== */
@media (max-width: 1600px) {
  :root {
    --container-max: 1060px;
    --container-wide: 1140px;
    --container-narrow: 900px;
    --container-pad: 22px;

    --fs-body: 0.92rem;
    --fs-small: 0.8rem;

    --fs-h1: 2.15rem;
    --fs-h2: 1.65rem;
    --fs-h3: 1.18rem;
    --fs-h4: 1rem;

    --space-section: 2.7rem;
    --space-block: 1.1rem;
    --space-card: 1rem;
    --space-gap: 0.9rem;
  }
}

/* ===== Tablettes ===== */
@media (max-width: 992px) {
  :root {
    --container-pad: 20px;
    --fs-h1: clamp(1.9rem, 1.6rem + 1.1vw, 2.5rem);
    --fs-h2: clamp(1.5rem, 1.28rem + 0.7vw, 2rem);
    --fs-h3: clamp(1.15rem, 1.05rem + 0.3vw, 1.35rem);
    --space-section: clamp(2.6rem, 3.5vw, 4rem);
  }
}

/* ===== Mobiles ===== */
@media (max-width: 600px) {
  :root {
    --container-pad: 16px;
    --space-section: 2.6rem;
    --space-card: 1rem;
  }
}

/* ===== Très petits mobiles ===== */
@media (max-width: 480px) {
  html {
    font-size: 15px;
  }
}

/* ==== MODALES ==== */
/* Fond de la modale */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

/* Contenu central harmonisé */
.modal-content {
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,174,239,0.25);
  padding: 2rem 2.5rem;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  width: 90%;
  color: #e4e7eb;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(0,0,0,0.92) 0%, rgba(10,10,10,0.98) 100%);
  box-shadow: 0 8px 30px rgba(0,174,239,0.25),
              0 0 40px rgba(0,174,239,0.08); /* Halo bleu doux */
}

/* Animation à l’ouverture */
.modal.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

/* Titre harmonisé */
.modal-content h2 {
  font-size: 1.8rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.5rem;
}
/* Bouton de fermeture (croix) */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 50%;
  padding: 0.5rem;
  font-size: 1.1rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
  background: rgba(0,174,239,0.25);
  transform: rotate(90deg);
}

/* Actions modale (boutons en ligne) */
.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* =========================================================
   FORMULAIRE MODALE — VERSION HARMONISÉE XPERIUM
   ========================================================= */

.form-projet-donnee {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  color: #e4e7eb;
}

/* Champs texte */
.form-projet-donnee input[type="text"],
.form-projet-donnee input[type="email"],
.form-projet-donnee input[type="number"],
.form-projet-donnee textarea {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 10px;
  background: rgba(26, 29, 34, 0.9);
  color: #e4e7eb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(6px);
}

.form-projet-donnee input[type="text"]:focus,
.form-projet-donnee input[type="email"]:focus,
.form-projet-donnee input[type="number"]:focus,
.form-projet-donnee textarea:focus {
  outline: none;
  border-color: #00AEEF;
  box-shadow: 0 0 8px rgba(0, 174, 239, 0.25);
}

/* Champ file */
.form-projet-donnee input[type="file"] {
  font-size: 0.9rem;
  color: #e4e7eb;
  background: none;
  border: none;
}

/* Bouton Submit */
.form-projet-donnee button[type="submit"] {
  align-self: center;
  padding: 0.9rem 2rem;
  font-size: 1rem;
  background: #00AEEF;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0,174,239,0.3);
}

.form-projet-donnee button[type="submit"]:hover {
  background: #0099cc;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,174,239,0.4);
}

/* Preview vignette */
.vignette-preview-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.vignette-preview {
  max-width: 100%;
  max-height: 140px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Champ File custom */
.file-upload {
  position: relative;
  overflow: hidden;
  display: inline-block;
  background: rgba(255,255,255,0.05);
  color: #e4e7eb;
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
  width: 100%;
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.file-upload:hover {
  background: rgba(0,174,239,0.08);
  border-color: rgba(0,174,239,0.3);
}

.file-upload input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  height: 100%;
  width: 100%;
  cursor: pointer;
}

/* Message d'erreur */
.form-error {
  color: #ff4b4b;
  font-size: 0.8rem;
  text-align: center;
  margin-top: -0.25rem;
  margin-bottom: 0.5rem;
  display: none;
}
.form-error.show {
  display: block;
}

/* Ligne de boutons dans modale */
.buttons-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.8rem;
}

.buttons-row button {
  padding: 0.85rem 1.8rem;
  font-size: 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  min-width: 160px;
  transition: all 0.25s ease;
}

/* Boutons confirm / cancel harmonisés */
.buttons-row .btn-confirm {
  background: #00AEEF;
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(0,174,239,0.3);
}
.buttons-row .btn-confirm:hover {
  background: #0099cc;
  box-shadow: 0 6px 18px rgba(0,174,239,0.4);
  transform: translateY(-2px);
}



/* =====================================================
   BOUTONS D’ACTION — STYLE UNIFIÉ XPERIUM
   ===================================================== */

/* --- Base commune --- */
.btn-cancel,
.btn-confirm,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  text-align: center;
  min-width: 140px;
}

/* --- Bouton confirmer (bleu Xperium) --- */
.btn-confirm {
  background: #00AEEF;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,174,239,0.3);
}

.btn-confirm:hover {
  background: #0099cc;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,174,239,0.4);
}

/* --- Bouton annuler (neutre sombre, halo bleu doux) --- */
/* Force bouton Annuler en gris, même si un style générique existe */
button.btn-cancel {
  background: rgba(255,255,255,0.05) !important;
  color: #e0e5ed !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow: 0 4px 10px rgba(0,174,239,0.15) !important;
}
button.btn-cancel:hover {
  background: rgba(0,174,239,0.08) !important;
  border-color: rgba(0,174,239,0.3) !important;
}

/* --- Bouton danger (rouge vif Xperium) --- */
.btn-danger {
  background: #c0392b;
  color: #fff;
  box-shadow: 0 4px 10px rgba(192,57,43,0.3);
}

.btn-danger:hover {
  background: #a93226;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(192,57,43,0.4);
}

/* --- États désactivés --- */
button[disabled],
.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

/* --- Animation subtile d’apparition --- */
@keyframes btnPop {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.btn-cancel, .btn-confirm, .btn-danger {
  animation: btnPop 0.3s ease both;
}

/* Spinner de chargement pour upload */
.spinner {
  border: 4px solid rgba(255,255,255,0.1);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 1rem auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Textes de progression upload */
.upload-progress-texts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.upload-progress-percent {
  font-size: 0.9rem;
  margin: 0;
  text-align: center;
}