/* Page de connexion : noir, halo d'accent, serif fin, bouton pilule. Les couleurs d'accent viennent de /brand.css
   (--accent, --accent-2, --accent-mid, --accent-rgb, --sun), réglables dans ⚙ Paramètres → Identité. */
:root {
  --ink: #fff; --ink-2: rgba(255, 255, 255, .72); --muted: rgba(255, 255, 255, .5);
  --accent: #2a78d6; --accent-2: #9ccafc; --accent-mid: #63a1e9; --accent-rgb: 42, 120, 214;
  --sun: linear-gradient(90deg, var(--accent-2) 0%, var(--accent-mid) 45%, var(--accent) 100%);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }       /* l'attribut hidden l'emporte toujours sur les styles */
/* Fond : noir avec un halo fixe dans la couleur d'accent (pas d'animation, s'adapte à toute taille d'écran). */
html, body { margin: 0; min-height: 100%; background: #000; color: var(--ink); }
body { background: radial-gradient(ellipse 70% 55% at 50% 38%, rgba(var(--accent-rgb), .22), rgba(var(--accent-rgb), .06) 55%, #000 100%) fixed; }
body { font: 16px/1.5 "Instrument Sans", system-ui, "Segoe UI", sans-serif; min-height: 100vh; display: flex; flex-direction: column; }

.center { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.1em; padding: 48px 16px; text-align: center; animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.logo { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 10px 50px rgba(var(--accent-rgb), .45); }
h1 { font-family: "Fraunces", "Times New Roman", serif; font-weight: 300; font-size: clamp(44px, 7vw, 72px); line-height: 1; letter-spacing: -.01em; margin: .1em 0 .3em; }

.panel { width: min(340px, 100%); display: flex; flex-direction: column; gap: .75em; }
.panel input { font: inherit; font-size: 16px; color: var(--ink); background: rgba(0, 0, 0, .55); border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px; padding: .85em 1.3em; outline: none; text-align: center; backdrop-filter: blur(8px); transition: border-color .15s, background .15s; }
.panel input::placeholder { color: var(--muted); }
.panel input:focus { border-color: var(--accent-mid); background: rgba(var(--accent-rgb), .1); }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; padding-left: 3em; padding-right: 3em; }
.pw-eye { position: absolute; right: .55em; top: 50%; transform: translateY(-50%); width: 2.2em; height: 2.2em; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: color .15s, background .15s; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--accent-2); background: rgba(255,255,255,.08); outline: none; }
.pw-eye svg { width: 1.2em; height: 1.2em; }
.rules { list-style: none; margin: -.2em 0 .1em; padding: 0; display: flex; gap: .4em 1em; justify-content: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.rules li::before { content: "○ "; }
.rules li.ok { color: #7fd67f; }
.rules li.ok::before { content: "✓ "; }
.match { margin: -.2em 0 0; min-height: 1.2em; font-size: 13px; }
.match.ok { color: #7fd67f; }
.match.ko { color: #f08a8a; }
.note { margin: 0 0 .2em; color: var(--ink-2); font-size: 14px; }
.hint { margin: -.2em 0 0; color: var(--muted); font-size: 12.5px; }

.btn-sun { font: inherit; font-weight: 600; font-size: 16px; color: #111; background: var(--sun); border: 0; border-radius: 999px; padding: .9em 1.4em;
  cursor: pointer; margin-top: .2em; box-shadow: 0 10px 40px rgba(var(--accent-rgb), .35); transition: transform .2s, box-shadow .2s; }
.btn-sun:hover { transform: translateY(-2px); box-shadow: 0 14px 50px rgba(var(--accent-rgb), .5); }
.btn-sun:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-line { width: min(340px, 100%); display: inline-flex; align-items: center; justify-content: center; gap: .6em; font-weight: 600; color: var(--ink);
  text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent-2) 50%, transparent); border-radius: 999px; padding: .85em 1.4em; background: rgba(0,0,0,.45);
  backdrop-filter: blur(8px); transition: background .15s, border-color .15s; }
.btn-line:hover { background: rgba(var(--accent-rgb), .18); border-color: var(--accent-mid); }
.btn-line svg { width: 1.2em; height: 1.2em; }

.remember { display: inline-flex; align-items: center; gap: .6em; color: var(--ink-2); font-size: 14px; cursor: pointer; user-select: none; }
.remember input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.remember .box { width: 1.15em; height: 1.15em; border-radius: 5px; border: 1.5px solid color-mix(in srgb, var(--accent-2) 55%, transparent); background: rgba(0,0,0,.5);
  display: grid; place-items: center; transition: background .15s, border-color .15s; }
.remember input:checked + .box { background: var(--sun); border-color: transparent; }
.remember input:checked + .box::after { content: "✓"; color: #111; font-size: .8em; font-weight: 800; }
.remember input:focus-visible + .box { outline: 2px solid var(--accent-mid); outline-offset: 2px; }
.or { width: min(340px, 100%); display: flex; align-items: center; gap: 1em; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.18); }

.message { width: min(380px, 100%); padding: .8em 1.1em; border-radius: 14px; font-size: 14px; line-height: 1.45;
  background: rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(8px); }
.message.warn { border-color: rgba(var(--accent-rgb), .6); background: rgba(var(--accent-rgb), .14); }
.message.err { border-color: rgba(230, 103, 103, .6); background: rgba(208, 59, 59, .16); }
.message b { color: #fff; }

.bottom { position: relative; z-index: 1; text-align: center; padding: 20px 16px 22px; color: var(--muted); font-size: 12px; letter-spacing: .3em; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .center { animation: none; } }
.forgot { background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; padding: .2em; justify-self: center; align-self: center; text-decoration: underline; text-underline-offset: 3px; opacity: .8; }
.forgot:hover, .forgot:focus-visible { opacity: 1; color: var(--accent-2); }
.forgot-note { font-size: 13px; line-height: 1.5; margin: 0; }

/* Assistant de premier lancement */
.wizard { width: min(560px, 100%); text-align: left; }
.wizard .steps { display: flex; gap: .4em; justify-content: center; margin: 0 0 1.2em; padding: 0; list-style: none; font-size: 12px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; flex-wrap: wrap; }
.wizard .steps li { padding: .3em .7em; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); }
.wizard .steps li.on { color: #111; background: var(--sun); border-color: transparent; font-weight: 600; }
.wizard .steps li.done { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 50%, transparent); }
.wizard h2 { font-family: "Fraunces", serif; font-weight: 300; font-size: 30px; margin: 0 0 .3em; letter-spacing: -.01em; }
.wizard p { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; margin: 0 0 1em; }
.wizard a { color: var(--accent-2); }
.wizard .panel { width: 100%; }
.wizard .panel input, .wizard .panel select { text-align: left; border-radius: 12px; padding: .75em 1em; }
.wizard .panel select { font: inherit; font-size: 16px; color: var(--ink); background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.22); outline: none; }
.wizard .panel select option { background: #111; }
.wizard label.f { display: flex; flex-direction: column; gap: .35em; font-size: 13.5px; color: var(--ink-2); }
.wizard label.f small { color: var(--muted); }
.wizard .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75em; }
@media (max-width: 560px) { .wizard .grid2 { grid-template-columns: 1fr; } }
.wizard .choice { display: flex; flex-direction: column; gap: .5em; max-height: 40vh; overflow: auto; padding-right: .3em; }
.wizard .choice label { display: flex; align-items: center; gap: .8em; padding: .7em 1em; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.45); cursor: pointer; font-size: 14.5px; }
.wizard .choice label:hover { border-color: var(--accent-mid); }
.wizard .choice label.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .14); }
.wizard .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wizard .choice .box { width: 1.15em; height: 1.15em; border-radius: 5px; border: 1.5px solid color-mix(in srgb, var(--accent-2) 55%, transparent); display: grid; place-items: center; flex: none; }
.wizard .choice label.on .box { background: var(--sun); border-color: transparent; }
.wizard .choice label.on .box::after { content: "✓"; color: #111; font-size: .8em; font-weight: 800; }
.wizard .choice img { width: 28px; height: 28px; border-radius: 50%; }
.wizard .choice .meta { color: var(--muted); font-size: 12.5px; margin-left: auto; white-space: nowrap; }
.wizard .who { display: flex; align-items: center; gap: .8em; padding: .7em 1em; border-radius: 12px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.14); font-size: 14.5px; }
.wizard .who img { width: 36px; height: 36px; border-radius: 50%; }
.wizard .scopes { display: flex; gap: .4em; flex-wrap: wrap; }
.wizard .scopes span { font-size: 12px; padding: .15em .6em; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); color: var(--ink-2); }
.wizard .scopes span.ok { border-color: rgba(127,214,127,.6); color: #7fd67f; }
.wizard .scopes span.ko { border-color: rgba(240,138,138,.6); color: #f08a8a; }
.wizard .nav { display: flex; gap: .8em; justify-content: space-between; margin-top: 1.2em; }
.wizard .btn-ghost { font: inherit; font-size: 15px; color: var(--ink-2); background: none; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: .8em 1.3em; cursor: pointer; }
.wizard .btn-ghost:hover { color: var(--ink); border-color: var(--accent-mid); }
.wizard .btn-sun { margin-top: 0; }
.wizard .hint { margin: .2em 0 0; }
.wizard table.map { width: 100%; border-collapse: collapse; font-size: 14px; }
.wizard table.map td { padding: .3em .3em; }
.wizard table.map td:first-child { color: var(--ink-2); white-space: nowrap; width: 38%; }
.wizard table.map select { width: 100%; padding: .45em .7em; font-size: 14px; }
.wizard .swatch { display: inline-flex; gap: .5em; align-items: center; }
.wizard input[type=color] { width: 44px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; }
.wizard .logo-pick { display: flex; gap: .7em; align-items: center; flex-wrap: wrap; }
.wizard .logo-pick img { width: 44px; height: 44px; border-radius: 11px; }
.wizard .toggle { display: inline-flex; align-items: center; gap: .6em; cursor: pointer; font-size: 14.5px; color: var(--ink-2); }
.wizard .toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wizard .toggle .sw { width: 2.4em; height: 1.35em; border-radius: 999px; background: rgba(255,255,255,.2); position: relative; transition: background .15s; }
.wizard .toggle .sw::after { content: ""; position: absolute; top: .15em; left: .15em; width: 1.05em; height: 1.05em; border-radius: 50%; background: #fff; transition: transform .15s; }
.wizard .toggle input:checked + .sw { background: var(--accent); }
.wizard .toggle input:checked + .sw::after { transform: translateX(1.05em); }
.wizard .summary { display: grid; grid-template-columns: auto 1fr; gap: .3em 1em; font-size: 14px; }
.wizard .summary dt { color: var(--muted); }
.wizard .summary dd { margin: 0; }

/* Toast (déconnexion) */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 5; padding: .8em 1.3em; border-radius: 999px; font-size: 14.5px;
  background: rgba(20,20,20,.92); border: 1px solid rgba(var(--accent-rgb), .5); box-shadow: 0 10px 40px rgba(0,0,0,.5); color: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Les deux modes actifs : GitHub mis en avant, mot de passe à la demande. */
.btn-line.primary { background: var(--sun); color: #111; border-color: transparent; box-shadow: 0 10px 40px rgba(var(--accent-rgb), .35); }
.btn-line.primary:hover { background: var(--sun); border-color: transparent; transform: translateY(-2px); box-shadow: 0 14px 50px rgba(var(--accent-rgb), .5); }
.alt-login { margin-top: .4em; }
