/* ═══════════════════════════════════════════════════════════════════
   SAMS — Page de connexion (refonte)
   Identité sobre et hospitalière. Deux panneaux : accès (hero) + guide.
   Clair/sombre, responsive desktop / tablette / mobile.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --navy:     #16296b;
  --primary:  #1f55c4;
  --primary-h:#1a47a6;
  --discord:  #5865f2;
  --discord-h:#4752c4;

  --bg:       #eef1f7;
  --surface:  #ffffff;
  --surface-2:#f7f9fc;
  --text:     #1b2434;
  --text-soft:#596274;
  --text-mute:#8893a4;
  --border:   #e4e8ef;
  --border-2: #d7dde7;
  --warn:     #b45309;
  --warn-bg:  #fbf1e3;

  --r:    12px;
  --r-sm: 9px;
  --r-lg: 18px;
  --shadow:   0 1px 2px rgba(16,24,40,.06);
  --shadow-lg:0 24px 60px -24px rgba(16,24,40,.35), 0 8px 24px -12px rgba(16,24,40,.18);
  --ease: cubic-bezier(.4,0,.2,1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --navy:     #16224d;
  --primary:  #6b9bff;
  --primary-h:#588aff;
  --bg:       #0b0f17;
  --surface:  #141a24;
  --surface-2:#1b212d;
  --text:     #e7ebf2;
  --text-soft:#aab3c2;
  --text-mute:#7d8698;
  --border:   #262d3a;
  --border-2: #313a4a;
  --warn:     #d79a4a;
  --warn-bg:  #352711;
  --shadow-lg:0 24px 60px -24px rgba(0,0,0,.7), 0 8px 24px -12px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
.login-body {
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 110% -10%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 60%),
    var(--bg);
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.lg-wrap { width: 100%; max-width: 1040px; }

/* Carte principale à deux panneaux */
.lg-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* ── Panneau ACCÈS (hero) ── */
.lg-hero {
  position: relative;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  min-height: 560px;
  background: var(--navy);
}
.lg-hero-bg {
  position: absolute; inset: 0;
  background-image: url("../img/etablissement.jpg");
  background-size: cover; background-position: center;
  opacity: .22;
}
.lg-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,18,45,.78), rgba(10,18,45,.92));
}
.lg-hero-content { position: relative; z-index: 1; }

.lg-logo {
  width: 74px; height: 74px; border-radius: 50%;
  background: #fff; padding: 7px; object-fit: contain;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
  margin-bottom: 20px;
}
.lg-title {
  font-family: Oswald, sans-serif; font-weight: 600;
  font-size: clamp(26px, 3.4vw, 34px); line-height: 1.1; margin: 0 0 6px;
  letter-spacing: .01em;
}
.lg-title span { color: #8fb0ff; }
.lg-sub { margin: 0 0 20px; font-size: 14px; color: rgba(255,255,255,.72); letter-spacing: .02em; }
.lg-intro { font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,.88); margin: 0 0 26px; max-width: 38ch; }

/* Boutons */
.lg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  width: 100%; padding: 14px 20px; border-radius: var(--r-sm);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none; border: 1px solid transparent; transition: .15s var(--ease);
}
.lg-btn svg { flex: 0 0 auto; display: block; }
.lg-btn-discord { background: var(--discord); color: #fff; }
.lg-btn-discord:hover { background: var(--discord-h); transform: translateY(-1px); }
.lg-btn-discord svg { width: 23px; height: 23px; }

.lg-access {
  margin: 18px 0 0; font-size: 12.5px; line-height: 1.5;
  color: rgba(255,255,255,.62);
}

/* ── Panneau GUIDE / INFO ── */
.lg-info { padding: 36px 36px 32px; background: var(--surface); display: flex; flex-direction: column; gap: 22px; }

/* Avertissement */
.lg-warn {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 15px 16px; border-radius: var(--r);
  background: var(--warn-bg);
  border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
}
.lg-warn > svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--warn); margin-top: 1px; }
.lg-warn strong { display: block; color: var(--warn); font-size: 14.5px; margin-bottom: 4px; }
.lg-warn p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text); }

