:root {
  --snse: #1f4e3d;
  --snse-profond: #10261f;
  --snse-clair: #e7f2ec;
  --laiton: #c4a36a;
  --encre: #163028;
  --sable: #f4f0e6;
  --ivoire: #fffefb;
  --ligne: rgba(31, 78, 61, .12);
  --ombre: 0 14px 40px rgba(16, 38, 31, .07);
  --rayon: 1rem;
}

body.coquille {
  color: var(--encre);
  background:
    radial-gradient(ellipse 70% 40% at 0% -10%, rgba(196, 163, 106, .18), transparent 50%),
    radial-gradient(ellipse 50% 30% at 100% 0%, rgba(31, 78, 61, .08), transparent 46%),
    var(--sable);
  font-feature-settings: "kern";
}
body.coquille main { padding-top: .25rem; }

h1, .connexion-marque h1, .connexion-carte h2 {
  font-family: Georgia, "Palatino Linotype", Palatino, serif;
}
main h1 {
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--encre);
}

.barre-nav {
  margin: .85rem 1rem 1.15rem;
  padding: .35rem .4rem;
  border-radius: 1rem;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .08), transparent 32%),
    linear-gradient(165deg, #245744 0%, var(--snse-profond) 78%) !important;
  box-shadow: 0 12px 32px rgba(16, 38, 31, .22);
  animation: descendre .55s ease both;
}
.barre-nav .navbar-brand {
  letter-spacing: .01em;
  padding-left: .65rem;
}
.barre-nav .navbar-brand i { color: var(--laiton); }
.barre-nav .nav-link {
  position: relative;
  margin: 0 .1rem;
  border-radius: .7rem;
  color: rgba(246, 241, 230, .82) !important;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.barre-nav .nav-link:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff !important;
}
.barre-nav .nav-link.active {
  background: rgba(255, 255, 255, .14);
  color: #fff !important;
  font-weight: 650;
  text-decoration: none;
}
.barre-nav .navbar-text { color: rgba(228, 201, 154, .9) !important; }
.barre-nav .dropdown-menu {
  border: 0;
  border-radius: .85rem;
  box-shadow: var(--ombre);
  padding: .4rem;
  animation: monter .22s ease both;
}
.barre-nav .dropdown-item { border-radius: .55rem; }
.barre-nav .dropdown-item:hover { background: var(--snse-clair); }

.page-entre > * { animation: monter .55s ease both; }
.page-entre > *:nth-child(2) { animation-delay: .06s; }
.page-entre > *:nth-child(3) { animation-delay: .12s; }
.page-entre > *:nth-child(4) { animation-delay: .18s; }

