/* =====================================================================
   EasyTaxe — Page de connexion
   ---------------------------------------------------------------------
   Deux panneaux : à gauche la marque (dégradé bleu institutionnel, même
   teintes que l'en-tête de l'application), à droite le formulaire sur
   fond clair. Les surcharges du thème sombre vivent dans theme-dark.css,
   chargé APRÈS ce fichier.
   ===================================================================== */

:root {
  --lg-navy: #0b3d91;
  --lg-navy-2: #1565c0;
  --lg-orange: #e8792a;
  --lg-text: #182652;
  --lg-text-2: #4d5670;
  --lg-text-3: #8592ab;
  --lg-border: #e0e6f0;
}

html,
body.login-body {
  height: 100%;
}

body.login-body {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  background: #eef2f9;
  font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", Roboto, -apple-system,
    BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.006em;
  color: var(--lg-text);
}

/* Halo diffus derrière la carte : de la profondeur sans image à charger. */
body.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 420px at 12% 18%, rgba(21, 101, 192, 0.16), transparent 62%),
    radial-gradient(720px 380px at 88% 82%, rgba(232, 121, 42, 0.12), transparent 60%);
  pointer-events: none;
}

/* ---------------------------------------------------------------- carte */

.login-wrapper {
  position: relative;
  width: 100%;
  max-width: 1020px;
  display: flex;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 70px rgba(11, 33, 82, 0.22), 0 2px 6px rgba(11, 33, 82, 0.08);
}

/* ------------------------------------------------------- panneau marque */

.login-brand {
  position: relative;
  flex: 0 0 44%;
  padding: 44px 40px;
  color: #fff;
  background: linear-gradient(150deg, #0b3d91 0%, #1565c0 58%, #1e88e5 100%);
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow: hidden;
}

/* Trame légère estompée : évite l'aplat d'un dégradé nu. */
.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(120% 90% at 20% 10%, #000 35%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 20% 10%, #000 35%, transparent 78%);
  pointer-events: none;
}

.login-brand > * {
  position: relative;
}

.login-brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 13px;
  background: #fff;
  color: var(--lg-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 6px 18px rgba(4, 20, 54, 0.32);
}

.login-wordmark {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.1;
}

.login-wordmark span {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
  margin-top: 3px;
}

/* Plaque blanche qui accueille le logo fourni (fond clair) sur le panneau bleu. */
.login-logo-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 10px 28px rgba(4, 20, 54, 0.28);
  width: fit-content;
  max-width: 100%;
}

.login-logo-card img {
  display: block;
  width: 100%;
  max-width: 330px;
  height: auto;
}

.login-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-brand h1 {
  font-size: 1.72rem;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.5px;
  margin: 0;
}

.login-brand h1 em {
  font-style: normal;
  color: #ffd7b3;
}

.login-brand-lead {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  max-width: 34ch;
}

.login-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.login-points li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 12.75px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.login-points .ico {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.login-points b {
  display: block;
  font-weight: 700;
  color: #fff;
}

.login-brand-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 16px;
}

/* ---------------------------------------------------- panneau formulaire */

.login-card {
  flex: 1 1 56%;
  padding: 44px 46px;
  display: flex;
  flex-direction: column;
}

.login-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.login-card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--lg-text);
  margin: 0 0 4px;
}

.login-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--lg-text-2);
}

.btn-login-theme {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--lg-border);
  background: #fff;
  color: var(--lg-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-login-theme:hover {
  background: #f3f6fc;
  color: var(--lg-text);
}

.btn-login-theme .icon-sun {
  display: none;
}

/* Le formulaire occupe la hauteur restante et se centre verticalement : sans cela,
   le panneau de marque (plus haut) laissait un grand vide sous le bouton. */
.login-card form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-field {
  margin-bottom: 15px;
}

.login-card .form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lg-text-3);
  margin-bottom: 6px;
}

/* Champ avec icône à gauche (et bouton œil à droite pour le mot de passe). */
.login-input {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input > .ico {
  position: absolute;
  left: 13px;
  display: flex;
  color: var(--lg-text-3);
  pointer-events: none;
}

.login-card .form-control {
  height: 46px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--lg-border);
  border-radius: 11px;
  font-size: 14px;
  background: #fbfcfe;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-card .form-control:focus {
  background: #fff;
  border-color: var(--lg-navy-2);
  box-shadow: 0 0 0 3.5px rgba(21, 101, 192, 0.14);
}

.login-card .form-control::placeholder {
  color: #a9b3c7;
}

.login-input:focus-within > .ico {
  color: var(--lg-navy-2);
}

.btn-reveal {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--lg-text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-reveal:hover {
  background: #f0f4fa;
  color: var(--lg-text);
}

.btn-reveal .icon-eye-off {
  display: none;
}

.btn-reveal.revealed .icon-eye {
  display: none;
}

.btn-reveal.revealed .icon-eye-off {
  display: block;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 20px;
}

.login-card .form-check {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-card .form-check-input {
  margin: 0;
  width: 17px;
  height: 17px;
  border-color: #c9d3e4;
  cursor: pointer;
}

.login-card .form-check-input:checked {
  background-color: var(--lg-navy);
  border-color: var(--lg-navy);
}

.login-card .form-check-label {
  font-size: 12.75px;
  color: var(--lg-text-2);
  cursor: pointer;
}

.login-help {
  font-size: 12px;
  color: var(--lg-text-3);
}

.btn-login {
  height: 48px;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b3d91 0%, #1565c0 100%);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(11, 61, 145, 0.28);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-login:hover {
  filter: brightness(1.06);
  box-shadow: 0 13px 28px rgba(11, 61, 145, 0.34);
}

.btn-login:active {
  transform: translateY(1px);
  box-shadow: 0 6px 16px rgba(11, 61, 145, 0.26);
}

.btn-login[disabled] {
  filter: grayscale(0.15) brightness(0.96);
  cursor: progress;
  box-shadow: none;
}

.btn-login .spin {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
}

.btn-login.loading .spin {
  display: block;
}

.btn-login.loading .arrow {
  display: none;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Bandeau d'erreur (identifiants refusés, champ manquant). */
.login-card .alert {
  border-radius: 11px;
  border: 1px solid #f4cfcd;
  background: #fdeceb;
  color: #b83a34;
  font-size: 12.75px;
  font-weight: 600;
  padding: 11px 13px;
  margin-bottom: 18px;
}

.login-card .text-danger {
  display: block;
  margin-top: 5px;
  font-size: 11.75px;
  font-weight: 600;
}

.login-foot {
  margin-top: auto;
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.25px;
  color: var(--lg-text-3);
  border-top: 1px solid #f1f4f9;
}

.login-foot .secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .login-wrapper {
    flex-direction: column;
    max-width: 520px;
  }

  .login-brand {
    flex: none;
    padding: 30px 30px 26px;
    gap: 18px;
  }

  /* Sur mobile on garde l'identité et la promesse, on retire le détail. */
  .login-points,
  .login-brand-foot {
    display: none;
  }

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

  .login-card {
    padding: 30px 28px 26px;
  }

  /* « Rester connecté » et l'aide passent l'un sous l'autre : côte à côte, ils se
     coupaient en deux lignes chacun sur un écran étroit. */
  .login-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
  }

  .login-card .form-check-label {
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  body.login-body {
    padding: 0;
    align-items: stretch;
  }

  .login-wrapper {
    border-radius: 0;
    box-shadow: none;
    min-height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-login,
  .btn-login-theme,
  .login-card .form-control {
    transition: none;
  }

  .btn-login .spin {
    animation: none;
  }
}
