:root {
  --bg: #1c1c1c;
  --input-bg: #191919;
  --border: #353535;
  --line: #4a4a4a;
  --muted: #555555;
  --text: #ffffff;
  --btn-bg: #cccccc;
  --btn-bg-hover: #dddddd;
  --btn-text: #0a0a0a;
  --radius: 11px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.login {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 17vh 24px 52px;
}

.login__logo {
  display: block;
  width: 240px;
  max-width: 70%;
  height: auto;
  margin-bottom: 98px;
}

.panel {
  width: 100%;
  max-width: 300px;
}

/* Titre avec lignes de part et d'autre */
.divider {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft, #dfe6ff);
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Champs */
.field {
  position: relative;
  margin-bottom: 15px;
  padding-top: 15px;
}

.field label {
  position: absolute;
  top: 0;
  left: 10px;
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 42px 0 13px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease;
}
.field input:hover { border-color: var(--border-hover, #444); }
.field input:focus-visible { border-color: var(--muted, #8a8a8a); }

/* Bouton œil */
.field__toggle {
  position: absolute;
  right: 6px;
  bottom: 4px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted, #6b6b6b);
  cursor: pointer;
}
.field__toggle:hover { color: var(--text, #aaa); }
.field__toggle:focus-visible { outline: 1px solid #8a8a8a; }
.field__toggle .slash { display: block; }
.field__toggle.is-visible .slash { display: none; }

/* Bouton principal */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin-top: 9px;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:focus-visible { outline: 2px solid var(--focus, #fff); outline-offset: 2px; }

/* Aide */
.help {
  margin: 15px 0 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}
.help a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}
.help a:hover { text-decoration: underline; }

/* Section invité */
.guest { margin-top: 24px; }
.guest .btn { margin-top: 0; }
.btn--link { text-decoration: none; }

@media (max-height: 680px) {
  .login { padding-top: 7vh; }
  .login__logo { margin-bottom: 54px; }
}

/* Message d'erreur */
.error {
  margin: 0 0 7px;
  text-align: center;
  font-size: 11px;
  color: #e5736b;
}
.error[hidden] { display: none; }

/* Connexion désactivée (en développement) */
.form.is-disabled { opacity: .45; cursor: not-allowed; }
.form.is-disabled .field,
.form.is-disabled .btn,
.form.is-disabled .help a { pointer-events: none; }
.form.is-disabled .btn { cursor: not-allowed; }

/* Popup bas à droite */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  padding: 12px 14px;
  background: var(--active, #262626);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast[hidden] { display: none; }
.toast.is-visible { opacity: 1; transform: none; }
.toast__close {
  flex: none;
  width: 24px;
  height: 24px;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted, #aaa);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.toast__close:hover { color: var(--text, #fff); }
.toast__close:focus-visible { outline: 1px solid #8a8a8a; }
@media (max-width: 480px) { .toast { left: 16px; right: 16px; max-width: none; } }

/* Animation du logo après « Guest login » */
.panel { transition: opacity .35s ease, transform .35s ease; }
.login.is-leaving .panel { opacity: 0; transform: translateY(10px); pointer-events: none; }
.login.is-leaving .login__logo { animation: logo-enter 15s cubic-bezier(.4, 0, .2, 1) forwards; }

@keyframes logo-enter {
  0%   { transform: scale(1);    filter: brightness(1);   opacity: 1; }
  35%  { transform: scale(1.12); filter: brightness(1.7); opacity: 1; }
  100% { transform: scale(1.35); filter: brightness(2);   opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
  .login.is-leaving .login__logo { animation: none; }
}
/* Logo clair : inversé sur les thèmes clairs pour rester lisible */
html[data-scheme="light"] .login__logo { filter: invert(1) brightness(.35); }
