/* ─────────────────────────────────────────────────────────────────────────────
   AUTH PAGES — Inspired by drive.centif.bf (Nextcloud theming)
   Primary: #00679e  |  Background: login-bg.png + dark overlay
   ───────────────────────────────────────────────────────────────────────────── */

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ── Fond plein écran ───────────────────────────────────────────────────────── */
.auth-bg {
  position: fixed;
  inset: 0;
  background: url('../img/login-bg.png') center / cover no-repeat;
  z-index: 0;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 40, 0.62);
  backdrop-filter: blur(1px);
  z-index: 1;
}

/* ── Colonne centrale ───────────────────────────────────────────────────────── */
.auth-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 0;
}


/* ── Carte auth ─────────────────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,.12);
  overflow: hidden;
  color: #222;
}

/* ── Carte : en-tête coloré ─────────────────────────────────────────────────── */
.auth-card-hd {
  background: #00679e;
  background: linear-gradient(135deg, #00679e 0%, #00507a 100%);
  color: #fff;
  padding: 1.65rem 2rem 1.45rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Filigrane bouclier */
.auth-card-hd::before {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -8%;
  width: 55%;
  aspect-ratio: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='M8 1a.5.5 0 0 1 .324.118l5.5 4.5A.5.5 0 0 1 14 6v3.5c0 2.707-1.773 4.655-3.41 5.794C9.775 16.048 8.86 16.5 8 16.5s-1.775-.452-2.59-1.206C3.773 14.155 2 12.207 2 9.5V6a.5.5 0 0 1 .176-.382l5.5-4.5A.5.5 0 0 1 8 1z'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: .07;
  pointer-events: none;
}

.auth-card-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto .35rem;
}
.auth-card-title { font-size: 1.1rem; font-weight: 700; margin: .55rem 0 0; letter-spacing: .3px; }
.auth-card-sub   { font-size: .78rem; opacity: .78; margin: .15rem 0 0; }

/* ── Carte : corps ──────────────────────────────────────────────────────────── */
.auth-card-bd { padding: 1.75rem 2rem; }

/* ── Formulaires ─────────────────────────────────────────────────────────────── */
.form-label {
  font-size: .84rem;
  font-weight: 600;
  color: #444;
  margin-bottom: .35rem;
}

.form-control {
  border: 1.5px solid #d0d7de;
  border-radius: 6px;
  font-size: .93rem;
  color: #222;
  background: #f8fafc;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  border-color: #00679e !important;
  box-shadow: 0 0 0 3px rgba(0, 103, 158, .12) !important;
  background: #fff;
  color: #222;
}

/* Champs avec icône intégrée */
.input-field {
  position: relative;
  display: flex;
  align-items: center;
  border: 1.5px solid #d0d7de;
  border-radius: 6px;
  background: #f8fafc;
  transition: border-color .15s, box-shadow .15s;
}
.input-field:focus-within {
  border-color: #00679e;
  box-shadow: 0 0 0 3px rgba(0, 103, 158, .12);
  background: #fff;
}
.input-field-icon {
  position: absolute;
  left: .75rem;
  color: #8a9ab0;
  pointer-events: none;
  font-size: .9rem;
}
.input-field .form-control {
  border: none !important;
  box-shadow: none !important;
  background: transparent;
  padding-left: 2.25rem;
  color: #222;
}
.input-field .form-control:focus {
  border: none !important;
  box-shadow: none !important;
  background: transparent;
  color: #222;
}
.pw-toggle {
  position: absolute;
  right: .5rem;
  background: none;
  border: none;
  color: #8a9ab0;
  padding: .2rem .3rem;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1;
}
.pw-toggle:hover { color: #00679e; }

/* ── Boutons ────────────────────────────────────────────────────────────────── */
.btn-primary {
  background-color: #00679e;
  border-color: #00679e;
  font-weight: 600;
  letter-spacing: .2px;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #00507a;
  border-color: #00507a;
}

.btn-outline-secondary {
  color: #4a6070;
  border-color: #c5d0da;
  font-weight: 500;
}
.btn-outline-secondary:hover {
  background-color: #eef4f8;
  border-color: #00679e;
  color: #00679e;
}

/* ── Notice gouvernementale ──────────────────────────────────────────────────── */
.gov-notice {
  background: #e8f4fb;
  border: 1px solid #b3d9ef;
  border-radius: 6px;
  padding: .6rem .9rem;
  font-size: .78rem;
  color: #005480;
}

/* ── Alertes dans la carte ───────────────────────────────────────────────────── */
.alert { font-size: .84rem; }
.alert-danger  { background: #fff0f0; border-color: #fcc; color: #a00; }
.alert-success { background: #f0faf0; border-color: #b8e0b8; color: #1a6e1a; }
.alert-warning { background: #fffbf0; border-color: #ffe0a0; color: #7a5500; }

/* ── OTP / MFA ───────────────────────────────────────────────────────────────── */
input[type='text'].otp-input {
  font-size: 1.8rem;
  letter-spacing: .5rem;
  text-align: center;
}

/* ── Utilitaires ─────────────────────────────────────────────────────────────── */
.auth-icon-large { font-size: 2.5rem; }
.auth-icon-lock  { color: #d00; }
.auth-icon-warn  { color: #b07800; }
.auth-body-text  { font-size: .88rem; color: #444; line-height: 1.6; }
.auth-small-link { font-size: .82rem; color: #6a8090; text-decoration: none; }
.auth-small-link:hover { color: #00679e; }

/* ── Pied de page ─────────────────────────────────────────────────────────────── */
.auth-footer {
  margin-top: 1.25rem;
  font-size: .72rem;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  line-height: 1.6;
}
.auth-footer strong { color: rgba(255, 255, 255, 0.7); }
.auth-footer a { color: rgba(255, 255, 255, 0.45); text-decoration: none; }
.auth-footer a:hover { color: #fff; }

/* ── Séparateur passkey ───────────────────────────────────────────────────────── */
.passkey-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
  color: #aab8c2;
  font-size: .8rem;
}
.passkey-divider::before,
.passkey-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d8e2e8;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { border-radius: 10px; }
  .auth-card-hd { padding: 1.35rem 1.4rem 1.2rem; }
  .auth-card-bd { padding: 1.4rem 1.4rem; }
  .auth-logo-img { height: 36px; }
  .auth-logo-name { font-size: 1.35rem; }
}
