/* À régler avec Olivier — charte Noveo Digital (crans sombres et bleu de marque de noveoapp) */

:root {
  --texte: #eaeef6;
  --texte-2: #ccd4e2;
  --attenue: #9aa6bd;
  --placeholder: #8592a9;
  --bordure: #6a7690;
  --survol: #39435a;
  --champ: #2c3548;
  --carte: #232c3f;
  --canvas: #0f131c;

  --marque: #025cf3;
  --action: #2569fb;
  --action-clair: #3e7cff;
  --action-texte: #9dc0ff;

  --filet: rgb(255 255 255 / 0.06);
  --voile: rgb(255 255 255 / 0.035);
  --rayon: 14px;
  --sortie: cubic-bezier(0.16, 1, 0.3, 1);
  --duree-courte: 150ms;
  --duree: 260ms;
  --duree-longue: 520ms;

  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--survol) var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--texte);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--action-clair);
}

::selection { background: rgb(37 105 251 / 0.4); color: #fff; }
:focus-visible { outline: 2px solid var(--action-clair); outline-offset: 2px; border-radius: 8px; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }

.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: max(40px, calc(env(safe-area-inset-top) + 20px)) 20px max(96px, calc(env(safe-area-inset-bottom) + 64px));
}

/* ---------- Notifications : une ligne discrète, visible tant qu'elles ne sont pas activées ---------- */

.notif { margin-top: 36px; display: flex; justify-content: center; font-size: 0.8125rem; color: var(--placeholder); }
.notif[hidden], .notif [hidden] { display: none; }

.notif__lien, .notif__qui button {
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--attenue);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 6px;
  transition: color var(--duree-courte) ease;
}

.notif__lien:hover, .notif__qui button:hover { color: var(--action-texte); }
.notif__qui { display: flex; align-items: center; gap: 14px; animation: deplier var(--duree) var(--sortie); }
.notif__qui button { color: var(--action-texte); font-weight: 600; }
.notif__astuce { text-align: center; }

/* ---------- En-tête : le logo, puis les deux onglets ---------- */

.logo { width: 120px; height: auto; }
.logo__mot path { fill: #fff; }

.onglets {
  position: relative;
  display: flex;
  gap: 28px;
  margin-top: 40px;
  border-bottom: 1px solid var(--filet);
}

.onglet {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 0 14px;
  border: 0;
  background: none;
  color: var(--attenue);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color var(--duree-courte) ease;
}

.onglet:hover { color: var(--texte-2); }
.onglet[aria-selected="true"] { color: var(--texte); }

.onglet__nombre {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--placeholder);
  font-variant-numeric: tabular-nums;
}

.onglet[aria-selected="true"] .onglet__nombre { color: var(--action-texte); }

.onglet__nombre.saute { animation: saute 520ms var(--sortie); }

@keyframes saute {
  30% { transform: translateY(-5px) scale(1.15); color: var(--action-texte); }
}

.onglets__curseur {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: var(--marque);
  transition: transform var(--duree) var(--sortie), width var(--duree) var(--sortie);
}

/* ---------- Ajout : un champ, Entrée pour valider ---------- */

.ajout { margin-top: 20px; }

.ajout__titre {
  width: 100%;
  min-height: 48px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--duree) var(--sortie);
}

.ajout__titre::placeholder { color: var(--placeholder); }
.ajout__titre:focus { border-bottom-color: var(--action); }

.panneau[data-onglet="reglees"] .ajout { display: none; }

/* ---------- La liste : un cercle, un titre ---------- */

.lignes { margin-top: 8px; }

.tache {
  position: relative;
  overflow: hidden;
  border-radius: var(--rayon);
  touch-action: pan-y;
  transition: background-color var(--duree-courte) ease;
}

.tache__glisse {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  transition: transform var(--duree) var(--sortie);
}

/* La croix rouge : au survol sur ordinateur, en faisant glisser la ligne vers la gauche au doigt */

.tache__suppr {
  position: absolute;
  top: 8px;
  right: 6px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ff8787;
  opacity: 0;
  transition: opacity var(--duree-courte) ease, background-color var(--duree-courte) ease;
}

