/* ═══════════════════════════════════════════════════════════════════════════
   fokus-ui v1.0.0 — socle de design partagé Fokus IT
   SOURCE DE VÉRITÉ : ~/claude-workspace/fokus-ui/fokus-base.css

   ⛔ NE JAMAIS ÉDITER CE FICHIER DANS UNE APPLICATION.
      Toute évolution : modifier fokus-ui/fokus-base.css,
      puis ./scripts/sync-into.sh <app_dir>

   Le CSS spécifique à une app va dans app/static/css/app.css,
   chargé APRÈS ce fichier.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Polices auto-hébergées (OFL, cf. fonts/LICENSE.md) ─────────────────────
   Polices variables : un seul fichier couvre tous les graisses par sous-ensemble. */
@font-face {
  font-family: 'Maven Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/maven-pro-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Maven Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/maven-pro-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/rubik-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/rubik-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Tokens ─────────────────────────────────────────────────────────────────
   RÈGLE : --primary pour les accents, bordures, liserés et fonds.
           --primary-strong dès qu'il porte du texte blanc ou est porté par
           du texte (conformité WCAG AA — cf. DESIGN.md § Contraste). */
:root {
  /* Marque */
  --primary:        #00a8b0;
  --primary-strong: #007a80;
  --primary-light:  #d4f0f1;
  --nav-bg:         #0a0a0a;

  /* Sémantique */
  --success:       #059669;
  --success-light: #d1fae5;
  --warning:       #d97706;
  --warning-light: #fef3c7;
  --danger:        #dc2626;
  --danger-light:  #fee2e2;

  /* Surfaces & texte */
  --bg:         #f1f5f9;
  --card:       #ffffff;
  --text:       #0f172a;
  --text-muted: #64748b;
  --border:     #e2e8f0;

  /* Forme */
  --radius:    6px;
  --radius-lg: 10px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);

  /* Typographie */
  --font-display: 'Maven Pro', 'Rubik', system-ui, sans-serif;
  --font-body:    'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Chrome applicatif */
  --header-height: 88px;
  --logo-height:   64px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 100%; }

body {
  font-family: var(--font-body);
  font-size: 0.9375rem;          /* 15px */
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.25;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; font-weight: 600; }

a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

button { cursor: pointer; font-family: inherit; font-size: 1rem; }
input, textarea, select { font-family: inherit; font-size: 1rem; }
label { display: block; font-weight: 500; margin-bottom: .3rem; color: var(--text); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ═══ HEADER APPLICATIF ═══════════════════════════════════════════════════
   Un seul header pour les trois apps. Remplace .navbar (cvconverter,
   offres-creator) et .topbar (ai-testing).
   Exception documentée : le parcours candidat de ai-testing garde son propre
   header réduit (public externe), mais consomme ces mêmes tokens. */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: var(--header-height);
  padding: 0 1.5rem;
  background: var(--nav-bg);
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header__brand { display: flex; align-items: center; gap: 1.25rem; flex-shrink: 0; }
.app-header__brand a { display: flex; align-items: center; text-decoration: none; }
.app-header__brand a:hover { text-decoration: none; }
.app-header__logo img { height: var(--logo-height); width: auto; display: block; }

.app-header__name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: rgba(255,255,255,.85);
  padding-left: 1.25rem;
  border-left: 1px solid rgba(255,255,255,.18);
}
.app-header__name:hover { color: #fff; }

.app-header__nav { display: flex; align-items: center; gap: .25rem; flex: 1; }

.app-header__link {
  padding: .4rem .75rem;
  border-radius: var(--radius);
  color: rgba(255,255,255,.7);
  font-weight: 500;
  transition: background .15s, color .15s;
}
.app-header__link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
  text-decoration: none;
}
/* État actif : teal vif + texte sombre. Contraste 7,2:1 et bien plus visible
   sur fond noir qu'un remplissage sombre à texte blanc. */
.app-header__link.is-active {
  background: var(--primary);
  color: var(--nav-bg);
  font-weight: 600;
}
.app-header__link.is-active:hover { background: var(--primary); color: var(--nav-bg); }

