/* VériFI — jetons de design et composants de base.
   Copie de .claude/skills/verifi-design/tokens.css (valeurs issues de docs/maquettes/),
   suivie des compléments propres à l'application. */

@import url("https://fonts.googleapis.com/css2?family=League+Gothic&family=Stack+Sans+Headline:wght@500;700&family=Stack+Sans+Text:wght@400;500;700&display=swap");

:root {
  /* Couleurs */
  --vf-violet: #4C0297;        /* bandeaux, titres, bordures de champ, en-têtes de tableau */
  --vf-violet-fonce: #330068;  /* texte sur fond lilas, survol des liens */
  --vf-violet-filet: #6A2BB0;  /* séparateurs sur fond violet (menu mobile) */
  --vf-rouge: #D1271C;         /* action principale, libellés inclinés sur fond crème */
  --vf-creme: #FFFCF4;         /* fond de page, texte sur violet ou rouge */
  --vf-charbon: #212320;       /* texte principal, boutons secondaires */
  --vf-blanc: #FFFFFF;         /* fond des champs, cartes, tableaux */
  --vf-lilas: #E5CBFF;         /* puces, badges, pastille de compte */
  --vf-lilas-pale: #F4EAFF;    /* encadrés d'information, option survolée */
  --vf-rose: #FFD2CF;          /* libellés inclinés sur violet, surlignage de recherche, encadré « Pas encore inscrit·e ? » */
  --vf-sable: #F3EEE2;         /* contrôles segmentés, fonds neutres */
  --vf-gris-texte: #5C5A55;    /* textes secondaires (contraste AA sur crème) */
  --vf-gris-fonce: #3A3B37;    /* paragraphes secondaires */
  --vf-placeholder: #77736A;   /* exemples dans les champs */
  --vf-filet: #E6E1D6;         /* séparateurs, bordures de carte */
  --vf-desactive-bord: #D9D3C4;   /* contrôles désactivés (pagination) */
  --vf-desactive-texte: #9A968C;
  --vf-vert-fond: #E3F4EA;     /* statut Actif */
  --vf-vert: #1F6B3E;
  --vf-neutre-fond: #EDEAE2;   /* statut Désactivé */
  --vf-erreur: #A01810;        /* icônes d'alerte sur fond rose */

  /* Typographie */
  --vf-font-texte: "Stack Sans Text", system-ui, sans-serif;
  --vf-font-titre: "Stack Sans Headline", system-ui, sans-serif;
  --vf-font-accroche: "League Gothic", "Stack Sans Headline", sans-serif;

  /* Formes */
  --vf-rayon-controle: 10px;   /* boutons, champs */
  --vf-rayon-carte: 16px;      /* cartes, tableaux, encadrés */
  --vf-bordure: 1.5px;
  --vf-cible-min: 44px;        /* taille minimale des zones cliquables */
}

html, body { margin: 0; background: var(--vf-creme); color: var(--vf-charbon); font-family: var(--vf-font-texte); }
a { color: var(--vf-violet); }
a:hover { color: var(--vf-violet-fonce); }
:focus-visible { outline: 3px solid var(--vf-rouge); outline-offset: 2px; }
input::placeholder { color: var(--vf-placeholder); }

/* Bandeau violet à bord inférieur en biais */
.vf-bandeau {
  background: var(--vf-violet);
  color: var(--vf-creme);
  padding: 22px 24px 50px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), 0 100%);
}
@media (min-width: 768px) {
  .vf-bandeau { padding: 32px 32px 84px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 48px), 0 100%); }
}

/* Libellé incliné (« RECHERCHE », « RÉSULTATS »…) */
.vf-accroche {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--vf-font-accroche);
  font-size: 34px;
  line-height: 1;
  text-transform: uppercase;
  transform: skewX(-10deg);
  color: var(--vf-rouge);
}
.vf-bandeau .vf-accroche { color: var(--vf-rose); }
@media (min-width: 768px) { .vf-accroche { font-size: 40px; } }

.vf-titre { margin: 0; font-family: var(--vf-font-titre); font-weight: 700; font-size: 30px; line-height: 1.1; }

/* Champ : bordure violette, libellé à l'intérieur */
.vf-champ {
  position: relative;
  border: var(--vf-bordure) solid var(--vf-violet);
  border-radius: var(--vf-rayon-controle);
  padding: 7px 14px;
  background: var(--vf-blanc);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vf-champ label { font-size: 13px; font-weight: 500; }
.vf-champ input, .vf-champ select {
  border: none; background: transparent; padding: 0; height: 26px;
  font: inherit; font-size: 17px; color: var(--vf-charbon); min-width: 0;
}
.vf-champ input:focus, .vf-champ select:focus { outline: none; }
.vf-champ:focus-within { outline: 3px solid var(--vf-rouge); outline-offset: 2px; }

/* Boutons */
.vf-btn {
  min-height: 56px; padding: 0 24px; border: none; border-radius: var(--vf-rayon-controle);
  font-family: var(--vf-font-titre); font-weight: 700; font-size: 18px; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; text-decoration: none;
}
.vf-btn-principal { background: var(--vf-rouge); color: var(--vf-creme); }
.vf-btn-secondaire {
  min-height: var(--vf-cible-min); background: var(--vf-creme); color: var(--vf-charbon);
  border: var(--vf-bordure) solid var(--vf-charbon); font-family: var(--vf-font-texte);
  font-size: 15px; text-transform: none;
}
.vf-btn-carre { width: 56px; padding: 0; }  /* carré flèche accolé au bouton principal */

/* Puce de filtre */
.vf-puce {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--vf-lilas); color: var(--vf-violet-fonce);
  border-radius: 999px; padding: 4px 4px 4px 14px; font-size: 14px; font-weight: 700;
}
.vf-puce button {
  width: 28px; height: 28px; border-radius: 14px; border: none;
  background: var(--vf-violet); color: var(--vf-creme); cursor: pointer;
}

