/* ==========================================================================
   GLOBAL.CSS — Styles transversaux et fondations du Design System
   ==========================================================================
   RÔLE :
     - Définit les styles généraux utilisés sur l’ensemble du site :
         * reset et bases typographiques
         * couleurs, surfaces, espacement général
         * layout global des pages
         * classes utilitaires réellement universelles (.note, .hidden, etc.)
     - Constitue la fondation du design Planif.education.

   SÉPARATION STRICTE :
     - Ne JAMAIS mettre ici de styles propres à une page :
         * descriptif_page.css
         * objectifs_page.css
         * compte/index.css
     - Ne JAMAIS mettre ici de styles spécifiques à un composant :
         * buttons.css
         * header.css
         * modal.css ou modal-projet.css
     - Ce fichier ne doit contenir AUCUNE logique liée à un module particulier.

   DÉPENDANCES :
     - S’appuie sur les variables définies dans : _variables.css
     - Affecte toutes les pages → toute modification doit être testée
       sur Login, Compte et Modules.

   ZONES SENSIBLES :
     - Styles trop génériques (p, button, textarea) peuvent casser
       plusieurs composants.
     - Le layout global des pages modules dépend de certaines règles ici.
     - L’impact est transversal → régressions multiples possibles.

   RÈGLES DE MODIFICATION :
     - Ajouter uniquement des styles qui seront utilisés à travers tout le site.
     - Ne jamais introduire de styles qui pourraient écraser un composant existant.
     - Toute modification suit le workflow Planif.education :
         * une seule action à la fois
         * analyse d’impact
         * implémentation contrôlée
         * test sur toutes les pages

   NOTE :
     - Ce fichier est la base du Design System : il doit rester stable,
       léger et sans logique spécifique à une page ou un module.
   ========================================================================== */

/* --------- Importation des composants --------- */
@import url("./components/buttons.css");
@import url("./components/forms.css");
@import url("./components/card-auth.css");
@import url("./components/page-auth.css");
@import url("./components/explication.css");
@import url("./components/cards.css");

html, body {
  overflow-x: hidden;
  width: 100%;
}


body {
  margin: 0;
  padding: 0;
  background: var(--c-fond);
  color: var(--c-texte);
  font-family: var(--font-corps);
  line-height: 1.6;
    max-width: 100vw;
}

img {
  max-width: 100%;
  display: block;
}

/* --------- Typographie --------- */
h1, h2, h3, h4 {
  font-family: var(--font-titres);
  color: var(--c-titre);
  margin: 0 0 0px;
}
.module-page-title {
  position: relative;

  font-size: 2rem;
  font-weight: 600;
  margin-top: 8px;
  margin-bottom: 28px; /* un peu plus d’air */
  letter-spacing: 0.01em;
}
.module-page-title::after {
  content: "";
  display: block;
  margin-top: var(--espace-sm);

  height: 6px;
  width: 420px;

  border-radius: 999px;

  background: linear-gradient(
    90deg,
    var(--c-accent-hover) 0%,
    var(--c-accent) 60%,
    transparent 100%
  );
}
p {
  margin: 0 0 14px;
}
/* =========================================================
   TEXTAREA — Style universel Planif.education
   ========================================================= */

textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;

  padding: 8px 10px;

  font-family: var(--font-corps);
  font-size: 13.5px;
  line-height: 1.45;

  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border-subtle);
  background: var(--c-surface-1);
  color: var(--c-texte);

  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    background-color 120ms ease;
}

textarea:focus {
  outline: none;
  border-color: var(--c-bleu-500);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-bleu-500) 12%, transparent);
}

.page-container {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;

}


.page-auth {
  background: var(--c-fond);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
}
#header-container + * {
  margin-top: 12px !important;
}


/* ============================================================
   DESCRIPTIF — MESSAGE D’ATTENTE IA
   (copie conforme de la logique Objectifs)
============================================================ */

/* Alignement boutons IA + message */
.actions-ia {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Encadré message IA */
.ia-loading-box {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;

  border-radius: 6px;
  background: rgba(123, 97, 255, 0.10);
  color: var(--text-main);

  border: 1px solid rgba(123, 97, 255, 0.30);

  animation: iaPulse 1.6s ease-in-out infinite;
  white-space: nowrap;
}

/* Animation douce (locale Descriptif) */
@keyframes iaPulse {
  0%   { opacity: 0.45; }
  50%  { opacity: 0.9; }
  100% { opacity: 0.45; }
}

.ia-hidden {
  display: none !important;
}

/* ============================================================
   CHECKBOX — Style universel Planif.education
   ============================================================ */

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;

  width: 16px;
  height: 16px;

  border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-sm);

  background: var(--c-surface-1);

  cursor: pointer;
  position: relative;

  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

