/* Tâches : un seul thème, sombre, aux couleurs de Xerus. */

@font-face { font-family: 'Kanit'; font-weight: 300; font-display: swap; src: url('fonts/kanit-300.woff2') format('woff2'); }
@font-face { font-family: 'Kanit'; font-weight: 400; font-display: swap; src: url('fonts/kanit-400.woff2') format('woff2'); }
@font-face { font-family: 'Kanit'; font-weight: 500; font-display: swap; src: url('fonts/kanit-500.woff2') format('woff2'); }

:root {
  --fond: #0A0A0A;
  --surface: #141414;
  --surface-2: #1B1B1B;
  --filet: #262626;
  --texte: #F2F2F2;
  --texte-2: #C8C8C8;
  --discret: #9A9A9A;
  --accent: #fe1f58;
  --accent-fond: #1A0C11;
  --accent-filet: #4A1626;
  --accent-meta: #C9A0AC;
  --vert: #5FD39A;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); }
body {
  font-family: 'Kanit', system-ui, sans-serif; font-weight: 300; font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ cadre */

.page {
  max-width: 1480px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 26px;
}
.tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.tete-titre { display: flex; flex-direction: column; gap: 2px; }
.tete-date { font-size: 13px; color: var(--discret); }
h1 { margin: 0; font-size: 30px; font-weight: 500; letter-spacing: -0.5px; line-height: 1.1; }
.tete-droite { display: flex; align-items: center; gap: 14px; }
.compteur { font-family: var(--mono); font-size: 12px; color: var(--discret); }
.lien-discret { background: none; border: none; padding: 8px 0; color: var(--texte-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--filet); }

.colonnes { display: flex; flex-direction: column; gap: 28px; }
.colonne { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.colonne-titre { margin: 0; font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.colonne-titre .nb { font-weight: 300; color: var(--discret); }
.colonne-titre.attend { color: var(--accent); }
.colonne-titre.attend .nb { color: var(--accent); }
.colonne-titre.fait { color: var(--discret); }
.point { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.point.attend { background: var(--accent); }
.point.cours { background: var(--vert); }
.point.faire { border: 1.5px solid var(--discret); }
.vide { font-size: 14px; color: var(--discret); padding: 4px 0 8px; }

/* ------------------------------------------------------------------ cartes */

.carte { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.carte.attend { background: var(--accent-fond); border: 1px solid var(--accent-filet); gap: 10px; }
.carte.libre { background: transparent; border: 1px dashed var(--filet); }
.meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.meta-gauche { font-family: var(--mono); font-size: 11px; color: var(--discret); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte.attend .meta-gauche { color: var(--accent-meta); }
.meta-droite { font-size: 12px; white-space: nowrap; }
.meta-droite.rouge { color: var(--accent); }
.meta-droite.vert { color: var(--vert); }
.meta-droite.retard { color: var(--accent); }
.carte-titre { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.carte-titre.leger { font-weight: 400; font-size: 16px; }
.carte-texte { margin: 0; font-size: 14px; color: var(--texte-2); overflow-wrap: anywhere; }
.carte-sous { font-size: 13px; color: var(--discret); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

.bouton {
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--filet);
  background: transparent; font-size: 14px; font-weight: 400;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; gap: 6px;
}
.bouton.plein { background: var(--accent); border-color: var(--accent); color: #0A0A0A; font-weight: 500; flex-grow: 1; }
.bouton.clair { background: var(--texte); border-color: var(--texte); color: #0A0A0A; font-weight: 500; }
.bouton.mono { font-family: var(--mono); font-size: 13px; }
.carte.attend .bouton:not(.plein) { border-color: var(--accent-filet); }
.bouton.petit { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }

/* Une liste de tâches à faire : des lignes, pas des cartes. */
.liste { background: var(--surface); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; }
.ligne { border-bottom: 1px solid #202020; }
.ligne:last-child { border-bottom: none; }
.ligne-bouton {
  width: 100%; background: none; border: none; text-align: left; padding: 14px 16px;
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
}
.ligne-bouton:hover { background: var(--surface-2); }
.ligne-corps { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ligne-titre { font-size: 15px; font-weight: 400; overflow-wrap: anywhere; }
.ligne-sous { font-size: 12px; color: var(--discret); }
.ligne-date { font-size: 12px; white-space: nowrap; }
.ligne-date.retard { color: var(--accent); }
.ligne-ouverte { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.ligne.ouverte .ligne-bouton { background: var(--surface-2); }

.champ { display: flex; flex-direction: column; gap: 4px; }
.champ label { font-size: 12px; color: var(--discret); }
.champ input, .champ textarea, .champ select {
  width: 100%; background: var(--fond); border: 1px solid var(--filet); border-radius: 10px;
  padding: 10px 12px; font-size: 15px; font-weight: 300;
}
.champ textarea { min-height: 84px; resize: vertical; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.compte-rendu { font-size: 13px; color: var(--discret); display: flex; flex-direction: column; gap: 2px; }
.compte-rendu b { color: var(--texte); font-weight: 400; }

/* Sessions libres : discrètes, mais présentes. */
.libres { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.libres-titre { font-size: 13px; color: var(--discret); margin: 0; font-weight: 400; }
.libre-ligne { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--filet); border-radius: 12px; }
.libre-corps { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.libre-titre { font-size: 14px; color: var(--texte-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.libre-sous { font-size: 12px; color: var(--discret); }
.icone-bouton { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--filet); background: none; display: inline-flex; align-items: center; justify-content: center; flex: none; text-decoration: none; }

/* ------------------------------------------------------------------ saisie */

.saisie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--fond) 70%, rgba(10,10,10,0));
}
.saisie form { max-width: 1480px; margin: 0 auto; display: flex; gap: 8px; }
.saisie input {
  flex-grow: 1; min-width: 0; height: 48px; padding: 0 16px; border: 1px solid #333; border-radius: 14px;
  background: var(--surface); font-size: 16px; font-weight: 300;
}
.saisie .ajouter { width: 48px; height: 48px; border: none; border-radius: 14px; background: var(--texte); display: flex; align-items: center; justify-content: center; flex: none; }

.bandeau {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 6;
  background: var(--texte); color: #0A0A0A; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 400;
}
.bandeau.erreur { background: var(--accent); }

/* ------------------------------------------------------------------ connexion */

.connexion { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 24px; max-width: 420px; margin: 0 auto; }
.connexion p { color: var(--texte-2); margin: 0; }

/* ------------------------------------------------------------------ historique */

.historique { display: flex; flex-direction: column; gap: 8px; }
.histo-ligne { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #1E1E1E; }
.histo-ligne:last-child { border-bottom: none; }

/* ------------------------------------------------------------------ grand écran */

.tactile-seulement { display: none; }
@media (pointer: coarse) {
  .mac-seulement { display: none !important; }
  .tactile-seulement { display: block; }
}

@media (min-width: 1000px) {
  .page { padding: 32px 40px 110px; gap: 28px; }
  .colonnes { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.85fr); gap: 20px; align-items: start; }
  .colonne { background: #111; border-radius: 20px; padding: 18px; }
  .colonne.col-attend { background: var(--accent-fond); }
  .colonne.col-attend .carte.attend { background: var(--fond); }
  .colonne.col-fait { background: transparent; }
  .colonne .liste, .colonne .carte:not(.attend) { background: var(--surface-2); }
  .colonne .ligne-bouton:hover, .colonne .ligne-ouverte, .colonne .ligne.ouverte .ligne-bouton { background: #222; }
}

.formulaire-cr { display: flex; flex-direction: column; gap: 12px; }
.estompe { color: var(--texte-2); }
.barre { color: var(--discret); text-decoration: line-through; }
.liste.histo { padding: 0 16px; }
.connexion .erreur { color: var(--accent); }

@media (min-width: 1000px) {
  .saisie { padding: 14px 40px 18px; }
  .saisie form { max-width: 1400px; }
  .libre-corps .bouton { align-self: flex-start; margin-top: 6px; }
}
.bouton.icone-bouton { min-height: 36px; padding: 0; }
