:root {
  --brand:   #1E293B;
  --accent:  #184069;
  --bad:     #DC2626;
  --border:  #E2E8F0;
  --bg:      #F8FAFC;
  --surface: #FFFFFF;
  --text:    #0F172A;
  --muted:   #64748B;
  --radius:  10px;
  --shadow:  0 4px 24px rgba(0,0,0,.08);
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

/* INTRO + LOGO */

.intro-login-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 10vh auto 40px;
  padding: 0 20px;
}

.logo-top-left {
  position: absolute;
  left: -80px;
  top: 50%;
  transform: translateY(-50%);
}

.logo-top-left img {
  width: 100px;
  height: auto;
  display: block;
}

.intro-login-box {
  width: 100%;
  text-align: center;
  padding: 10px 0;
}

.intro-login-box h1 {
  margin: 0 0 15px;
  font-size: 1.6rem;
  color: #000;
  text-align: center;
}

/* CARTE */

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
}

.login-card__brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--brand);
}

.login-card__lead {
  font-size: .85rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* FORMULAIRE */

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .35rem;
}

.field input {
  width: 100%;
  padding: .6rem .85rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.field .code-input {
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: .3em;
}

/* ERREUR */

.error-msg {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 7px;
  color: var(--bad);
  font-size: .82rem;
  padding: .65rem .9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* BOUTON */

.btn-login {
  display: block;
  width: 100%;
  padding: .7rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
  margin-top: .5rem;
}

.btn-login:hover   { opacity: .9; }
.btn-login:active  { opacity: .8; }
.btn-login:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* 2FA : activation */

.steps {
  margin: 0 0 1rem 1.2rem;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--muted);
}

.steps li + li {
  margin-top: .35rem;
}

.qr {
  display: flex;
  justify-content: center;
  margin: 1rem 0 .75rem;
}

.qr svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  background: #fff;
}

.secret {
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 1.25rem;
}

.secret code {
  display: inline-block;
  margin-top: .25rem;
  padding: .3rem .5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: .8rem;
  letter-spacing: .08em;
}

/* 2FA : codes de secours */

.codes {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: 1rem;
}

.codes code {
  display: block;
  padding: .5rem;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: .85rem;
  letter-spacing: .05em;
}

/* FOOTER */

.login-card__footer {
  text-align: center;
  font-size: .75rem;
  color: var(--muted);
  margin-top: 1.5rem;
}

.login-card__footer a {
  color: var(--accent);
}

.login-copyright {
  margin-top: 1.2rem;
  font-size: 12px;
  color: #6B7280;
  text-align: center;
}

.login-copyright a {
  color: #2E75B6;
  text-decoration: none;
}

.login-copyright a:hover {
  text-decoration: underline;
}

/* MOBILE */

@media screen and (max-width: 900px) {
  .intro-login-container {
    margin-top: 30px;
    padding: 0 16px;
  }

  .logo-top-left {
    position: static;
    transform: none;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
  }

  .logo-top-left img {
    width: 80px;
  }

  .intro-login-box h1 {
    font-size: 1.4rem;
  }
}