.tache__suppr svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.tache__suppr:focus-visible { opacity: 1; }

@media (hover: hover) {
  .tache:hover .tache__suppr, .tache:focus-within .tache__suppr { opacity: 0.7; }
  .tache__suppr:hover { opacity: 1 !important; background: rgb(255 135 135 / 0.12); }
  .tache .tache__ouvrir { padding-right: 48px; }
}

.tache--revelee .tache__glisse { transform: translateX(-52px); }
.tache--revelee .tache__suppr { opacity: 1; }

.tache-supprimee {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding-left: 46px;
  font-size: 0.8125rem;
  color: var(--placeholder);
  animation: deplier var(--duree) var(--sortie);
}

.tache-supprimee button {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--action-texte);
  font-weight: 600;
  border-radius: 4px;
}

.tache-supprimee button:hover { text-decoration: underline; text-underline-offset: 3px; }

@keyframes deplier { from { opacity: 0; } }

.tache:hover, .tache--ouverte { background: var(--voile); }
.tache--nouvelle { animation: nouvelle 1.6s var(--sortie); }

@keyframes nouvelle { from { background-color: rgb(37 105 251 / 0.22); } }
.tache--ouverte { background: var(--carte); }

.coche {
  position: relative;
  width: 44px;
  height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
}

.coche::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--bordure);
  transition: border-color var(--duree-courte) ease, background-color var(--duree) var(--sortie), transform var(--duree) var(--sortie);
}

.coche svg {
  position: relative;
  width: 13px; height: 13px;
  fill: none;
  stroke: var(--action-texte);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity var(--duree-courte) ease;
}

.coche__trait { stroke-dasharray: 20; stroke-dashoffset: 0; }

.coche:hover::before { border-color: var(--action-clair); }
.coche:hover svg { opacity: 0.7; }
.coche:active::before { transform: scale(0.86); }

.tache__corps { min-width: 0; }

.tache__ouvrir {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 16px 14px 2px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--texte);
  text-wrap: pretty;
  border-radius: var(--rayon);
}

.tache__titre {
  background-image: linear-gradient(var(--action-texte), var(--action-texte));
  background-repeat: no-repeat;
  background-position: 0 58%;
  background-size: 0% 1.5px;
  transition: background-size var(--duree-longue) var(--sortie), color var(--duree) ease;
}

/* Le menu déroulant d'une tâche */

.tache__plus {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--duree) var(--sortie);
}

.tache__plus-interieur {
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  padding-right: 16px;
  transition: visibility 0s linear var(--duree);
}

.tache--ouverte .tache__plus { grid-template-rows: 1fr; }
.tache--ouverte .tache__plus-interieur { visibility: visible; transition-delay: 0s; }

.tache__infos { font-size: 0.8125rem; color: var(--attenue); font-variant-numeric: tabular-nums; }
.tache__infos .infos__alerte { color: #ffa94d; }

.tache__detail, .tache__doute {
  max-width: 64ch;
  margin-top: 10px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--texte-2);
  text-wrap: pretty;
}

.tache__doute { margin-top: 8px; font-size: 0.8125rem; color: var(--attenue); }
.tache__doute::before { content: "À vérifier : "; font-weight: 600; color: var(--texte-2); }
.tache__detail:empty, .tache__doute:empty, .tache__infos:empty { display: none; }

.tache__pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin: 14px 0 16px;
}

.tache__proprio { display: inline-flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--attenue); }

.tache__proprio select {
  appearance: none;
  min-height: 34px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--survol);
  border-radius: 8px;
  background: var(--champ) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa6bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 8px center / 16px;
  color: var(--texte);
  font-size: 0.8125rem;
  transition: border-color var(--duree-courte) ease;
}

.tache__proprio select:hover { border-color: var(--bordure); }
.tache__proprio option { background: var(--champ); }

.tache__lien {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--action-texte);
  text-decoration: none;
  border-radius: 4px;
}

.tache__lien:hover { text-decoration: underline; text-underline-offset: 3px; }
.tache__lien[hidden] { display: none; }

