/* ==========================================================================
   matchSup — Front office
   2 vues : connexion -> accueil
   (l'ecran de connexion et la barre du haut servent aussi au back office)
   ========================================================================== */

/* ----------------------------------------------------------- connexion -- */

.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px var(--pad) 40px;
  gap: 28px;
}

.gate__brand { text-align: center; }
.gate__brand .logo { flex-direction: column; gap: 14px; }
.gate__brand .logo__text { align-items: center; }
.gate__brand .logo__name { font-size: 2.1rem; }

.gate__card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}

.gate__title {
  text-align: center;
  font-size: 1.05rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: -.015em;
}
.gate__sub { text-align: center; color: var(--text-mute); font-size: .88rem; margin-bottom: 20px; }
.gate__card .alert { margin-bottom: 14px; }

.gate__form { display: flex; flex-direction: column; gap: 14px; }

.gate__foot {
  text-align: center;
  font-size: .8rem;
  color: var(--text-mute);
  max-width: 420px;
}

/* ------------------------------------------------------------- header --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.topbar .logo { flex: 0 0 auto; }
.topbar .logo__name { font-size: 1.28rem; white-space: nowrap; }
.topbar .logo__baseline { display: none; }
.topbar .btn { white-space: nowrap; flex: 0 0 auto; }

/* Personne connectee, dans la barre du haut. */
.topbar__who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .84rem;
  color: var(--text-soft);
}

/* --------------------------------------------------------------- pages --- */

/* Seulement haut et bas : les cotes restent ceux de .wrap (marge de bord). */
.page { padding-top: 22px; padding-bottom: 56px; }

.section-head { margin: 28px 0 12px; }
.section-head h2 { margin: 0; text-transform: uppercase; font-weight: 900; letter-spacing: -.015em; }

.empty {
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--text-mute);
  text-align: center;
  font-size: .92rem;
}

/* Simulateurs en ligne, sur l'accueil. */
.sim-tuiles { display: grid; gap: 12px; }
.sim-tuiles > .empty { grid-column: 1 / -1; }
.sim-tuile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color .14s, transform .12s;
}
.sim-tuile:hover { border-color: var(--brand-cyan); transform: translateY(-2px); }
.sim-tuile__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-cyan));
}
.sim-tuile__corps { display: grid; gap: 4px; padding: 14px 16px 16px; }
.sim-tuile__titre { font-weight: 800; font-size: 1.05rem; }
.sim-tuile__seance { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-cyan-text); }
.sim-tuile__texte {
  font-size: .87rem;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 620px) {
  .sim-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Changement de mot de passe (front office et back office). */
.mdp-form { display: grid; gap: 14px; max-width: 420px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ok);
  color: #ffffff;
  font-weight: 650;
  font-size: .9rem;
  box-shadow: var(--shadow);
  animation: fade-up .22s ease both;
}
.toast--err { background: #c3311f; }

@media (min-width: 760px) {
  .page { padding-top: 32px; padding-bottom: 72px; }
  .gate__brand .logo__name { font-size: 2.6rem; }
  .gate__card { padding: 32px 30px; }
}

@media (max-width: 600px) {
  .topbar__who { display: none; }
}
@media (max-width: 520px) {
  .topbar .btn--see { display: none; }
}

/* ------------------------------------------------ pied de page, pages legales */

.pied { border-top: 1px solid var(--line-soft); background: rgba(255, 255, 255, .6); }
.pied__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-top: 14px;
  padding-bottom: 18px;
  font-size: .8rem;
}
.pied a, .gate__liens a { color: var(--text-mute); text-decoration: none; }
.pied a:hover, .gate__liens a:hover { color: var(--text); text-decoration: underline; }
.gate__liens { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 10px; }

.page-legale__accueil { color: inherit; text-decoration: none; }
.page-legale__texte { max-width: 720px; }
.page-legale__texte h2 {
  margin: 28px 0 8px;
  font-size: 1.08rem;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: -.015em;
  scroll-margin-top: 80px;
}
.page-legale__texte p, .page-legale__texte li { color: var(--text-soft); overflow-wrap: anywhere; }
.page-legale__texte ul { margin: 0 0 1em; padding-left: 22px; }
.page-legale__texte li + li { margin-top: 4px; }
.page-legale__texte a { color: var(--brand-cyan-text); }

/* ------------------------------------------- téléphone : toute la largeur -- */
/* Mobile first : sous 600 px, les blocs de premier niveau (cartes, fiches de
   liste, tableaux, encadré de connexion) vont d'un bord de l'écran à l'autre,
   sans bord latéral ni coin arrondi ; le texte garde une marge de 16 px. Le
   contenu ne perd plus la double marge page + carte. (Back office compris : ces
   sélecteurs, plus précis que ceux d'admin.css, l'emportent.) */
@media (max-width: 599px) {
  :root { --pad: 16px; }
  .page .card:not(.card .card),
  .page .code-item,
  .page .sim-carte,
  .page .tableau,
  .page .sim-tuile,
  .page .empty {
    margin-left: calc(-1 * var(--pad));
    margin-right: calc(-1 * var(--pad));
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .page .card:not(.card .card),
  .page .code-item,
  .page .sim-carte { padding-left: var(--pad); padding-right: var(--pad); }
  .page .code-list, .page .sim-liste, .page .sim-tuiles { gap: 8px; }
  .gate { padding-left: 0; padding-right: 0; }
  .gate__card { max-width: none; border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; padding: 22px var(--pad); }
  .gate__liens { padding: 0 var(--pad); }
}
