@font-face { font-family: "League Spartan"; src: url("/polices/LeagueSpartan-SemiBold.otf") format("opentype"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "League Spartan"; src: url("/polices/LeagueSpartan-Bold.otf") format("opentype"); font-weight: 700 900; font-display: swap; }

/* Mêmes couleurs de base que Glow365, accent vert du logo LesTasK */
:root {
  --bg: #f5f7fb; --card: #ffffff; --soft: #eef2f8; --line: #e3e8f0; --text: #172033; --muted: #5d6880;
  --blue: #1d4ed8; --blue-soft: #e8efff; --green: #12a877; --green-soft: #e3f7ef;
  --danger: #c2410c; --warn-bg: #fff7ed; --glass: rgb(255 255 255 / .92);
  --radius: 18px; --shadow: 0 6px 24px rgb(23 32 51 / .08); --nav-h: 68px; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1522; --card: #182133; --soft: #1f2a40; --line: #2b3852; --text: #eef2fa; --muted: #a8b3c9;
    --blue: #7aa2ff; --blue-soft: #22305a; --green: #4fdcaa; --green-soft: #173b33;
    --danger: #ff9b73; --warn-bg: #3a2a1a; --glass: rgb(24 33 51 / .92); --shadow: 0 6px 24px rgb(0 0 0 / .35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Rien ne dépasse sur les côtés : la page ne glisse pas de travers et le menu du bas reste fixe */
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 17px/1.45 "League Spartan", system-ui, sans-serif;
  padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
main { max-width: 900px; margin: 0 auto; padding: 8px 16px 24px; }
main:focus { outline: none; }
h1 { font-size: 1.7rem; margin: 8px 0 2px; line-height: 1.15; text-align: center; }
h2 { font-size: 1.1rem; margin: 26px 0 10px; text-align: center; }
.sous { color: var(--muted); margin: 0 0 14px; text-align: center; }

.barre { position: sticky; top: 0; z-index: 5; background: var(--glass); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: calc(8px + env(safe-area-inset-top)) 16px 8px; }
.marque { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 900px; margin: 0 auto; color: var(--text); font-weight: 800; font-size: 1.6rem; }
/* Heure à gauche, date à droite dans le menu du haut (téléphone seulement) */
.horloge { position: absolute; top: calc(50% + env(safe-area-inset-top) / 2); translate: 0 -50%; color: var(--muted); font-weight: 700; font-size: .9rem; line-height: 1.15; }
.horloge.gauche { left: 14px; } .horloge.droite { right: 14px; text-align: right; white-space: pre-line; }
@media (min-width: 761px) { .horloge { display: none; } }
.logo { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; object-position: 50% 42%; }

.recherche { display: flex; align-items: center; gap: 10px; color: var(--muted); background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 0 14px; box-shadow: var(--shadow); }
.recherche input { flex: 1; border: 0; background: none; padding: 14px 0; min-width: 0; outline: none; }

.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tuile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; color: var(--text); min-height: 84px; }
.tuile .ico { color: var(--blue); background: var(--blue-soft); width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 6px; }
.tuile b { font-weight: 700; }
.tuile small { color: var(--muted); }

.liste { display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 0; list-style: none; }
.doc { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; min-height: 64px; }
.doc .ico { color: var(--blue); width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); flex: none; }
.doc .txt { flex: 1; min-width: 0; }
.doc b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc small { color: var(--muted); }
.vide { color: var(--muted); text-align: center; padding: 28px 12px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

.entete { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; }
.entete h1 { margin: 0; }
.retour { border: 1px solid var(--line); background: var(--card); border-radius: 12px; min-width: 48px; min-height: 48px; cursor: pointer;
  display: grid; place-items: center; }
.puces { display: flex; justify-content: safe center; gap: 8px; overflow-x: auto; padding: 4px 0 10px; }
.puce { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; white-space: nowrap; cursor: pointer; min-height: 44px; }
.puce[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Bouton + au milieu de la barre du bas, un peu surélevé */
.onglets .ajout { flex: none; align-self: center; width: 58px; height: 58px; margin: 0 4px; transform: translateY(-14px); border-radius: 50%; border: 4px solid var(--bg);
  background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgb(29 78 216 / .35); }
.onglets .ajout .dessin { width: 26px; height: 26px; stroke-width: 2.2; }
.onglets .ajout:active { transform: translateY(-14px) scale(.94); }
.dessin { width: 22px; height: 22px; display: block; }
.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; gap: 8px;
  background: var(--glass); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 0 16px env(safe-area-inset-bottom); }
/* Icône seule ; le nom s'affiche seulement sous l'onglet sélectionné */
.onglets a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--nav-h); color: var(--muted); font-size: .85rem; }
.onglets a span[aria-hidden] { line-height: 1; display: grid; place-items: center; width: 56px; height: 34px;
  border-radius: 999px; transition: background .15s; }
