/* =====================================================================
   EducAfrika — Identité visuelle "Sommet"
   Feuille de style globale, injectée automatiquement sur toutes les
   pages de l'application par public/index.php (voir le bloc d'injection
   dans le front controller). Ne pas oublier de garder ce fichier en
   phase avec la charte définie pour le site vitrine (Main.dc.html).
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600;700&family=Karla:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --primary: #C1502E;      /* terre cuite */
  --secondary: #0E3A53;    /* bleu nuit */
  --accent: #E8A93B;       /* or solaire */
  --support: #1F6F4A;      /* vert institutionnel */
  --ink: #1C1712;          /* encre chaude */
  --paper: #E7E1D5;        /* pierre */
  --text-onink: #F1ECE3;
  --white: #FFFFFF;
  --danger: #B91C1C;
  --ligne: rgba(28, 23, 18, 0.12);
}

/* ---------- Réinitialisation de base ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Karla', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--secondary);
  line-height: 1.25;
  margin: 0 0 16px;
}

h1 { font-size: 26px; }
h2 { font-size: 21px; margin-top: 32px; }
h3 { font-size: 17px; }

p { margin: 0 0 12px; }

small { color: rgba(28, 23, 18, 0.65); }

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

hr {
  border: none;
  border-top: 1px solid var(--ligne);
  margin: 24px 0;
}

/* ---------- Bandeau de marque (injecté juste après <body>) ---------- */
.eda-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--secondary);
  padding: 14px 28px;
}

.eda-entete__marque {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eda-entete__symbole {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 8px;
  background: rgba(241, 236, 227, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.eda-entete__symbole svg { width: 18px; height: 18px; }

.eda-entete__nom {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--text-onink);
  letter-spacing: 0.01em;
}

.eda-entete__lien-accueil {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-onink);
}
.eda-entete__lien-accueil:hover { text-decoration: none; opacity: 0.85; }

/* ---------- Bandeau essai gratuit (injecté entre l'en-tête et la page,
   uniquement pour le personnel d'un établissement jamais payé, encore
   dans les 14 jours d'essai — voir claude/ARCHITECTURE-BLOCAGE-ABONNEMENT.md) ---------- */
.eda-bandeau-essai {
  background: rgba(232, 169, 59, 0.16);
  border-bottom: 1px solid rgba(232, 169, 59, 0.4);
  color: var(--ink);
  font-size: 13.5px;
  text-align: center;
  padding: 10px 24px;
}

/* ---------- Conteneur de page (injecté après le bandeau) ---------- */
.eda-page {
  max-width: 1080px;
  margin: 28px auto 60px;
  padding: 0 24px;
}

.eda-panneau {
  background: var(--white);
  border: 1px solid var(--ligne);
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: 0 1px 2px rgba(28, 23, 18, 0.04);
}

/* ---------- Pied de page (injecté avant </body>) ---------- */
.eda-pied {
  max-width: 1080px;
  margin: 0 auto 40px;
  padding: 20px 24px 0;
  color: rgba(28, 23, 18, 0.55);
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
}

/* ---------- Liens de navigation en haut de contenu ---------- */
.eda-panneau p a { font-weight: 600; }

/* ---------- Formulaires ---------- */
form { margin: 0; }

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: var(--secondary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  font-family: 'Karla', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ligne);
  border-radius: 8px;
  transition: border-color .15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
}

textarea { max-width: 100%; min-height: 110px; }

/* ---------- Boutons ---------- */
button,
input[type="submit"],
input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 8px;
  font-family: 'Karla', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--white);
  background: var(--primary);
  border: none;
  cursor: pointer;
  transition: opacity .15s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  opacity: 0.88;
}

/* ---------- Champ mot de passe avec bouton "œil" (afficher/masquer) ----------
   Composant partagé par tous les formulaires de mot de passe de
   l'application (connexion, création de compte, réinitialisation, "Mon
   profil"...) — voir app/Helpers/ChampMotDePasse.php pour le balisage et
   le script de bascule injecté globalement dans public/index.php. */
.eda-champ-mdp {
  position: relative;
  max-width: 420px;
}

.eda-champ-mdp input[type="password"],
.eda-champ-mdp input[type="text"] {
  padding-right: 44px;
}

.eda-mdp-bouton {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: rgba(28, 23, 18, 0.55);
  cursor: pointer;
  transition: none;
}

.eda-mdp-bouton:hover {
  opacity: 1;
  background: rgba(28, 23, 18, 0.06);
  color: var(--ink);
}

.eda-mdp-bouton svg { width: 18px; height: 18px; }

.eda-mdp-bouton__oeil-ferme { display: none; }

.eda-mdp-bouton--actif .eda-mdp-bouton__oeil-ouvert { display: none; }
.eda-mdp-bouton--actif .eda-mdp-bouton__oeil-ferme { display: block; }

/* ---------- Bloc d'actions (bouton principal + lien secondaire, ex. page
   de présentation de l'affiliation) ---------- */
.eda-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Boutons de suppression : reconnus par leur libellé / attribut de confirmation */
button[name="supprimer"],
form[data-confirmation] button,
.eda-danger {
  background: var(--danger);
}

/* ---------- Tableaux ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  background: var(--white);
}

table[border] { border: none; }

thead th {
  background: var(--secondary);
  color: var(--text-onink);
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 12px;
  border: none;
}

tbody td, tbody th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ligne);
  border-left: none;
  border-right: none;
}

tbody tr:nth-child(even) { background: rgba(231, 225, 213, 0.35); }
tbody tr:hover { background: rgba(232, 169, 59, 0.12); }

/* ---------- Messages d'état ---------- */
p[style*="color: green"], p[style*="color:green"] {
  color: var(--support) !important;
  background: rgba(31, 111, 74, 0.08);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(31, 111, 74, 0.25);
}

p[style*="color: red"], p[style*="color:red"] {
  color: var(--danger) !important;
  background: rgba(185, 28, 28, 0.06);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(185, 28, 28, 0.2);
}

/* ---------- Utilitaires ---------- */
.mono { font-family: 'IBM Plex Mono', monospace; }

@media (max-width: 720px) {
  .eda-entete { padding: 12px 16px; }
  .eda-page { padding: 0 14px; margin-top: 18px; }
  .eda-panneau { padding: 20px; }
  .eda-bandeau-essai { padding: 10px 16px; }

  .eda-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .eda-actions > a:first-child { display: block; }
  .eda-actions > a:first-child button { width: 100%; }
}

@media print {
  .eda-entete { background: none; padding: 0 0 16px; }
  .eda-entete__nom, .eda-entete__symbole { color: var(--ink) !important; }
  .eda-entete__symbole { background: none; }
  .eda-panneau { border: none; box-shadow: none; padding: 0; }
  .eda-pied { display: none; }
  .eda-bandeau-essai { display: none; }
}
