/* ==========================================================================
   Recrutements GarfieldTV — système visuel unique
   ui.css      jetons, base, composants partagés, thèmes de recrutement
   site.css    hub + pages de candidature
   console.css administration
   Règle : on ne surcharge pas, on modifie ici. Un recrutement = un thème.
   ========================================================================== */

/* 1. Jetons ------------------------------------------------------------- */
:root {
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Échelle typographique */
  --t-xs: 12px;
  --t-sm: 13px;
  --t-md: 15px;
  --t-lg: 17px;
  --t-xl: 20px;
  --t-2xl: 26px;
  --t-3xl: 34px;
  --t-4xl: clamp(38px, 5.4vw, 60px);

  /* Espacement — grille de 4 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px; --s10: 80px;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --control: 44px;
  --control-sm: 34px;
  --page: 1160px;

  /* Neutres — contrastes AA vérifiés sur --bg */
  --bg: #0b0d10;
  --surface: #111418;
  --surface-2: #171b20;
  --surface-3: #1e232a;
  --line: #232930;
  --line-strong: #333a44;
  --text: #f2f4f7;
  --text-2: #b6bec9;   /* 10.4:1 */
  --text-3: #8b95a2;   /*  6.4:1 */

  --ok: #4fbf7d;      --ok-bg: #11241a;
  --bad: #ef6b73;     --bad-bg: #2a1417;
  --warn: #e3b44f;    --warn-bg: #2a2212;
  --info: #7fb2e5;    --info-bg: #122133;
  --discord: #5865f2; --discord-hover: #4752c4;

  /* Thème par défaut (hub GarfieldTV) */
  --accent: #f2f4f7;
  --accent-hover: #ffffff;
  --accent-ink: #0b0d10;
  --accent-soft: rgba(242, 244, 247, .08);
  --line-1: #2f8f5b; --line-2: #d6404a; --line-3: #3b78b5;
  --focus: #8fb4ff;

  color-scheme: dark;
}

/* Érythrée — drapeau : vert, rouge, bleu, or */
.theme-ng, .ery-project, .admin-project-ng, .project-ng-option, .scope-ng {
  --accent: #d6404a;
  --accent-hover: #c1333d;
  --accent-ink: #ffffff;
  --accent-soft: rgba(214, 64, 74, .12);
  --accent-text: #f0868c;
  --line-1: #2f8f5b; --line-2: #d6404a; --line-3: #3b78b5;
  --gold: #e3b341;
}
/* GarfieldFaction — Paladium : orange */
.theme-gf, .gf-application, .gf-project, .admin-project-gf, .project-gf-option, .scope-gf {
  --accent: #f08a24;
  --accent-hover: #ff9b3a;
  --accent-ink: #1a0e03;
  --accent-soft: rgba(240, 138, 36, .12);
  --accent-text: #f6a95c;
  --line-1: #f08a24; --line-2: #f08a24; --line-3: #f08a24;
}

/* 2. Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); color: #fff; }
.hidden { display: none !important; }
.bi { line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* 3. Composants partagés ------------------------------------------------- */

/* Liseré de recrutement : seule apparition des couleurs en aplat */
.country-line, .hub-topline {
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: 3px; position: relative; z-index: 2;
}
.country-line i:nth-child(1), .hub-topline i:nth-child(1) { background: var(--line-1); }
.country-line i:nth-child(2), .hub-topline i:nth-child(2) { background: var(--line-2); }
.country-line i:nth-child(3), .hub-topline i:nth-child(3) { background: var(--line-3); }

/* Libellés secondaires : texte normal, pas de capitales ni de mono.
   La mono est réservée aux données (identifiants, clés, compteurs). */
.section-label, .project-meta, .hub-eyebrow, .application-eyebrow,
.context-country small, .application-status-label, .submitted-head span {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-3);
}

/* Boutons */
.btn, .primary-cta {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--control);
  padding: 0 var(--s5);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--t-md); font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--line-strong); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn .bi { font-size: 15px; }
.btn-primary, .primary-cta { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover, .primary-cta:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn-success { background: var(--ok); color: #06140c; }
.btn-success:hover { background: #63cf8f; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--bad) 55%, transparent); color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-discord { background: var(--discord); color: #fff; }
.btn-discord:hover { background: var(--discord-hover); }
.btn-small { min-height: var(--control-sm); padding: 0 var(--s3); font-size: var(--t-sm); border-radius: var(--r-sm); }
.btn-full { width: 100%; }
.discord-mark { width: 20px; height: 20px; object-fit: contain; flex: none; }
.btn .discord-mark { width: 18px; height: 18px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: var(--control-sm); height: var(--control-sm);
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--text-3);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }

/* Champs */
.control, .dark-control {
  width: 100%;
  min-height: var(--control);
  padding: 10px var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--t-md);
  line-height: 1.45;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.control::placeholder, .dark-control::placeholder { color: var(--text-3); opacity: 1; }
.control:hover, .dark-control:hover { border-color: #46505c; }
.control:focus, .dark-control:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}
.control[readonly] { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }
textarea.control, textarea.dark-control { min-height: 132px; resize: vertical; }
select.control, select.dark-control {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; }
.theme-hub input[type="checkbox"], .admin-body input[type="checkbox"] { accent-color: #8fb4ff; }

/* Statuts : point + libellé, jamais de pastille pleine */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-xs); font-weight: 600; letter-spacing: 0;
  white-space: nowrap; color: var(--text-2);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status.pending { color: var(--warn); }
.status.accepted { color: var(--ok); }
.status.rejected { color: var(--bad); }
.status.soon { color: var(--text-3); }

/* Messages */
.notice {
  display: none;
  padding: var(--s3) var(--s4);
  border-left: 3px solid var(--info);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--info-bg);
  color: var(--text);
  font-size: var(--t-sm);
  line-height: 1.5;
}
.notice.show { display: block; }
.notice.bad { border-color: var(--bad); background: var(--bad-bg); }
.notice.ok { border-color: var(--ok); background: var(--ok-bg); }
.notice.warn { border-color: var(--warn); background: var(--warn-bg); }

.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; }
