/* Polices auto-hébergées (cohérent avec panel-affichage et la contrainte "système
   fermé" du projet : pas de dépendance réseau au runtime). */
@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/bebas-neue-v16-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/open-sans-v44-latin.woff2') format('woff2');
}

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

/* DA Herde Holding (or / noir sur fond clair), teintes prises sur le logo. Le texte
   sur fond or est noir (le blanc y serait illisible) ; le texte or sur fond blanc
   utilise la teinte foncée, seule assez contrastée. Le rouge reste réservé aux
   alertes et aux erreurs. */
:root {
  --herde-gold: #d4a82a;
  --herde-gold-hover: #b8901c;
  --herde-gold-dark: #8a6a00;
  --herde-gold-pale: #faf3dc;
  --herde-black: #141414;
  --alert-red: #c62828;
  --success-green: #2e7d32;
  --text-muted: #666;
  --border: #ddd;
}

body { font-family: 'Open Sans', sans-serif; max-width: 420px; margin: 40px auto; padding: 0 16px; color: #222; }
#brand-logo { display: block; width: 100%; max-width: 220px; height: auto; margin: 0 auto 24px; }
h1 {
  font-family: 'Bebas Neue', 'Open Sans', sans-serif; font-weight: 400; letter-spacing: 0.03em;
  color: var(--herde-black); font-size: 34px; margin: 0 0 20px; text-align: center;
}
/* Titre de section secondaire (ex. demandes invités sur "Mes missions") : même famille
   que h1, plus petit et aligné à gauche pour ne pas rivaliser avec le titre de page. */
h2 {
  font-family: 'Bebas Neue', 'Open Sans', sans-serif; font-weight: 400; letter-spacing: 0.03em;
  color: var(--herde-black); font-size: 22px; margin: 32px 0 4px;
}
.section-hint { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
form { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: flex; gap: 12px; align-items: flex-end; }
.form-row label { flex: 1; min-width: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-muted); }
input, select, textarea, button { font-size: 16px; padding: 8px; font-family: inherit; }
input, select, textarea { border: 1px solid var(--border); border-radius: 4px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--herde-gold); outline-offset: 1px; border-color: var(--herde-gold); }

button {
  background: var(--herde-gold); color: var(--herde-black); border: none; border-radius: 6px; padding: 10px;
  cursor: pointer; font-weight: 600; transition: background-color 150ms ease, transform 100ms ease;
}
button:hover { background: var(--herde-gold-hover); }
button:active { transform: scale(0.97); }
button:disabled { background: #ead9a4; color: #6b5d33; cursor: default; transform: none; }

/* Action secondaire répétée dans une liste (ex. "Changer" par compte) : un bouton
   plein rouge à chaque ligne devient vite trop lourd visuellement. Fond rouge très
   clair plutôt qu'un simple contour (qui, désactivé, devenait presque invisible :
   bordure et texte de la même couleur pâle — corrigé ici avec un vrai remplissage gris
   au repos, lisible même désactivé). */
.button-compact {
  flex: 0 0 auto; width: auto; font-weight: 600; border: 1px solid transparent;
  background: var(--herde-gold-pale); color: var(--herde-gold-dark);
}
.button-compact:hover:not(:disabled) { background: var(--herde-gold); color: var(--herde-black); }
.button-compact:disabled { background: #eee; color: #999; }

/* Menu partagé entre les pages authentifiées (voir nav.js) */
#main-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
#main-nav a { color: var(--text-muted); text-decoration: none; }
#main-nav .nav-brand { height: 32px; width: auto; }
#main-nav a:hover { color: var(--herde-gold-dark); }
#main-nav a.active { color: var(--herde-gold-dark); font-weight: 600; }
#main-nav .nav-logout {
  margin-left: auto; width: 36px; height: 36px; flex: 0 0 auto; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-muted); border: 1px solid var(--border); border-radius: 6px;
}
#main-nav .nav-logout:hover { background: #f5f5f5; color: var(--herde-gold-dark); border-color: var(--herde-gold); }

.secondary-link { font-size: 14px; margin-top: 24px; }
.secondary-link a { color: var(--text-muted); }
.secondary-link a:hover { color: var(--herde-gold-dark); }
dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
dt { color: var(--text-muted); }
dd { margin: 0; font-weight: 600; }
#missions-list, #comptes-list, #invitees-list, #others-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
#comptes-list { margin-top: 24px; }
#missions-list li, #comptes-list li, #invitees-list li, #others-list li { border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.mission-text { margin: 0; }
.list-controls { margin-bottom: 16px; }
/* Même règle que l'écran d'affichage (seuil selon le statut, calculé par l'API). */
#missions-list li.mission-alerte, #invitees-list li.mission-alerte, #others-list li.mission-alerte { border-color: var(--alert-red); border-left-width: 4px; }
.alerte-badge { margin: 0; font-size: 13px; font-weight: 600; color: var(--alert-red); }
.mission-meta { margin: 0; font-size: 13px; color: #777; }

/* Retour visuel des formulaires : même emplacement de texte, juste une couleur qui dit
   si ça a marché ou non (avant : même gris pour "Mission créée." et pour une erreur). */
#feedback, #login-feedback { min-height: 1.2em; }
.feedback-success { color: var(--success-green); }
.feedback-error { color: var(--alert-red); }

/* Bascule connexion / formulaire (voir app.js) : fondu plutôt qu'un affichage brutal. */
.fade-in { animation: fadeIn 200ms ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Couleurs par type de mission (mêmes teintes que panel-affichage, assombries pour
   rester lisibles sur fond clair) — pour repérer un type au premier coup d'œil dans
   "Mes missions" au lieu de texte uniforme. */
.type-2ef { color: #8d5a2b; }
.type-neastage { color: #c2185b; }
.type-probat26 { color: #6a4fb0; }
.type-greenie { color: #2e7d32; }
.type-herde { color: #9a7400; }
.type-capeb { color: #1565c0; }
.type-pompiers { color: #c62828; }
.type-perso { color: #333; }
.type-reseaux { color: #00796b; }
.type-autres { color: #757575; }

/* Afficher/masquer le mot de passe (formulaire de création + changement de mot de passe) */
.password-field { position: relative; }
.password-field input { padding-right: 40px; }
.toggle-password {
  position: absolute; right: 2px; top: 2px; bottom: 2px; width: 36px;
  display: flex; align-items: center; justify-content: center;
  background: none; color: var(--text-muted); font-size: 16px; padding: 0; border-radius: 4px;
}
.toggle-password:hover { background: #f5f5f5; }
.toggle-password:active { transform: scale(0.9); }

/* Lien vers l'écran d'affichage en mode PC (NEATODO-9) : sans intérêt sur un téléphone,
   où le tableau à 7 colonnes serait illisible. Pas dans le menu, qui passerait sur deux lignes. */
@media (max-width: 700px) { .pc-only { display: none; } }

/* Bouton « Choisir dans mes contacts » (NEATODO-6), au-dessus du champ Destinataire. */
.contact-picker { align-self: flex-start; padding: 8px 14px; }