/* Carte, tableau, encadrés */
.vf-carte { background: var(--vf-blanc); border: var(--vf-bordure) solid var(--vf-filet); border-radius: var(--vf-rayon-carte); }
.vf-tableau { border: var(--vf-bordure) solid var(--vf-charbon); border-radius: var(--vf-rayon-carte); overflow-x: auto; background: var(--vf-blanc); }
.vf-tableau table { width: 100%; border-collapse: collapse; font-size: 15px; }
.vf-tableau th { background: var(--vf-violet); color: var(--vf-creme); text-align: left; padding: 14px 18px; font-family: var(--vf-font-titre); font-size: 13px; text-transform: uppercase; }
.vf-tableau td { padding: 16px 18px; border-top: 1px solid var(--vf-filet); }
.vf-info { background: var(--vf-lilas-pale); color: var(--vf-violet-fonce); border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.5; }
.vf-alerte { background: var(--vf-rose); border-radius: var(--vf-rayon-carte); padding: 14px 16px; }
mark.vf-surligne { background: var(--vf-rose); color: var(--vf-charbon); padding: 0 2px; border-radius: 3px; }

/* ---------- Compléments VériFI ---------- */

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

/* Les champs prennent la largeur de leur cadre (sans quoi leur largeur intrinsèque peut élargir un panneau flex) */
.vf-champ input, .vf-champ select { width: 100%; }

/* Action principale : bouton rouge + carré flèche accolé, dans un seul <button> */
.vf-action {
  display: flex; gap: 8px; width: 100%;
  padding: 0; border: none; background: none; cursor: pointer;
  border-radius: var(--vf-rayon-controle);
}
.vf-action > .vf-btn:first-child { flex: 1; }

/* Bouton-icône dans un champ (ex. afficher le mot de passe) */
.vf-champ-avec-bouton { flex-direction: row; align-items: center; gap: 6px; padding-right: 6px; }
.vf-champ-avec-bouton > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vf-btn-icone {
  width: var(--vf-cible-min); height: var(--vf-cible-min); flex-shrink: 0;
  border: none; background: transparent; color: var(--vf-violet); padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: var(--vf-rayon-controle);
}

/* Validation des formulaires */
.vf-champ:has(.invalid) { border-color: var(--vf-rouge); }
.validation-message { color: var(--vf-erreur); font-size: 14px; margin-top: -8px; }
.vf-alerte[role="alert"] { color: var(--vf-charbon); font-size: 15px; line-height: 1.5; }

/* Les éléments absolus d'un tableau (.visuellement-cache dans un <th>) restent dans sa zone de défilement,
   sinon ils élargissent la page sur mobile */
.vf-tableau { position: relative; }

/* Texte lu par les lecteurs d'écran seulement */
.visuellement-cache { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Affichage selon l'écran (point de rupture 768 px) */
@media (max-width: 767.98px) { .vf-ordinateur-seul { display: none !important; } }
@media (min-width: 768px) { .vf-mobile-seul { display: none !important; } }

/* ---------- Écrans de connexion et de mot de passe (AuthLayout) ----------
   Mobile : en-tête, bandeau, formulaire avec l'action poussée en bas.
   Ordinateur : <PanneauAuth> à gauche, formulaire centré à droite. */

.vf-auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.vf-auth-bandeau { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.vf-auth-bandeau p { margin: 0; font-size: 15px; line-height: 1.45; }
.vf-auth-contenu { flex: 1; display: flex; flex-direction: column; }
.vf-auth-form { flex: 1; padding: 32px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.vf-auth-espace { flex: 1; }  /* pousse l'action principale en bas de l'écran sur mobile */
.vf-auth-intro { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.vf-auth-intro h2 { margin: 0; font-family: var(--vf-font-titre); font-weight: 700; font-size: 28px; color: var(--vf-violet); }
.vf-auth-intro p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--vf-gris-texte); }
.vf-auth-info { display: flex; align-items: flex-start; gap: 10px; }
.vf-auth-info svg { flex-shrink: 0; margin-top: 1px; color: var(--vf-violet); }

@media (min-width: 768px) {
  .vf-auth { flex-direction: row; flex-wrap: wrap; }
  .vf-auth-contenu { flex: 1 1 480px; padding: 56px 32px; align-items: center; justify-content: center; }
  .vf-auth-form { flex: none; width: 100%; max-width: 440px; padding: 0; }
  .vf-auth-form .vf-action { margin-top: 4px; }
}

/* Bandeau d'erreur Blazor (pages interactives) */
#blazor-error-ui {
  display: none; position: fixed; left: 0; bottom: 0; width: 100%; z-index: 1000;
  padding: 12px 20px; background: var(--vf-rose); color: var(--vf-charbon);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 10px; }

/* Page connectée sans le rôle requis (Routes.razor) */
.vf-page-message { max-width: 560px; margin: 64px auto; padding: 0 20px; display: flex; flex-direction: column; gap: 12px; }
.vf-page-message h1 { margin: 0; font-family: var(--vf-font-titre); font-size: 28px; color: var(--vf-violet); }
.vf-page-message p { margin: 0; }
.vf-page-message-logo { height: 48px; width: auto; align-self: flex-start; margin-bottom: 12px; }
.vf-page-message .vf-btn { margin-top: 12px; }

/* ---------- Modèle Blazor (pages pas encore réhabillées) ---------- */

.content { padding-top: 1.1rem; }

h1:focus { outline: none; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Une erreur est survenue."
    }

.darker-border-checkbox.form-check-input { border-color: #929292; }