/* Guide visuel */
.lg-guide-title {
  font-family: Oswald, sans-serif; font-weight: 500; font-size: 13px;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute);
  margin: 0 0 14px;
}
.lg-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lg-step {
  margin: 0; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.lg-step-head { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--text); }
.lg-step-n {
  width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--primary); color: #fff;
}
.lg-step img {
  width: 100%; height: 170px; object-fit: contain; object-position: center;
  background: #0b1020; border-radius: var(--r-sm); border: 1px solid var(--border);
}
.lg-step figcaption { font-size: 12px; line-height: 1.5; color: var(--text-soft); }

/* Rejoindre le Discord 911 */
.lg-join {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px; border: 1px dashed var(--border-2); border-radius: var(--r);
  background: var(--surface-2);
}
.lg-join strong { display: block; font-size: 14px; color: var(--text); }
.lg-join p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-soft); }
.lg-btn-join { width: auto; background: transparent; color: var(--discord); border-color: var(--discord); padding: 11px 16px; font-size: 13.5px; }
.lg-btn-join:hover { background: var(--discord); color: #fff; }
.lg-btn-join svg { width: 19px; height: 19px; }

.lg-legal { text-align: center; margin: 18px 0 0; font-size: 12px; color: var(--text-mute); }

/* Bascule de thème */
.lg-theme {
  position: fixed; top: 16px; right: 16px; z-index: 5;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
  box-shadow: var(--shadow);
}
.lg-theme:hover { color: var(--primary); border-color: var(--primary); }
.lg-theme svg { width: 19px; height: 19px; }

/* ── Chargement (clic connexion + page de bienvenue) ── */
.lg-spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-top-color: var(--primary); animation: lgspin .8s linear infinite;
}
@keyframes lgspin { to { transform: rotate(360deg); } }
.lg-loading {
  position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(6px);
}
.lg-loading.show { display: grid; animation: lgfade .2s var(--ease); }
@keyframes lgfade { from { opacity: 0; } }
.lg-loading-card {
  text-align: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 36px 42px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 380px;
  animation: lgpop .22s var(--ease);
}
@keyframes lgpop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.lg-loading-logo { width: 66px; height: 66px; border-radius: 50%; background: #fff; padding: 6px; object-fit: contain; border: 1px solid var(--border); margin-bottom: 2px; }
.lg-loading-title { margin: 0; font-family: Oswald, sans-serif; font-size: 19px; font-weight: 600; color: var(--text); }
.lg-loading-sub { margin: 0; font-size: 13px; color: var(--text-soft); line-height: 1.55; }
.lg-loading-name { color: var(--primary); font-weight: 700; }
.lg-loading-bar { width: 180px; height: 4px; border-radius: 4px; overflow: hidden; background: var(--border); margin-top: 4px; }
.lg-loading-bar span { display: block; height: 100%; width: 40%; border-radius: 4px; background: var(--primary); animation: lgbar 1.1s var(--ease) infinite; }
@keyframes lgbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ── Responsive ── */
@media (max-width: 860px) {
  .lg-card { grid-template-columns: 1fr; }
  .lg-hero { min-height: 0; padding: 38px 30px; text-align: center; align-items: center; }
  .lg-intro { margin-left: auto; margin-right: auto; }
  .lg-hero-content { width: 100%; max-width: 420px; }
}
@media (max-width: 560px) {
  .login-body { padding: 0; }
  .lg-card { border-radius: 0; border: 0; min-height: 100vh; box-shadow: none; }
  .lg-hero { padding: 34px 22px; }
  .lg-info { padding: 26px 22px; }
  .lg-steps { grid-template-columns: 1fr; }
  .lg-step img { height: 190px; }
  .lg-join { flex-direction: column; align-items: stretch; text-align: center; }
  .lg-btn-join { width: 100%; }
  .lg-legal { padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { .lg-btn { transition: none; } }