.app-header__user { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.app-header__sep { width: 1px; height: 20px; background: rgba(255,255,255,.15); }
.app-header__username { font-size: .8125rem; color: rgba(255,255,255,.6); }

/* ═══ BOUTONS ═════════════════════════════════════════════════════════════
   .btn porte forme et taille, le modificateur porte la couleur.
   Aucun bouton ne porte de marge externe : c'est au conteneur de gérer
   l'espacement (.btn-row, .form-actions). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--primary-strong); color: #fff; }
.btn--primary:hover:not(:disabled) { background: #00666b; }

.btn--secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn--secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-light); }

.btn--danger { background: var(--danger-light); color: var(--danger); border-color: #fca5a5; }
.btn--danger:hover:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn--success { background: var(--success); color: #fff; }
.btn--success:hover:not(:disabled) { opacity: .88; }

.btn--ghost { background: none; color: var(--text-muted); font-weight: 500; }
.btn--ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); }

/* Action textuelle sans habillage : pour les lignes de tableau denses, où une
   série de boutons pleins serait illisible. Ne porte ni fond ni bordure ni
   padding — se comporte comme un lien, reste un <button> ou un <a>. */
.btn--link {
  background: none; border: none; padding: 0;
  color: var(--primary-strong); font-weight: 500; font-size: .875rem;
}
.btn--link:hover:not(:disabled) { text-decoration: underline; }
.btn--link.btn--danger { background: none; border: none; color: var(--danger); }
.btn--link.btn--danger:hover:not(:disabled) { background: none; text-decoration: underline; }

/* Bouton « Portail IA » du header */
.btn--portail { background: var(--primary-strong); color: #fff; font-size: .9375rem; }
.btn--portail:hover { background: var(--primary); color: var(--nav-bg); }

/* Déconnexion : contouré sur fond sombre, rouge plein au survol */
.btn--logout {
  background: transparent;
  color: rgba(255,255,255,.75);
  border-color: rgba(255,255,255,.2);
  padding: .35rem .75rem;
  font-size: .8125rem;
  font-weight: 500;
}
.btn--logout:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* Tailles */
.btn--sm  { padding: .3rem .65rem; font-size: .8125rem; }
.btn--lg  { padding: .7rem 1.4rem; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--icon {
  width: 2.4rem; padding: 0; flex-shrink: 0;
  background: var(--bg); border-color: var(--border); font-size: 1rem;
}
.btn--icon:hover { background: var(--primary-light); border-color: var(--primary); }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-row--end { justify-content: flex-end; }

/* ═══ MISE EN PAGE ════════════════════════════════════════════════════════ */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.page-header p { color: var(--text-muted); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.card__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.card-stack { display: flex; flex-direction: column; gap: 1.25rem; }

.split-grid { display: grid; grid-template-columns: 340px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 800px) { .split-grid { grid-template-columns: 1fr; } }

/* ═══ FORMULAIRES ═════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.hint { font-size: .8125rem; color: var(--text-muted); font-weight: 400; }
.char-count { text-align: right; font-size: .8125rem; color: var(--text-muted); margin-top: .2rem; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], textarea, select {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: .9375rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,168,176,.18);
}
textarea { resize: vertical; min-height: 5rem; }

.pw-row { display: flex; gap: .4rem; align-items: stretch; }
.pw-row input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; flex: 1; }

.checkbox-line { display: flex; align-items: center; gap: .5rem; }
.checkbox-line label { margin: 0; font-weight: 400; }

/* ═══ DÉPÔT DE FICHIER ════════════════════════════════════════════════════ */
.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color .15s, background .15s, color .15s;
}
.file-drop:hover, .file-drop.is-dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-strong);
}
.file-drop p { font-size: .875rem; margin: .1rem 0; }
.file-drop__link { color: var(--primary-strong); text-decoration: underline; cursor: pointer; }

.file-badge {
  display: flex; align-items: center; gap: .5rem;
  margin-top: .5rem; padding: .45rem .65rem;
  background: var(--primary-light); border-radius: var(--radius);
  font-size: .875rem; color: var(--primary-strong); font-weight: 500;
}
.file-badge span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-badge__clear {
  background: none; border: none; padding: 0 .15rem; line-height: 1;
  color: var(--primary-strong); font-size: .875rem; opacity: .7;
}
.file-badge__clear:hover { opacity: 1; }

/* ═══ TABLEAU ═════════════════════════════════════════════════════════════
   Une seule table. Remplace .data-table ET .admin-table (qui étaient des
   doublons dans cvconverter / offres-creator). */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th {
  text-align: left; padding: .55rem .75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted); font-weight: 600; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.data-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg); }
.data-table .is-inactive td { opacity: .5; }
.data-table .actions-col { text-align: right; width: 1%; white-space: nowrap; }
.actions-cell { display: flex; gap: .4rem; flex-wrap: nowrap; justify-content: flex-end; }