/* Hover */
input[type="checkbox"]:hover {
  border-color: var(--c-primaire);
}

/* Checked state */
input[type="checkbox"]:checked {
  background: var(--c-primaire);
  border-color: var(--c-primaire);
}

/* Checkmark */
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;

  left: 4px;
  top: 1px;

  width: 4px;
  height: 8px;

  border: solid white;
  border-width: 0 2px 2px 0;

  transform: rotate(45deg);
}

/* Focus accessibility */
input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.18);
}

/* ============================================================
   INFO CONTEXTUELLE — Message d’aide universel
   ============================================================ */
.info-contextuelle {
  padding: 8px 12px;

  font-size: 13px;
  line-height: 1.45;

  color: var(--c-texte-clair);

  background: var(--c-surface-2);
  border-left: 3px solid var(--c-bleu-500);

  border-radius: var(--radius-sm);

  width: fit-content;
}
/* ============================================================
   UI — Animations génériques apparition / disparition
   ============================================================ */

.ui-appearing {
  opacity: 0;
  transform: translateX(-8px);
  animation: uiAppear 0.22s ease forwards;
}

@keyframes uiAppear {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ui-removing {
  opacity: 0;
  transform: translateX(8px);
  height: 0 !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    height 0.22s ease,
    margin 0.22s ease,
    padding 0.22s ease;
  
}


/* =========================================================
   LIENS — Standard universel Planif.education
   ========================================================= */

.ui-link {
  color: var(--c-primaire);
  text-decoration: none;
  font-weight: 500;

  display: inline-flex;
  align-items: center;
  gap: 6px;

  transition: color 120ms ease;
}

.ui-link:hover {
  color: var(--c-primaire-hover);
  text-decoration: underline;
}

.ui-link:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(192,132,252,0.35);
  border-radius: 3px;
}

/* Icône lien externe */

.ui-icon-external {
  width: 14px;
  height: 14px;

  stroke: currentColor;
  fill: none;

  opacity: 0.8;

  transform: translateY(1px);
}
/* =========================================================
   SCROLLBAR — Style universel Planif.education
   ========================================================= */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--c-bleu-500) transparent;
}
/* Chrome / Edge / Safari */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
  border-radius: var(--radius-sm);
}

*::-webkit-scrollbar-thumb {
  background: var(--c-bleu-500);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background 120ms ease;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--c-bleu-900);
}

/* =========================================================
   STATUS INDICATOR — Universel Planif
   ========================================================= */

.status-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 18px;
  height: 18px;

  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;

  transition: all 120ms ease;
}

/* Couvert */
.status-indicator.is-covered {
  background: var(--c-bleu-500);
  color: var(--c-bleu-900);
}

.status-indicator.is-covered::before {
  content: "✓";
}

/* Non couvert */
.status-indicator.is-uncovered {
  background: var(--c-surface-2);
  color: var(--c-texte-muted);
}

.status-indicator.is-uncovered::before {
  content: "–";
}
/* Orphelin (non lié à une activité) */
.status-indicator.is-orphan {
  background: #f39c12;
  color: white;
}

.status-indicator.is-orphan::before {
  content: "!";
}
/* ============================================================
   UTIL — Flash cadre uniquement (macroplanif)
   ============================================================ */

.is-flash {
  animation: flashBorder 1.2s ease-out;
}

@keyframes flashBorder {
  0% {
    box-shadow: 0 0 0 0 var(--c-flash-ring);
  }
  50% {
    box-shadow: 0 0 0 4px var(--c-flash-ring);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ============================================================
   Flash spécifique — ÉVALUATIONS (cyan)
   ============================================================ */

.macro-evaluation-carte.is-flash {
  animation: flashBorderEvaluation 1.2s ease-out;
}

@keyframes flashBorderEvaluation {
  0% {
    box-shadow: 0 0 0 0 var(--c-accent);
  }
  50% {
    box-shadow: 0 0 0 4px var(--c-accent);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* =========================================================
   UI — Chevron universel Planif.education
   ========================================================= */

.ui-chevron {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 28px;
  height: 28px;

  cursor: pointer;
  user-select: none;
}

.ui-chevron::before {
  content: "";

  width: 12px;
  height: 12px;

  border-right: 3.5px solid currentColor;
  border-bottom: 3.5px solid currentColor;

  transform: rotate(-45deg);
  transition: transform 0.16s ease;
}

/* Rotation contrôlée par état */
.ui-chevron.is-open::before {
  transform: rotate(45deg);
}

/* Chevron ouvert lorsque dropdown actif */
.dropdown--open .ui-chevron::before {
  transform: rotate(45deg);
}