/*
 * Charte ZaLaMa pour la documentation de l'API : page de connexion et Swagger.
 *
 * Fichier servi par le backend, jamais en ligne dans le HTML : la politique de
 * sécurité des pages de documentation interdit les styles en ligne
 * (`style-src 'self'`) et les polices externes (`font-src 'self' data:`). D'où
 * la pile de polices système plutôt que Google Fonts.
 */

:root {
  --nuit: #010d3e;
  --nuit-clair: #0a1a55;
  --orange: #ff671e;
  --orange-presse: #e55512;
  --orange-25: #fff3ed;
  --orange-ligne: #ffd9c7;
  --encre: #0f172a;
  --discret: #64748b;
  --champ: #f1f5f9;
  --trait: #e2e8f0;
  --erreur-fond: #fdecea;
  --erreur-ligne: #f5c6c2;
  --erreur-texte: #a32b22;
  --police: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
}

/* ───────────────────────── Barre supérieure commune ───────────────────────── */

.zl-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nuit);
}
.zl-bar-inner {
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.zl-bar img {
  height: 26px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  display: block;
  /* Le logo est bleu vif : illisible sur le bleu nuit, passé en blanc. */
  filter: brightness(0) invert(1);
}
.zl-sep {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.2);
}
.zl-title {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
}
.zl-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.zl-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 8px;
}
.zl-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.zl-nav a.zl-active {
  color: var(--nuit);
  background: var(--orange);
}
.zl-nav a.zl-out {
  border: 1px solid rgba(255, 255, 255, 0.25);
}
@media (max-width: 640px) {
  .zl-sep,
  .zl-title {
    display: none;
  }
  .zl-nav a {
    padding: 7px 8px;
  }
}

/* ────────────────────────── Swagger aux couleurs ZaLaMa ───────────────────── */

.swagger-ui .topbar {
  display: none;
}
body.zl-doc {
  background: #f7f8fa;
  margin: 0;
  font-family: var(--police);
}
.swagger-ui,
.swagger-ui .info .title,
.swagger-ui .opblock-tag,
.swagger-ui .btn,
.swagger-ui input,
.swagger-ui select,
.swagger-ui textarea,
.swagger-ui .opblock .opblock-summary-description,
.swagger-ui .model-title,
.swagger-ui table thead tr th,
.swagger-ui .parameter__name,
.swagger-ui .tab li,
.swagger-ui .response-col_status,
.swagger-ui section.models h4 {
  font-family: var(--police);
}
.swagger-ui .wrapper {
  max-width: 1460px;
}
.swagger-ui .info {
  margin: 32px 0 24px;
}
.swagger-ui .info .title {
  color: var(--encre);
  font-weight: 700;
}
.swagger-ui .info .title small.version-stamp {
  background: var(--nuit);
}
.swagger-ui .info a,
.swagger-ui a.nostyle {
  color: var(--orange-presse);
}
.swagger-ui .scheme-container {
  background: #fff;
  box-shadow: none;
  border-bottom: 1px solid var(--trait);
}
.swagger-ui .btn {
  border-radius: 8px;
}
.swagger-ui .btn.authorize {
  color: var(--nuit);
  border-color: var(--nuit);
}
.swagger-ui .btn.authorize svg {
  fill: var(--nuit);
}
.swagger-ui .btn.execute {
  background: var(--orange);
  border-color: var(--orange);
}
.swagger-ui .btn.execute:hover {
  background: var(--orange-presse);
  border-color: var(--orange-presse);
}
.swagger-ui .opblock-tag {
  color: var(--encre);
  border-bottom-color: var(--trait);
}
.swagger-ui .opblock {
  border-radius: 10px;
  box-shadow: none;
}
.swagger-ui .opblock .opblock-summary-method {
  border-radius: 6px;
  font-weight: 600;
}
.swagger-ui .filter .operation-filter-input {
  border: 1.5px solid var(--trait);
  border-radius: 8px;
}
.swagger-ui .filter .operation-filter-input:focus {
  border-color: var(--orange);
  outline: none;
}
.swagger-ui input[type='text']:focus,
.swagger-ui textarea:focus {
  outline: 2px solid var(--orange);
}
.swagger-ui section.models {
  border-radius: 10px;
}

/* ───────────────────────────── Page de connexion ──────────────────────────── */

.zl-connexion *,
.zl-connexion *::before,
.zl-connexion *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html.zl-connexion,
body.zl-connexion {
  height: 100%;
}
body.zl-connexion {
  font-family: var(--police);
  color: var(--encre);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
}
.brand {
  position: relative;
  overflow: hidden;
  background: var(--nuit);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
}
.brand::before,
.brand::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 103, 30, 0.1);
}
.brand::before {
  width: 420px;
  height: 420px;
  right: -140px;
  top: -120px;
}
.brand::after {
  width: 300px;
  height: 300px;
  left: -90px;
  bottom: -110px;
  background: rgba(255, 255, 255, 0.05);
}
.brand > * {
  position: relative;
}
.brand-logo {
  display: block;
  align-self: flex-start;
  height: 40px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.brand h1 {
  font-size: 34px;
  line-height: 42px;
  font-weight: 700;
  max-width: 440px;
  letter-spacing: -0.01em;
}
.brand h1 span {
  color: var(--orange);
}
.brand .lead {
  margin-top: 14px;
  font-size: 15px;
  line-height: 24px;
  color: rgba(255, 255, 255, 0.72);
  max-width: 420px;
}
.facts {
  margin-top: 32px;
  display: grid;
  gap: 12px;
  max-width: 420px;
}
.fact {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
}
.fact i {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-style: normal;
}
.fact svg {
  width: 16px;
  height: 16px;
  stroke: var(--orange);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand small {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}
.panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.form-wrap {
  width: 100%;
  max-width: 380px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--orange-25);
  border: 1px solid var(--orange-ligne);
  color: #b8430f;
  font-size: 12px;
  font-weight: 600;
}
.eyebrow svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.zl-connexion h2 {
  margin-top: 16px;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sub {
  margin-top: 6px;
  font-size: 14px;
  line-height: 21px;
  color: var(--discret);
}
.bloc {
  margin-top: 28px;
  display: grid;
  gap: 16px;
}
.erreur {
  display: none;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--erreur-fond);
  border: 1px solid var(--erreur-ligne);
  color: var(--erreur-texte);
  font-size: 13px;
  line-height: 19px;
}
.erreur.visible {
  display: flex;
}
.erreur svg {
  flex: none;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bouton-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  border-radius: 8px;
  background: var(--nuit);
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}
.bouton-google:hover {
  background: var(--nuit-clair);
}
.bouton-google:active {
  transform: scale(0.99);
}
.bouton-google svg {
  width: 18px;
  height: 18px;
}
.rappel {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--champ);
  border: 1px solid var(--trait);
  color: var(--discret);
  font-size: 13px;
  line-height: 19px;
}
.rappel svg {
  flex: none;
  width: 18px;
  height: 18px;
  stroke: var(--orange);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.zl-connexion :focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--trait);
  font-size: 12px;
  line-height: 18px;
  color: var(--discret);
}
.logo-mobile {
  display: none;
}
@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .brand {
    display: none;
  }
  .panel {
    align-items: flex-start;
    padding-top: 40px;
  }
  .logo-mobile {
    display: block;
    height: 34px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    margin-bottom: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .zl-connexion * {
    transition: none !important;
  }
}