/* ═══ ALERTES ═════════════════════════════════════════════════════════════ */
.alert { padding: .6rem .8rem; border-radius: var(--radius); font-size: .875rem; }
.alert--error   { background: var(--danger-light);  color: var(--danger);  border: 1px solid #fca5a5; }
.alert--success { background: var(--success-light); color: var(--success); border: 1px solid #6ee7b7; }
.alert--warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fcd34d; }
.alert--info    { background: var(--primary-light); color: var(--primary-strong); border: 1px solid var(--primary); }

/* ═══ BADGES ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 5px;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .02em;
  vertical-align: middle;
}
.badge--ok    { background: var(--success-light); color: var(--success); }
.badge--err   { background: var(--danger-light);  color: var(--danger); }
.badge--warn  { background: var(--warning-light); color: var(--warning); }
.badge--info  { background: var(--primary-light); color: var(--primary-strong); }
.badge--admin { background: #ede9fe; color: #6d28d9; }
.badge--off   { background: var(--border); color: var(--text-muted); }

/* ═══ ÉTATS ═══════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
  padding: 2rem 1rem; color: var(--text-muted); text-align: center;
}
.empty-state svg { opacity: .3; }

.loading-row { display: flex; align-items: center; gap: .5rem; padding: 1rem; color: var(--text-muted); font-size: .875rem; }
.spinner {
  width: 1rem; height: 1rem; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: fokus-spin .7s linear infinite;
}
@keyframes fokus-spin { to { transform: rotate(360deg); } }

.result-card { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; border-radius: var(--radius); }
.result-card--ok  { background: var(--success-light); color: var(--success); }
.result-card--err { background: var(--danger-light);  color: var(--danger); }
.result-card__icon {
  width: 2.25rem; height: 2.25rem; flex-shrink: 0; border-radius: 50%;
  background: rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
}
.result-card__body { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.result-card__body strong { font-size: .9375rem; }
.result-card__body span   { font-size: .8125rem; }

/* ═══ JAUGE ═══════════════════════════════════════════════════════════════
   Remplace .quota-wrap (cvconverter / offres) et .token-gauge (ai-testing),
   qui répondaient au même besoin de deux façons. */
.gauge { border-left: 4px solid var(--primary); }
.gauge__header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.gauge__label { font-size: .8125rem; color: var(--text-muted); }
.gauge__value { font-size: 1.4rem; font-weight: 600; color: var(--primary-strong); font-variant-numeric: tabular-nums; }
.gauge__track { height: .5rem; background: var(--bg); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.gauge__fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s ease; }
.gauge__fill--warn { background: var(--warning); }
.gauge__fill--over { background: var(--danger); }

/* ═══ MODALE ══════════════════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(10,10,10,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.modal__content {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.75rem 2rem;
  max-width: 460px; width: 100%;
  display: flex; flex-direction: column; gap: .75rem;
  max-height: 100%; overflow-y: auto;
}
/* Variante large : header / body scrollable / footer collants */
.modal__content--wide { max-width: 900px; max-height: 85vh; padding: 0; gap: 0; }
.modal__header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal__body   { padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1; }
.modal__footer {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: .5rem;
}
.modal__notice { font-size: .8125rem; color: var(--text-muted); line-height: 1.5; }
.mono-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem; letter-spacing: .08em;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .6rem 1rem;
  text-align: center; user-select: all;
}

/* ═══ PAGES D'AUTHENTIFICATION ════════════════════════════════════════════
   Document autonome : pas de header applicatif sur une page de connexion. */
.auth-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--nav-bg);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(0,168,176,.16), transparent 65%);
}
.auth-wrap { width: 100%; max-width: 420px; padding: 1.5rem; }
.auth-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.25rem 2rem;
}
.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-header img { height: 3rem; width: auto; margin-bottom: 1rem; }
.auth-header h1 { font-size: 1.35rem; font-weight: 600; margin-bottom: .25rem; }
.auth-header p { color: var(--text-muted); font-size: .875rem; }
.auth-footer { margin-top: 1.25rem; text-align: center; font-size: .875rem; color: var(--text-muted); }
.auth-notice {
  font-size: .8125rem; color: var(--warning);
  background: var(--warning-light); border: 1px solid #fcd34d;
  border-radius: var(--radius); padding: .55rem .75rem; margin-bottom: 1rem;
}

/* ═══ UTILITAIRES ═════════════════════════════════════════════════════════ */
.hidden  { display: none !important; }
.muted   { color: var(--text-muted); }
.nowrap  { white-space: nowrap; }
.mono    { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.wrap-cell { max-width: 220px; word-break: break-word; }

/* ═══ RESPONSIVE ══════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  :root { --header-height: auto; --logo-height: 48px; }
  .app-header { flex-wrap: wrap; gap: .75rem; padding: .75rem 1rem; position: static; }
  .app-header__nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .container { padding: 1.25rem 1rem; }
}
