/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg       : #060d1e;
  --card     : #0c1326;
  --border   : #1e2a45;
  --accent   : #6c8aff;
  --accent-2 : #a78bfa;
  --text     : #e2e8f0;
  --muted    : #64748b;
  --error    : #f87171;
  --success  : #4ade80;
  --warn     : #facc15;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Fond animé ─── */
.liquid-bg {
  position: fixed; inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.liquid-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: blobFloat 12s ease-in-out infinite alternate;
}
.liquid-blob:nth-child(1) { width: 400px; height: 400px; background: #6c8aff; top: -100px; left: -100px; animation-delay: 0s; }
.liquid-blob:nth-child(2) { width: 300px; height: 300px; background: #a78bfa; bottom: -80px; right: -80px; animation-delay: 3s; }
.liquid-blob:nth-child(3) { width: 250px; height: 250px; background: #38bdf8; top: 40%; left: 60%; animation-delay: 6s; }
.liquid-blob:nth-child(4) { width: 200px; height: 200px; background: #f472b6; top: 60%; left: 10%; animation-delay: 9s; }
@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}

/* ─── Layout ─── */
.login-wrapper {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  padding: 20px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* ─── Header ─── */
.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo {
  height: 60px;
  margin-bottom: 12px;
}
.login-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.muted {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

/* ─── Champs ─── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input {
  width: 100%;
  background: #111827;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,138,255,.2);
}
.input.error { border-color: var(--error); }

/* ─── Mot de passe ─── */
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 44px; }
.toggle-pass {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 1rem;
  opacity: 0.5; transition: opacity .2s;
}
.toggle-pass:hover { opacity: 1; }

/* ─── Bouton ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity .2s, transform .1s;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
}
.btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; margin-top: 8px; }

/* ─── Spinner ─── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Message box ─── */
.msg-box {
  border-radius: 8px;
  padding: 0;
  font-size: 0.875rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s, padding .3s, margin .3s;
}
.msg-box.show {
  max-height: 80px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.msg-box.error   { background: rgba(248,113,113,.15); border: 1px solid var(--error);   color: var(--error); }
.msg-box.success { background: rgba(74,222,128,.15);  border: 1px solid var(--success); color: var(--success); }
.msg-box.warning { background: rgba(250,204,21,.15);  border: 1px solid var(--warn);    color: var(--warn); }

/* ─── Barre de tentatives ─── */
.attempts-bar {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.attempts-bar.show { display: flex; }
.attempts-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.attempts-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .4s, background .4s;
}
.attempts-text {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ─── Overlay lockout ─── */
.lockout-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(6,13,30,0.92);
  align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.lockout-overlay.show { display: flex; }
.lockout-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  text-align: center;
  max-width: 340px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lockout-icon { font-size: 3rem; margin-bottom: 12px; }
.lockout-card h2 { font-size: 1.1rem; margin-bottom: 8px; }
.lockout-timer {
  font-size: 2.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--error);
  margin: 16px 0;
}