.onglets a .lib { display: none; }
.onglets a.actif { color: var(--blue); font-weight: 700; }
.onglets a.actif span[aria-hidden] { background: var(--blue-soft); }
.onglets a.actif .lib { display: block; }

.feuille { border: 0; padding: 0; width: min(560px, 100%); max-height: 92vh; margin: auto auto 0; border-radius: 22px 22px 0 0;
  background: var(--card); color: var(--text); box-shadow: var(--shadow); }
@media (min-width: 761px) { .feuille { margin: auto; border-radius: 22px; } }
.feuille::backdrop { background: rgb(10 15 25 / .45); }
.feuille form, .feuille .corps { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.feuille h2 { margin: 0; font-size: 1.3rem; text-align: center; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
label small { color: var(--muted); font-weight: 500; }
input, select { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px; min-height: 48px; width: 100%; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choisir { border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; cursor: pointer; background: var(--bg); }
.choisir input { display: none; }
.choisir-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choisir-3 .choisir { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px; font-weight: 700; color: var(--blue); }
.choisir-3 .dessin { width: 30px; height: 30px; }
.choisi:empty { display: none; }
.boutons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { flex: 1; min-height: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; }
.btn.principal { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn:disabled { opacity: .6; }
.btn.empreinte { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; margin: 0 0 14px; font-size: 1.05rem; }
.btn.empreinte .dessin { width: 28px; height: 28px; }
.avertir { background: var(--warn-bg); border-radius: 12px; padding: 12px; }
.note { background: var(--blue-soft); border-radius: 12px; padding: 12px; margin: 0; }
label.propose input, label.propose select { border: 2px solid var(--blue); }
.infos { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.infos dt { color: var(--muted); }
.infos dd { margin: 0; }

.message { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 92px); transform: translateX(-50%); z-index: 20;
  background: var(--text); color: var(--bg); border-radius: 12px; padding: 12px 16px; max-width: calc(100% - 32px);
  opacity: 0; pointer-events: none; transition: opacity .2s; }
.message.visible { opacity: 1; }
.message.erreur { background: var(--danger); color: #fff; }

/* Étape 2 : connexion, corbeille, historique */
.deconnecte .onglets { display: none; }
.comptes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.compte { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 12px; min-height: 120px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 1.1rem; }
.compte .ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 800; font-size: 1.5rem; }
.carte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.carte h2 { margin: 0; }
a.doc { color: var(--text); }
.btn.danger { color: var(--danger); }
.boutons.vider { margin-bottom: 12px; }
.ligne-journal, .ligne-compte { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px; }
.ligne-journal small, .ligne-compte small { color: var(--muted); }
.ligne-compte { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.ligne-compte .btn { flex: none; }
.champ-mdp { position: relative; display: block; }
.champ-mdp input { padding-right: 56px; }
.oeil { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 48px; height: 44px; border: 0; background: none;
  font-size: 1.3rem; cursor: pointer; border-radius: 10px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.oeil:active { background: var(--soft); }

/* Étape 4a : texte lu dans les documents */
.extrait { display: block; font-style: italic; }
.texte summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.titre-ico { display: flex; align-items: center; justify-content: center; gap: 10px; }
.titre-ico .dessin { width: 26px; height: 26px; color: var(--blue); }
.texte-lu { white-space: pre-wrap; word-break: break-word; max-height: 40vh; overflow: auto; margin: 8px 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; font-size: .9rem; }

/* Boutons ronds à icône : le nom apparaît au survol ou quand le bouton est sélectionné */
.icones { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 4px 0 22px; }
.ico-btn { position: relative; display: flex; flex-direction: column; align-items: center; border: 0; background: none; cursor: pointer;
  color: var(--text); padding: 0; }
.ico-btn > span[aria-hidden]:first-child { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--soft); color: var(--text); transition: transform .15s, background .15s; }
.ico-btn:hover > span:first-child { background: var(--blue-soft); color: var(--blue); }
.ico-btn.principal > span:first-child { background: var(--blue); color: #fff; }
.ico-btn.danger > span:first-child { color: var(--danger); }
.ico-btn .lib { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  font-size: .8rem; font-weight: 700; visibility: hidden; white-space: nowrap; }
.ico-btn:hover .lib, .ico-btn:focus-visible .lib, .ico-btn:active .lib { visibility: visible; }
.ico-btn:active > span:first-child { transform: scale(.92); }
.ico-btn:focus-visible { outline: none; }
.ico-btn:focus-visible > span:first-child { outline: 3px solid var(--blue); outline-offset: 2px; }
.ico-btn.danger .lib { color: var(--danger); }

/* Visionneuse : plein écran, fond noir, outils discrets en bas */
.visionneuse { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: #000; color: #fff; display: flex; flex-direction: column; }
.visionneuse:not([open]) { display: none; }
.visionneuse::backdrop { background: #000; }
.vue-scene { flex: 1; position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.vue-contenu { position: absolute; left: 0; top: 0; width: 100%; transform-origin: 0 0; display: flex; flex-direction: column;
  align-items: center; gap: 8px; will-change: transform; }
.vue-contenu img { display: block; max-width: 100%; height: auto; pointer-events: none; background: #fff; }
.vue-texte { white-space: pre-wrap; word-break: break-word; margin: 0; padding: 20px; max-width: 760px; font: inherit; color: #e8e8e8; }
.vue-vide { padding: 40px 24px; text-align: center; color: #bbb; }
.vue-outils { display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgb(0 0 0 / .85); }
.vue-outil { width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; color: rgb(255 255 255 / .82);
  display: grid; place-items: center; cursor: pointer; }
.vue-outil:hover, .vue-outil:focus-visible { background: rgb(255 255 255 / .12); color: #fff; outline: none; }
.vue-outil:active { transform: scale(.92); }
.vue-compteur { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: .8rem; color: rgb(255 255 255 / .85); background: rgb(0 0 0 / .55);
  padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.vue-compteur:empty { display: none; }

/* Icônes au trait dans le texte */
.avec-ico { display: inline-flex; align-items: center; gap: 8px; }
p.avec-ico { display: flex; }
.avec-ico .dessin, .btn .dessin { flex: none; }
.btn .dessin { margin-right: 8px; }
.oeil .dessin { margin: auto; }
.action-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; margin-right: 8px;
  vertical-align: middle; background: var(--blue-soft); color: var(--blue); }
.action-ico .dessin { width: 16px; height: 16px; }

/* Visionneuse : le nouveau document arrive du côté où l'on a glissé */
.vue-contenu.arrive-droite { animation: arrive-droite .25s ease-out; }
.vue-contenu.arrive-gauche { animation: arrive-gauche .25s ease-out; }
@keyframes arrive-droite { from { opacity: 0; translate: 60px 0; } }
@keyframes arrive-gauche { from { opacity: 0; translate: -60px 0; } }
.visionneuse { transition: background-color .15s; }

/* Petite fenêtre de confirmation */
.confirmer { margin: auto; border-radius: 22px; width: min(400px, calc(100% - 32px)); }
.confirmer .question { margin: 0; text-align: center; font-weight: 600; }

/* Scanner : coins à ajuster, puis choix Couleur / Gris / Noir et blanc (nom visible seulement pour le choix actif) */
.scan-toile { position: absolute; inset: 0; touch-action: none; }
.vue-outil.principal { background: #1d4ed8; color: #fff; }
.vue-outil .lib { display: none; }
.scan-filtres { display: flex; justify-content: center; gap: 8px; padding: 8px 16px 0; background: rgb(0 0 0 / .85); }
.scan-filtres:empty { display: none; }
.vue-outil.filtre { width: auto; min-width: 44px; padding: 0 11px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }
.vue-outil.filtre.actif { background: rgb(255 255 255 / .16); color: #fff; }
.vue-outil.filtre.actif .lib { display: inline; font-size: .85rem; font-weight: 700; }

/* Sous-dossiers et ajout d'un dossier entier */
.puce.nouveau { display: grid; place-items: center; min-width: 44px; padding: 8px 12px; color: var(--blue); }
.puces.centre { justify-content: center; flex-wrap: wrap; }
.lien { border: 0; background: none; color: var(--blue); font-weight: 700; cursor: pointer; padding: 6px; align-self: center; min-height: 44px; }

/* Ombre douce sur toutes les icônes et le logo */
.dessin { filter: drop-shadow(0 1.5px 1.5px rgb(23 32 51 / .28)); }
.logo { box-shadow: 0 3px 10px rgb(23 32 51 / .25); }
.tuile .ico, .doc .ico, .ico-btn > span[aria-hidden]:first-child, .action-ico { box-shadow: 0 2px 6px rgb(23 32 51 / .12); }
@media (prefers-color-scheme: dark) {
  .dessin { filter: drop-shadow(0 1.5px 2px rgb(0 0 0 / .6)); }
  .logo { box-shadow: 0 3px 10px rgb(0 0 0 / .5); }
}
