html.desk-login-page,
html.desk-login-page body.desk-login-body {
  --auth-navy: #0b2a4a;
  --auth-blue: #1a5fb4;
  --auth-blue-deep: #0f3d75;
  --auth-gold: #c4a035;
  --auth-ink: #142033;
  --auth-muted: #5b6b7c;
  --auth-panel: rgba(255, 255, 255, 0.94);
  --auth-font: "Manrope", system-ui, sans-serif;
  --auth-display: "Fraunces", "Times New Roman", serif;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow: auto;
  font-family: var(--auth-font) !important;
  font-size: 15px !important;
  color: var(--auth-ink);
  background: var(--auth-navy) !important;
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: stretch;
  overflow: hidden;
}

.auth-hero {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.auth-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: scale(1.04);
  animation: auth-ken 18s ease-out forwards;
}

.auth-hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(8, 24, 44, 0.88) 0%, rgba(8, 24, 44, 0.72) 42%, rgba(8, 24, 44, 0.35) 100%),
    linear-gradient(180deg, rgba(8, 24, 44, 0.15) 0%, rgba(8, 24, 44, 0.55) 100%);
}

.auth-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  grid-template-rows: 1fr auto;
  gap: 28px 48px;
  align-items: end;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px);
  padding-bottom: 28px;
  box-sizing: border-box;
  min-height: 100dvh;
}

.auth-brand {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  max-width: 34rem;
  color: #fff;
  animation: auth-rise 0.7s ease-out both;
}

.auth-crest {
  width: clamp(88px, 12vw, 128px);
  height: auto;
  border-radius: 14px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  margin-bottom: 22px;
}

.auth-kicker {
  margin: 0 0 8px !important;
  font-size: 0.78rem !important;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 236, 180, 0.92) !important;
}

.auth-title {
  margin: 0 !important;
  font-family: var(--auth-display) !important;
  font-size: clamp(2.4rem, 5.2vw, 4.1rem) !important;
  font-weight: 700 !important;
  line-height: 1.02 !important;
  letter-spacing: -0.02em;
  color: #fff !important;
  text-wrap: balance;
}

.auth-lead {
  margin: 14px 0 0 !important;
  max-width: 28rem;
  font-size: 1.05rem !important;
  font-weight: 500;
  line-height: 1.45 !important;
  color: rgba(236, 243, 252, 0.88) !important;
}

