/* ============================================================
   PORTAILRECUP — styles du portail, fidèles au design system
   « Pourpre » TARN COMPTA (tokens importés tels quels).
   ============================================================ */
@import url('../fonts/fonts.css');
@import url('./tokens/colors.css');
@import url('./tokens/typography.css');
@import url('./tokens/spacing.css');
@import url('./tokens/effects.css');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--parchment, #f4efe6);
  color: var(--text-body, #3a3343);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}
a { color: var(--pourpre-700); }
a:hover { color: var(--pourpre-800); }

/* ---------- Page d'accueil (modèle fourni) ---------- */
.page-centre {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 48px 24px;
}
.albi { max-width: 90vw; height: auto; }
.separateur-or { width: 48px; height: 2px; background: var(--or-500); }
.pied-discret {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--ink-400);
}
.pied-discret a { color: var(--ink-400); text-decoration: none; }
.pied-discret a:hover { color: var(--pourpre-700); }

/* ---------- Boutons (spec Button.jsx) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-snug);
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { height: 54px; padding: 0 28px; font-size: var(--text-md); gap: 10px; min-width: 180px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: var(--text-sm); gap: 6px; border-radius: var(--radius-sm); }
.btn-primaire { background: var(--pourpre-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primaire:hover:not(:disabled) { background: var(--pourpre-800); box-shadow: var(--shadow-brand); }
.btn-secondaire { background: var(--white); color: var(--pourpre-700); border-color: var(--pourpre-300); box-shadow: var(--shadow-xs); }
.btn-secondaire:hover:not(:disabled) { background: var(--pourpre-50); box-shadow: var(--shadow-sm); }
.btn-ghost { background: transparent; color: var(--pourpre-700); }
.btn-ghost:hover:not(:disabled) { background: var(--pourpre-50); }
.btn-or { background: var(--or-500); color: #fff; box-shadow: var(--shadow-sm); }
.btn-or:hover:not(:disabled) { background: var(--or-700); box-shadow: var(--shadow-md); }

/* ---------- Cartes (spec Card.jsx) ---------- */
.carte {
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-subtle, #ddd8e3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
}
.carte h2 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  letter-spacing: var(--tracking-tight);
}
.carte h2 .sous-titre { display: block; font-family: var(--font-sans); font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--ink-500); margin-top: 2px; letter-spacing: 0; }

/* ---------- Formulaires (spec Input.jsx) ---------- */
.champ { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.champ label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-strong); }
.champ input, .champ select {
  height: 46px;
  padding: 0 14px;
  background: var(--white);
  border: 1.5px solid var(--border-default, #b8b1c1);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-strong);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.champ input:focus, .champ select:focus { outline: none; border-color: var(--pourpre-500); box-shadow: var(--ring); }
.champ .indice { font-size: var(--text-xs); color: var(--ink-500); }
.champ input.mono { font-family: var(--font-mono); font-size: var(--text-sm); }

/* ---------- Alertes (spec Alert.jsx) ---------- */
.alerte {
  display: flex;
  gap: 12px;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--pourpre-200);
  border-left: 3px solid var(--pourpre-700);
  background: var(--pourpre-50);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  word-break: break-word;
}
.alerte.ok { background: var(--positif-soft); border-color: #bfe0d0; border-left-color: var(--positif); color: var(--positif); }
.alerte.erreur { background: var(--negatif-soft); border-color: #eccfd2; border-left-color: var(--negatif); color: var(--negatif); }
.alerte[hidden] { display: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}
.badge.ok { background: var(--positif-soft); color: var(--positif); }
.badge.ko { background: var(--negatif-soft); color: var(--negatif); }

/* ---------- Coquille du tableau de bord ---------- */
.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: var(--white);
  border-bottom: 1px solid var(--border-subtle);
}
.entete .marque { display: flex; align-items: center; gap: var(--space-3); }
.entete .marque svg { display: block; }
.entete .titre { font-family: var(--font-display); font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--pourpre-800); letter-spacing: var(--tracking-tight); }
.entete .titre small { display: block; font-family: var(--font-sans); font-size: var(--text-2xs); font-weight: var(--weight-medium); color: var(--or-700); text-transform: uppercase; letter-spacing: var(--tracking-caps); }
.entete .session { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); color: var(--ink-500); }

.conteneur { max-width: var(--container-max); margin: 0 auto; padding: var(--space-6) var(--gutter) var(--space-8); }

/* ---------- Onglets (spec Tabs.jsx) ---------- */
.onglets { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--space-6); }
.onglets button {
  padding: 14px 2px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--ink-500);
  cursor: pointer;
}
.onglets button:hover { color: var(--pourpre-700); }
.onglets button.actif { color: var(--pourpre-800); font-weight: var(--weight-semibold); border-bottom-color: var(--pourpre-700); }

.panneau[hidden] { display: none; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--space-5); align-items: start; }

/* ---------- Listes de fichiers / tableaux ---------- */
.liste-fichiers { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.liste-fichiers li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-sunken, var(--ink-50));
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}
table.journal { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.journal th, table.journal td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle); }
table.journal th { font-weight: var(--weight-semibold); color: var(--text-strong); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
table.journal td.mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-600); }

.actions-ligne { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; margin-top: var(--space-2); }
.mt { margin-top: var(--space-4); }

/* ---------- Carte centrée (enrôlement) ---------- */
.carte-etroite { width: 100%; max-width: 420px; }
