/* =========================================================
   LUMALIA — auth.css (connexion / inscription / 2FA)
   ========================================================= */

.auth {
  padding: 4rem 0 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--navbar-height));
}

.auth__card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}
.auth__card--wide {
  max-width: 520px;
}

.auth__header {
  margin-bottom: 2rem;
  text-align: center;
}
.auth__header .label {
  display: block;
  margin-bottom: 0.5rem;
}
.auth__header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}
.auth__header p {
  font-size: 0.95rem;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.auth__field label {
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}
.auth__field input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.auth__field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth__field input::placeholder {
  color: var(--text-muted);
}

.auth__error {
  font-size: 0.8rem;
  color: var(--danger);
  min-height: 1em;
}

.auth__submit {
  width: 100%;
  margin-top: 0.5rem;
}
.auth__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth__status {
  font-size: 0.9rem;
  text-align: center;
  min-height: 1.2em;
}
.auth__status--info { color: var(--text-soft); }
.auth__status--success { color: var(--success); }
.auth__status--error { color: var(--danger); }

.auth__footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.auth__footer a {
  color: var(--accent);
  font-weight: 500;
}

/* --- QR Code & secret manuel --- */
.auth__qrcode {
  display: flex;
  justify-content: center;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.auth__qrcode img {
  width: 240px;
  height: 240px;
}

.auth__manual {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth__manual p {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.auth__secret {
  display: inline-block;
  font-family: "Geist Mono", monospace;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  padding: 0.6rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  word-break: break-all;
  margin-bottom: 0.5rem;
}

.auth__step { width: 100%; }

@media (max-width: 640px) {
  .auth { padding: 2rem 0 4rem; }
  .auth__card { padding: 1.75rem; }
}

/* --- Conteneur du QR code (qrcodejs) --- */
.auth__qrcode-canvas {
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth__qrcode-canvas img,
.auth__qrcode-canvas canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Case à cocher "Rester connecté" */
.auth__checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
  margin-bottom: 0.5rem;
}
.auth__checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: background var(--t-fast), border-color var(--t-fast);
  flex-shrink: 0;
}
.auth__checkbox input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.auth__checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