.auth-panel {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  width: 100%;
  padding: 28px 26px 24px;
  border-radius: 18px;
  background: var(--auth-panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: auth-rise 0.75s ease-out 0.12s both;
}

.auth-panel-title {
  margin: 0 0 4px !important;
  font-family: var(--auth-display) !important;
  font-size: 1.45rem !important;
  font-weight: 700 !important;
  color: var(--auth-navy) !important;
  line-height: 1.2 !important;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-label {
  margin: 0 !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  color: var(--auth-ink) !important;
}

.auth-input {
  width: 100%;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 14px !important;
  border: 1.5px solid #c8d3e0 !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--auth-ink) !important;
  font-size: 0.98rem !important;
  font-family: var(--auth-font) !important;
  font-weight: 500;
  line-height: 1.3 !important;
  box-shadow: none !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-input::placeholder {
  color: #8a99ab;
  font-weight: 500;
}

.auth-input:focus {
  border-color: var(--auth-blue) !important;
  outline: none !important;
  box-shadow: 0 0 0 4px rgba(26, 95, 180, 0.18) !important;
}

.auth-password-wrap {
  position: relative;
  display: block;
}

.auth-password-wrap .auth-input {
  padding-right: 44px !important;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6a7a8c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.auth-password-toggle:hover {
  color: var(--auth-navy);
  background: rgba(11, 42, 74, 0.06);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--auth-blue);
  outline-offset: 1px;
}

.auth-error {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9b1c1c;
}

.auth-alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-alert ul {
  margin: 0;
  padding-left: 16px;
}

.auth-alert-error {
  border: 1px solid #e3a39a;
  background: #fdeceb;
  color: #7a1f16;
}

.auth-alert-ok {
  border: 1px solid #8fc9a4;
  background: #e8f7ee;
  color: #0f5a2f;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 6px;
}

.auth-link {
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  color: var(--auth-blue-deep) !important;
  text-decoration: none !important;
}

.auth-link:hover {
  color: var(--auth-navy) !important;
  text-decoration: underline !important;
}

.auth-submit {
  appearance: none;
  border: 0;
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1f6fd0 0%, var(--auth-blue-deep) 100%);
  color: #fff !important;
  font-family: var(--auth-font);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15, 61, 117, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 26px rgba(15, 61, 117, 0.34);
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-submit-arrow {
  display: inline-block;
  transition: transform 0.18s ease;
}

.auth-submit:hover .auth-submit-arrow {
  transform: translateX(3px);
}

.auth-submit-secondary {
  width: 100%;
  justify-content: center;
  background: linear-gradient(180deg, #2f7fd8 0%, #164a86 100%);
  margin-top: 4px;
}

.auth-form-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-hint {
  margin: 0 !important;
  font-size: 0.82rem !important;
  font-weight: 700;
  color: var(--auth-muted) !important;
  letter-spacing: 0.01em;
}

.auth-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #d5deea, transparent);
  margin: 4px 0;
}

.auth-foot {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  color: rgba(232, 240, 250, 0.72);
  font-size: 0.78rem;
  font-weight: 600;
  animation: auth-rise 0.8s ease-out 0.22s both;
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auth-ken {
  from { transform: scale(1.04); }
  to { transform: scale(1.1); }
}

@media (max-width: 900px) {
  .auth-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    align-items: start;
    gap: 22px;
    padding-top: max(28px, env(safe-area-inset-top, 0px));
  }

  .auth-brand,
  .auth-panel,
  .auth-foot {
    grid-column: 1;
  }

  .auth-brand {
    grid-row: 1;
    align-self: start;
    text-align: center;
    max-width: none;
  }

  .auth-crest {
    margin-left: auto;
    margin-right: auto;
  }

  .auth-lead {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .auth-panel {
    grid-row: 2;
    align-self: start;
  }

  .auth-foot {
    grid-row: 3;
    flex-direction: column;
    text-align: center;
  }

  .auth-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .auth-submit {
    width: 100%;
    justify-content: center;
  }

  .auth-link {
    text-align: center;
  }
}

/* Compat anciennes classes (si un écran legacy reste) */
.desk-login-shell { min-height: 100dvh; }
.desk-login-error { color: #9b1c1c; font-weight: 600; font-size: 0.82rem; }

/* ---- Reset password : hauteur compacte ---- */
.auth-shell--reset {
  overflow: auto;
}

.auth-stage--reset {
  align-items: center;
  grid-template-rows: auto auto;
  gap: 16px 40px;
  padding: clamp(16px, 3vw, 28px);
  min-height: 100dvh;
}

.auth-brand--compact {
  display: flex;
  align-items: center;
  gap: 14px;
  align-self: center;
  max-width: none;
}

.auth-brand--compact .auth-crest {
  width: 64px;
  margin: 0;
  border-radius: 10px;
  flex-shrink: 0;
}

.auth-brand--compact .auth-kicker {
  margin: 0 0 2px !important;
  font-size: 0.68rem !important;
}

.auth-brand--compact .auth-title {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem) !important;
  line-height: 1.1 !important;
}

.auth-brand--compact .auth-lead {
  margin: 4px 0 0 !important;
  font-size: 0.88rem !important;
}

.auth-panel--reset {
  align-self: center;
  gap: 10px;
  padding: 18px 18px 16px;
  max-height: min(92dvh, 640px);
  overflow: auto;
}

.auth-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-panel--reset .auth-panel-title {
  margin: 0 !important;
  font-size: 1.2rem !important;
}

.auth-panel--reset .auth-input {
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 10px !important;
  font-size: 0.92rem !important;
}

.auth-panel--reset .auth-label {
  font-size: 0.72rem !important;
}

.auth-panel--reset .auth-field {
  gap: 4px;
}

.auth-panel--reset .auth-form-block {
  gap: 10px;
}

.auth-panel--reset .auth-divider {
  margin: 2px 0;
}

.auth-panel--reset .auth-alert {
  padding: 8px 10px;
  font-size: 0.8rem;
}

.auth-row-send {
  display: flex;
  align-items: end;
  gap: 8px;
}

.auth-field--grow {
  flex: 1;
  min-width: 0;
}

.auth-submit--send {
  width: auto;
  height: 38px;
  padding: 0 12px;
  margin: 0;
  font-size: 0.82rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-submit--full {
  width: 100%;
  justify-content: center;
  height: 40px;
}

.auth-stage--reset .auth-foot {
  padding-top: 0;
}

@media (max-width: 900px) {
  .auth-stage--reset {
    gap: 14px;
    padding: 14px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .auth-brand--compact {
    flex-direction: column;
    text-align: center;
  }

  .auth-panel--reset {
    max-height: none;
  }

  .auth-row-send {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-submit--send {
    width: 100%;
    justify-content: center;
  }

  .auth-grid-2 {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .auth-panel-head .auth-link {
    text-align: right;
  }
}

@media (max-width: 520px) {
  .auth-grid-2 {
    grid-template-columns: 1fr;
  }
}