.card {
  background: var(--ivoire);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--ligne);
  font-weight: 650;
  color: var(--encre);
}
.carte-kpi {
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
}
.carte-kpi:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(16, 38, 31, .12); }
.carte-kpi .card-body { position: relative; }
.carte-kpi .card-body::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -22px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 163, 106, .35), transparent 68%);
}
.row.g-3 > [class*="col-"]:nth-child(1) .carte-kpi { animation: monter .6s ease both; }
.row.g-3 > [class*="col-"]:nth-child(2) .carte-kpi { animation: monter .6s .05s ease both; }
.row.g-3 > [class*="col-"]:nth-child(3) .carte-kpi { animation: monter .6s .1s ease both; }
.row.g-3 > [class*="col-"]:nth-child(4) .carte-kpi { animation: monter .6s .15s ease both; }
.row.g-3 > [class*="col-"]:nth-child(5) .carte-kpi { animation: monter .6s .2s ease both; }
.row.g-3 > [class*="col-"]:nth-child(6) .carte-kpi { animation: monter .6s .25s ease both; }
.carte-kpi .valeur { font-size: 1.9rem; font-weight: 700; color: var(--snse); line-height: 1.1; font-variant-numeric: tabular-nums; }
.carte-kpi .libelle { font-size: .72rem; color: #6c757d; text-transform: uppercase; letter-spacing: .06em; }

.table { --bs-table-bg: transparent; }
.table thead th, .table-light th {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #5c675f;
  font-weight: 700;
  background: #f7f4ec !important;
  border-bottom-color: var(--ligne);
}
.table-sm td, .table-sm th { vertical-align: middle; }
.table-hover tbody tr { transition: background .18s ease; }
tbody tr { animation: ligne .45s ease both; }
tbody tr:nth-child(2) { animation-delay: .03s; }
tbody tr:nth-child(3) { animation-delay: .06s; }
tbody tr:nth-child(4) { animation-delay: .09s; }
tbody tr:nth-child(5) { animation-delay: .12s; }
tbody tr:nth-child(n+6) { animation-delay: .15s; }
.table a { color: var(--snse); text-decoration: none; font-weight: 600; }
.table a:hover { color: #0e3328; text-decoration: underline; text-underline-offset: 3px; }

.barre { height: 8px; background: #e7e1d4; border-radius: 99px; overflow: hidden; min-width: 80px; }
.barre > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6b56, var(--snse));
  transform-origin: left center;
  animation: remplir .8s cubic-bezier(.2, .7, .2, 1) both;
}
.barre.seuil > span { background: linear-gradient(90deg, #8d6b32, #c4a36a); }

.ligne-dispersion { background: #fff6e0 !important; }
.theme-titre { background: var(--snse-clair); font-weight: 600; }
.note-radio .form-check { display: block; margin: 0 0 2px 0; font-size: .85rem; }
.note-radio ul { list-style: none; padding: 0; margin: 0; }
.note-radio label { cursor: pointer; }
.badge { border-radius: 999px; font-weight: 650; letter-spacing: .03em; }
.badge-liste-A { background: #1d4e89; }
.badge-liste-B { background: #5b3d8a; }
textarea.form-control-sm { font-size: .85rem; }

.btn {
  border-radius: .7rem;
  font-weight: 650;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-success {
  background: var(--snse);
  border-color: var(--snse);
  box-shadow: 0 8px 18px rgba(31, 78, 61, .18);
}
.btn-success:hover { background: #173c2f; border-color: #173c2f; }
.btn-outline-secondary, .btn-outline-success, .btn-primary, .btn-outline-primary {
  border-radius: .7rem;
}
.btn-primary { background: #1d4e89; border-color: #1d4e89; }

.form-control, .form-select {
  border-radius: .7rem;
  border-color: #d7d1c4;
  background: #fcfbf7;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--snse);
  box-shadow: 0 0 0 .2rem rgba(31, 78, 61, .14);
  background: #fff;
}
.alert {
  border: 0;
  border-radius: .85rem;
  box-shadow: 0 8px 20px rgba(16, 38, 31, .05);
}

body.page-connexion { background: var(--snse-profond); }
body.page-connexion main { padding: 0 !important; min-height: 100dvh; }
body.page-connexion .messages:not(:has(.alert)) { display: none; }
body.page-connexion .page-entre > * { animation: none; }

.ecran-connexion {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
}
.connexion-marque,
.connexion-panneau { min-width: 0; }
.connexion-marque {
  position: relative;
  overflow: hidden;
  color: #f6f1e6;
  padding: 4.5rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    radial-gradient(ellipse 80% 60% at 12% 8%, rgba(212, 180, 131, .22), transparent 55%),
    radial-gradient(circle at 88% 92%, rgba(255, 255, 255, .06), transparent 42%),
    linear-gradient(165deg, #1c4a3a 0%, #10261f 62%, #0b1c17 100%);
}
.connexion-marque::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 72%, transparent);
  animation: derive 28s linear infinite;
  pointer-events: none;
}
.connexion-marque > * { position: relative; max-width: 34rem; animation: monter .7s ease both; }
.connexion-marque > *:nth-child(2) { animation-delay: .08s; }
.connexion-marque > *:nth-child(3) { animation-delay: .16s; }
.connexion-marque > *:nth-child(4) { animation-delay: .24s; }
.marque-sigle {
  margin: 0 0 1.4rem;
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #e4c99a;
}
.marque-sigle i { margin-right: .45rem; letter-spacing: 0; }
.connexion-marque h1 {
  margin: 0;
  max-width: 12em;
  font-weight: 500;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: #f7f3ea;
  text-shadow: 0 12px 28px rgba(0, 0, 0, .28);
  overflow-wrap: break-word;
}
.marque-texte {
  margin: 1.15rem 0 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(246, 241, 230, .82);
}
.marque-points {
  list-style: none;
  margin: 2.2rem 0 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid rgba(228, 201, 154, .35);
}
.marque-points li {
  position: relative;
  padding-left: 1.15rem;
  margin: .55rem 0;
  color: rgba(246, 241, 230, .78);
  font-size: .95rem;
}
.marque-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: #e4c99a;
}

.connexion-panneau {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background:
    radial-gradient(circle at 80% 0%, rgba(31, 78, 61, .08), transparent 36%),
    var(--sable);
}
.connexion-carte {
  width: min(100%, 26rem);
  background: var(--ivoire);
  border: 1px solid rgba(31, 78, 61, .08);
  border-radius: 1.15rem;
  box-shadow: 0 18px 50px rgba(16, 38, 31, .08);
  padding: 2.1rem 2rem 1.8rem;
  animation: monter .75s .12s ease both;
}
.connexion-carte h2 { margin: 0; font-size: 1.45rem; font-weight: 500; color: var(--encre); }
.connexion-intro { margin: .45rem 0 1.35rem; color: #667068; font-size: .92rem; line-height: 1.45; }
.connexion-erreur { margin-bottom: 1rem; padding: .7rem .85rem; border-radius: .65rem; background: #fdecec; color: #8d2a2a; font-size: .88rem; }
.connexion-carte .champ { margin-bottom: 1rem; }
.connexion-carte label {
  display: block;
  margin-bottom: .35rem;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #3d4a44;
}
.connexion-carte .form-control { height: 2.85rem; padding: .55rem .85rem; font-size: 1rem; }
.btn-connexion {
  width: 100%;
  margin-top: .45rem;
  height: 2.9rem;
  border: 0;
  border-radius: .75rem;
  background: var(--snse);
  color: #f6f1e6;
  font-weight: 650;
  letter-spacing: .01em;
  transition: transform .16s ease, background .16s ease;
}
.btn-connexion:hover { background: #173c2f; transform: translateY(-1px); }
.btn-connexion:focus-visible { outline: 3px solid #e4c99a; outline-offset: 2px; }

@keyframes monter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes descendre {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}
@keyframes ligne {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes remplir {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes derive {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(48px, 24px, 0); }
}

@media (max-width: 860px) {
  .ecran-connexion { grid-template-columns: minmax(0, 1fr); }
  .connexion-marque { padding: 2.4rem 1.35rem 1.8rem; justify-content: flex-start; }
  .connexion-marque h1 { font-size: clamp(1.7rem, 8vw, 2.05rem); }
  .marque-points { display: none; }
  .connexion-panneau { align-items: flex-start; padding: 1.5rem 1.1rem 2rem; }
  .connexion-carte { padding: 1.6rem 1.25rem 1.4rem; }
  .barre-nav { margin: .5rem .5rem .8rem; }
}

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

@media print {
  .no-print, .navbar, .messages { display: none !important; }
  body, body.coquille { background: #fff; }
  .card { border: none !important; box-shadow: none !important; }
  *, *::before, *::after { animation: none !important; }
}
