/* Écran de connexion — charte Batiprisme (contrat .bp-login__*).
   Adaptation Intus (Django / Tailwind) de la spec Angular « LOGIN.md ».
   Deux jetons d'accent posés ici pour Intus :
     --bp-app-accent          → panneau blanc (bouton, focus, liens)
     --bp-app-accent-on-dark  → panneau navy (logo, stats, fondu, barre mobile) */
:root {
  --bp-app-accent: #3b5bdb;         /* = --bp-intus  (clair) */
  --bp-app-accent-on-dark: #70a3f3; /* = --bp-intus-d (éclairci) */
  --bp-login-ink: #0f172a;
  --bp-login-navy-1: #0e1729;
  --bp-login-navy-2: #101d36;
  --bp-login-panel-text: #eef2ff;
}

.bp-login {
  display: flex;
  min-height: 100dvh;
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--bp-login-ink);
}

/* ============================ Panneau marque (gauche) ============================ */
.bp-login__aside {
  position: relative;
  flex: 0 0 46%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
  background:
    radial-gradient(60% 42% at 88% 10%, rgba(112, 163, 243, 0.20), transparent 70%),
    radial-gradient(55% 45% at 4% 96%, rgba(112, 163, 243, 0.16), transparent 70%),
    linear-gradient(158deg, var(--bp-login-navy-1) 0%, var(--bp-login-navy-2) 58%, #17284c 100%);
}
/* Cercles décoratifs tone-on-tone */
.bp-login__aside::before,
.bp-login__aside::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.bp-login__aside::before {
  width: 340px;
  height: 340px;
  top: -90px;
  right: -60px;
  background: rgba(255, 255, 255, 0.03);
}
.bp-login__aside::after {
  width: 440px;
  height: 440px;
  bottom: -160px;
  left: -130px;
  background: rgba(112, 163, 243, 0.06);
}

/* Vague blanche qui raccorde au panneau formulaire (desktop) */
.bp-login__wave {
  position: absolute;
  top: -1px;
  right: -1px;
  height: calc(100% + 2px);
  width: 88px;
  display: block;
}

.bp-login__brand {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;
  text-align: center;
}
.bp-login__logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bp-app-accent-on-dark);
  color: var(--bp-login-ink);
  font-weight: 800;
  font-size: 38px;
  letter-spacing: -0.04em;
  line-height: 1;
  box-shadow: 0 18px 40px -14px rgba(112, 163, 243, 0.55);
}
.bp-login__eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(238, 242, 255, 0.55);
}
.bp-login__title {
  margin-top: 4px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}
.bp-login__desc {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(238, 242, 255, 0.62);
}

.bp-login__stats {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bp-login__stat {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.bp-login__stat-value {
  min-width: 54px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bp-app-accent-on-dark);
}
.bp-login__stat-label {
  font-size: 12.5px;
  line-height: 1.35;
  color: rgba(238, 242, 255, 0.62);
}

/* ============================ Panneau formulaire (droite) ============================ */
.bp-login__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: #fff;
}
.bp-login__card {
  width: 100%;
  max-width: 400px;
}
.bp-login__header {
  text-align: center;
  margin-bottom: 26px;
}
.bp-login__form-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bp-login-ink);
}
.bp-login__form-sub {
  margin-top: 6px;
  font-size: 13.5px;
  color: #64748b;
}

.bp-login__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.bp-login__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.bp-login__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}
.bp-login__input-wrap {
  position: relative;
}
.bp-login__input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--bp-login-ink);
  background: #eef1f8;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.bp-login__input::placeholder {
  color: #94a3b8;
}
.bp-login__input:focus {
  outline: none;
  background: #fff;
  border-color: var(--bp-app-accent);
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.22);
}
.bp-login__input--icon-right {
  padding-right: 44px;
}
.bp-login__input.has-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.bp-login__input-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 8px;
}
.bp-login__input-toggle:hover {
  color: #475569;
  background: #e2e8f0;
}
.bp-login__input-toggle svg {
  width: 18px;
  height: 18px;
}
.bp-login__error {
  font-size: 12px;
  color: #dc2626;
}
.bp-login__field-link {
  text-align: right;
}

.bp-login__alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
}
.bp-login__alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.bp-login__alert svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.bp-login__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: var(--bp-app-accent);
  border: none;
  border-radius: 10px;
  box-shadow: 0 12px 26px -12px rgba(59, 91, 219, 0.7);
  transition: filter 0.15s, transform 0.05s;
}
.bp-login__submit:hover {
  filter: brightness(1.06);
}
.bp-login__submit:active {
  transform: translateY(1px);
}
.bp-login__submit svg {
  width: 16px;
  height: 16px;
}

.bp-login__link {
  color: var(--bp-app-accent);
  font-weight: 600;
  text-decoration: none;
}
.bp-login__link:hover {
  text-decoration: underline;
}
.bp-login__hint {
  margin-top: 22px;
  text-align: center;
  font-size: 12.5px;
  color: #94a3b8;
}

/* ============================ Barre mobile (≤ 768px) ============================ */
.bp-login__mobile-header {
  display: none;
}
@media (max-width: 768px) {
  .bp-login {
    flex-direction: column;
  }
  .bp-login__aside {
    display: none;
  }
  .bp-login__mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: linear-gradient(120deg, var(--bp-login-navy-1), #17284c);
  }
  .bp-login__mobile-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bp-app-accent-on-dark);
    color: var(--bp-login-ink);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.04em;
  }
  .bp-login__mobile-name {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
  }
  .bp-login__main {
    flex: 1;
    padding: 32px 22px;
  }
}
