/* ════════════════════════════════════════════════════════════════════════════
   ACCESSIBILITE & UX NOVICE — Paquet H (audit GED 2026-04-29)
   ────────────────────────────────────────────────────────────────────────────
   Surcharge ciblee de main.css pour rendre l'application plus accessible aux
   utilisateurs peu a l'aise avec l'informatique :
   - Police de base 14px -> 15px (+7%)
   - Boutons et zones cliquables : taille minimum tactile 40px
   - Indicateur de page active beaucoup plus visible
   - Hover states + focus visibles (WCAG 2.4.7)
   - Animations douces de transition entre pages
   - Tooltip natif `title` rendu plus utile
   ──────────────────────────────────────────────────────────────────────────── */

/* ─── 1. Lisibilite : police de base + densites ────────────────────────── */
html { font-size: 16px; }  /* base 16px (Sprint 1 wow polish) — accessibilite + lisibilite demo client */
body { line-height: 1.55; }  /* aere les blocs de texte */

/* Topbar + sidebar : police plus grande pour lecture aisee */
.sidebar-logo-text h1 { font-size: 1.2rem; }
.nav-item { font-size: .92rem; padding: 12px 20px; min-height: 44px; }
.nav-item .icon svg { width: 20px; height: 20px; }
.topbar { height: 60px; }
.topbar-title { font-size: 1.15rem; }
.card-header h2 { font-size: 1.1rem; }
.kpi-value { font-size: 1.8rem; }
.kpi-label { font-size: .82rem; font-weight: 500; }
th { font-size: .8rem; padding: 12px 14px; }
td { font-size: .9rem; padding: 12px 14px; }

/* ─── 2. Indicateur de page active ULTRA-VISIBLE ───────────────────────── */
.nav-item.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, .35) 0%, rgba(37, 99, 235, .15) 100%);
  color: #fff !important;
  font-weight: 700;
  border-left-width: 4px;
  border-left-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .25);
  position: relative;
}
.nav-item.active::after {
  /* Petite fleche pointant vers le contenu de droite */
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-left: 6px solid var(--bg);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

/* ─── 3. Boutons : taille minimum tactile (WCAG AAA = 44px) ────────────── */
.btn {
  min-height: 40px;
  padding: 10px 18px;
  font-size: .92rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all .15s ease-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.btn-sm {
  min-height: 32px;
  padding: 6px 12px;
  font-size: .82rem;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
}
.btn-outline {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 1px 2px rgba(239, 68, 68, .25);
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, .35);
}

/* ─── 4. Inputs / selects : focus tres visible (WCAG 2.4.7) ────────────── */
input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  outline: 3px solid rgba(37, 99, 235, .35);
  outline-offset: 1px;
  border-color: var(--primary) !important;
}
.btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .5);
  outline-offset: 2px;
}

/* ─── 5. Tooltips natifs : titre[title] avec rendu plus rapide ─────────── */
/* On ajoute un underline pointille sous les elements avec title pour signaler */
[title]:not(.btn):not(input):not(select):not(textarea):not(option) {
  border-bottom: 1px dotted rgba(37, 99, 235, .4);
  cursor: help;
}

/* ─── 6. Animation de transition entre pages ────────────────────────────── */
.page {
  animation: pageEnter .25s ease-out;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── 6bis. KPI cards : hover marque pour signaler la cliquabilite ────── */
/* Paquet N audit GED 2026-04-29 : avant, les cards du tableau de bord
   etaient cliquables mais l'utilisateur ne le savait pas (pas de chevron,
   hover discret). Maintenant : cursor pointer + transform-up + ombre
   prononcee + chevron qui glisse vers la droite au survol. */
.kpi-card {
  cursor: pointer;
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, .18);
}
.kpi-card:hover .kpi-chevron,
.kpi-card:hover > span[aria-hidden="true"] {
  opacity: 1 !important;
  color: var(--primary) !important;
  transform: translateX(4px);
  transition: transform .15s, opacity .15s, color .15s;
}
.kpi-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .5);
  outline-offset: 2px;
}
.kpi-card > span[aria-hidden="true"] {
  transition: transform .15s, opacity .15s, color .15s;
}

/* ─── 7. Empty states plus engageants ──────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
}
.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: .5;
}
.empty-state p {
  font-size: 1rem;
  margin-bottom: 8px;
}

/* ─── 8. Toast (notifications) plus visibles ──────────────────────────── */
.toast {
  font-size: .92rem;
  padding: 14px 20px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
  animation: toastIn .3s ease-out;
  font-weight: 500;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) translateY(0); }
  to   { opacity: 1; transform: translateX(0) translateY(0); }
}

/* ─── 9. Modal : header plus marque (signalisation visuelle) ──────────── */
.modal-content {
  border-top: 4px solid var(--primary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal-header {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

/* ─── 10. Onboarding overlay au premier login ─────────────────────────── */
#gestdoc-onboarding-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .75);
  backdrop-filter: blur(4px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  animation: fadeIn .25s;
}
#gestdoc-onboarding-overlay.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#gestdoc-onboarding-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 560px;
  width: 90%;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .35);
  text-align: center;
}
#gestdoc-onboarding-card h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: var(--text);
}
#gestdoc-onboarding-card .step-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
}
#gestdoc-onboarding-card p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-light);
  margin-bottom: 24px;
}
#gestdoc-onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
#gestdoc-onboarding-progress .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background .2s;
}
#gestdoc-onboarding-progress .dot.active {
  background: var(--primary);
  transform: scale(1.3);
}
#gestdoc-onboarding-card .actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
#gestdoc-onboarding-card .skip {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: .85rem;
  cursor: pointer;
  padding: 6px 10px;
}
#gestdoc-onboarding-card .skip:hover {
  color: var(--text);
  text-decoration: underline;
}
#gestdoc-onboarding-card { position: relative; }

/* ─── 11. Aide flottante (?) en bas a droite ──────────────────────────── */
#gestdoc-help-floating {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .4);
  z-index: 800;
  transition: all .2s;
}
#gestdoc-help-floating:hover {
  background: var(--primary-dark);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 99, 235, .5);
}

/* ─── 12. Mode sombre : adaptations specifiques ───────────────────────── */
[data-theme="dark"] .nav-item.active {
  background: linear-gradient(90deg, rgba(96, 165, 250, .35) 0%, rgba(96, 165, 250, .12) 100%);
  color: #fff !important;
}
[data-theme="dark"] .btn-outline:hover {
  background: rgba(37, 99, 235, .15);
}
[data-theme="dark"] #gestdoc-onboarding-card .step-icon { filter: brightness(1.1); }