/* Coche : le cercle se remplit, le V se trace, le titre est barré */

.tache--reglee .coche::before,
.tache--faite .coche::before { background: var(--action); border-color: var(--action); }
.tache--reglee .coche::before { transform: scale(1.08); }
.tache--reglee .coche svg, .tache--faite .coche svg { opacity: 1; stroke: #fff; }
.tache--reglee .coche__trait { animation: tracer 320ms var(--sortie) both; }
.tache--reglee .tache__titre { background-size: 100% 1.5px; color: var(--attenue); }

.tache--faite .tache__ouvrir { color: var(--attenue); }
.tache--faite.tache--rouverte .coche::before { background: transparent; border-color: var(--bordure); }
.tache--faite.tache--rouverte .coche svg { opacity: 0; }

@keyframes tracer { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }

/* ---------- Vide, chargement, pages ---------- */

.vide { padding: 56px 0; text-align: center; color: var(--placeholder); font-size: 0.9375rem; }

.squelette { height: 52px; margin-top: 4px; border-radius: var(--rayon); background: var(--carte); animation: respire 1.4s ease-in-out infinite alternate; }
@keyframes respire { to { opacity: 0.5; } }

.pages { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 28px; }
.pages[hidden] { display: none; }

.pages__position { min-width: 64px; text-align: center; font-size: 0.8125rem; color: var(--attenue); font-variant-numeric: tabular-nums; }

.pages__fleche {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--attenue);
  transition: background-color var(--duree-courte) ease, color var(--duree-courte) ease;
}

.pages__fleche:hover:not(:disabled) { background: var(--carte); color: var(--texte); }
.pages__fleche:disabled { opacity: 0.25; cursor: default; }
.pages__fleche svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Alerte d'erreur (sans bouton, disparaît seule) ---------- */

.alerte {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  max-width: min(520px, calc(100vw - 40px));
  padding: 10px 16px;
  border: 1px solid #ff8787;
  border-radius: 10px;
  background: var(--champ);
  color: #ffc9c9;
  font-size: 0.875rem;
  box-shadow: 0 10px 28px -8px rgb(0 0 0 / 0.65);
  transform: translateX(-50%);
}

.alerte[hidden] { display: none; }

/* ---------- La tâche s'envole dans l'onglet ---------- */

::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(*) { animation-duration: var(--duree-longue); animation-timing-function: var(--sortie); }
::view-transition-old(*), ::view-transition-new(*) { height: 100%; object-fit: cover; object-position: left top; }
::view-transition-new(envol) { animation: none; opacity: 0; }
::view-transition-old(envol) { animation: envol var(--duree-longue) var(--sortie) both; }

@keyframes envol { to { opacity: 0; } }

@media (max-width: 599px) {
  .app { padding: 28px 16px 80px; }
  .logo { width: 104px; }
  .onglets { margin-top: 28px; gap: 22px; }
  .onglet { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Écran de connexion ---------- */

.connexion { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.connexion__boite { width: min(360px, 100%); }
.connexion .logo { width: 132px; margin-bottom: 56px; }

.connexion__formulaire {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--survol);
  transition: border-color var(--duree) var(--sortie);
}

.connexion__formulaire:focus-within { border-bottom-color: var(--action); }
.connexion__champs { flex: 1; display: grid; }

.connexion__champ {
  width: 100%;
  min-height: 46px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  font-size: 1rem;
  outline: none;
}

.connexion__champ + .connexion__champ { border-top: 1px solid var(--filet); }
.connexion__champ::placeholder { color: var(--placeholder); }

.connexion__entrer {
  flex: none;
  width: 38px;
  height: 38px;
  margin-bottom: 4px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--action);
  color: #fff;
  transition: background-color var(--duree-courte) ease, transform var(--duree-courte) ease;
}

.connexion__entrer:hover { background: var(--action-clair); }
.connexion__entrer:active { transform: scale(0.94); }
.connexion__entrer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.connexion__message { min-height: 20px; margin-top: 16px; font-size: 0.8125rem; color: #ffc9c9; }
