/* ==========================================================
   Client — page connexion (index.php) uniquement
   ========================================================== */

html:has(.login-shell) {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
body.login-shell {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}
.login-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.login-shell-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #002e33;
  padding: 1.125rem 2.5rem;
  flex-shrink: 0;
}
@media (min-width: 900px) {
  .login-shell-header {
    padding: 0.625rem 1.5rem;
  }
}
.login-shell-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}
.login-shell-brand:focus-visible {
  outline: 2px solid var(--c-secondary);
  outline-offset: 4px;
  border-radius: 4px;
}
.login-shell-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
@media (min-width: 900px) {
  .login-shell-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}
.login-shell-visual {
  display: none;
  min-height: 0;
  background: var(--c-gray-100);
}
@media (min-width: 900px) {
  .login-shell-visual {
    display: block;
  }
}
.login-shell-visual img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
}
.login-shell-form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--c-white);
  padding: 2rem 1.5rem;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
@media (min-width: 900px) {
  .login-shell-form-col {
    padding: 1.5rem 2rem;
  }
}
.login-inner {
  width: 100%;
  max-width: 432px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

/* Mot de passe oublié — uniquement dans la colonne formulaire (photo gauche inchangée) */
body.login-shell.login-shell--forgot-page {
  background-color: #ffffff;
}
.login-shell.login-shell--forgot-page .login-shell-form-col,
.login-shell-form-col.login-shell-form-col--forgot {
  background-color: #ffffff;
  color: var(--c-gray-900, #111827);
}
.login-forgot-view {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding-top: 0.25rem;
}

/* Saisie nouveau mot de passe (index.php?password_reset=…) — même gabarit que mot de passe oublié */
.login-password-reset-view {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding-top: 0.25rem;
}
.login-forgot-back {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 1.75rem;
  font-size: var(--fs-14, 0.875rem);
  font-weight: var(--fw-semibold, 600);
  color: var(--c-gray-800, #1f2937);
  text-decoration: none;
  line-height: 1.35;
}
.login-forgot-back:hover,
.login-forgot-back:focus {
  color: #000000;
  text-decoration: underline;
}
.login-forgot-title {
  margin: 0 0 1rem;
  width: 100%;
  text-align: center;
  line-height: 1.12;
  color: #000000;
  font-weight: var(--fw-bold, 700);
}
.login-forgot-lead {
  margin: 0 0 2rem;
  width: 100%;
  text-align: center;
  font-size: var(--fs-14, 0.875rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-gray-600, #4b5563);
}
.login-forgot-label,
.login-shell-form-col--forgot .login-forgot-view .form-ccom-label {
  color: var(--c-gray-900, #111827);
  text-align: left;
}
.login-shell-form-col--forgot .login-forgot-view .form-ccom-input {
  background-color: #f4f4f5;
  border: 1px solid var(--c-gray-200, #e5e7eb);
  border-radius: var(--radius-md, 8px);
}
.login-forgot-field-email {
  margin-top: 0.25rem;
  text-align: left;
}
.login-forgot-submit {
  margin-top: 1.125rem;
}
.login-forgot-submit .btn-ccom.btn-ccom-primary {
  background-color: #12262b;
  border-color: #12262b;
  color: #ffffff;
}
.login-forgot-submit .btn-ccom.btn-ccom-primary:hover,
.login-forgot-submit .btn-ccom.btn-ccom-primary:focus {
  background-color: #0d1c20;
  border-color: #0d1c20;
  color: #ffffff;
}
.login-forgot-view .login-forgot-success {
  margin: 0 0 1.25rem;
  text-align: center;
  color: var(--c-gray-600, #4b5563);
  font-size: var(--fs-14, 0.875rem);
  line-height: 1.5;
}
.login-forgot-view .login-forgot-error {
  margin: 0 0 1.25rem;
  text-align: center;
}
/* Blocs formulaire plus compacts sur la page connexion */
.login-shell .form-ccom {
  gap: 0.375rem;
}
.login-shell .form-ccom-label {
  line-height: 1.25;
}
.login-preprod-h1 {
  margin-bottom: 0.625rem;
  line-height: 1.12;
}
.login-preprod-lang {
  padding-top: 0;
}
.login-preprod-field-username {
  margin-top: 0.625rem;
}

.login-preprod-phone-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
}
.login-preprod-phone-prefix {
  flex: 0 0 auto;
  min-width: 4.75rem;
  max-width: 6.5rem;
}
.login-preprod-phone-number {
  flex: 1 1 auto;
  min-width: 0;
}

.login-google-wrap {
  width: 100%;
  align-items: center;
}
.login-google-inner {
  width: 400px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
.login-google-inner .g_id_signin iframe,
.login-google-inner [id^="gsi"] {
  margin-left: auto;
  margin-right: auto;
}
.login-preprod-switch {
  margin-top: 0.375rem;
}
.login-preprod-field-password {
  margin-top: 0.625rem;
}

.login-preprod-password-error {
  margin: 8px 0 0;
  font-size: var(--fs-13, 0.8125rem);
  font-weight: 400;
  line-height: 1.4;
  color: var(--c-danger, #dc2626);
}

.login-preprod-password-error-link {
  font-weight: 400;
  color: inherit;
  text-decoration: underline;
}

.login-preprod-password-error-link:hover {
  color: inherit;
  text-decoration: underline;
}

.login-preprod-remember {
  margin-top: 0.5rem;
}
.login-preprod-submit {
  margin-top: 0.75rem;
}
@media (min-width: 900px) {
  .login-preprod-submit {
    margin-top: 1rem;
  }
}
.login-preprod-forgot {
  margin-top: 0.5rem;
}
.login-preprod-link-emphasis {
  font-size: var(--fs-14);
  font-weight: var(--fw-bold);
  color: var(--c-gray-600);
  text-decoration: underline;
  line-height: 1.35;
}
.login-preprod-link-emphasis:hover {
  color: var(--c-gray-800);
  text-decoration: underline;
}

/* Modal succès — demande de réinitialisation (Mailjet) */
body.login-shell.login-shell--password-reset-modal-open {
  overflow: hidden;
}

.ccom-password-reset-modal-overlay[hidden] {
  display: none !important;
}

.ccom-password-reset-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  background-color: rgba(0, 33, 41, 0.45);
}

.ccom-password-reset-modal {
  width: 100%;
  max-width: 28rem;
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1.25rem 3rem rgba(0, 33, 41, 0.18);
  color: #002129;
  outline: none;
}

.ccom-password-reset-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.ccom-password-reset-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #002129;
}

.ccom-password-reset-modal__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: #002129;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.ccom-password-reset-modal__close:hover {
  background-color: rgba(0, 33, 41, 0.06);
}

.ccom-password-reset-modal__close:focus-visible {
  outline: 2px solid #002129;
  outline-offset: 2px;
}

.ccom-password-reset-modal__body {
  padding: 1.25rem 1.25rem 1.5rem;
}

.ccom-password-reset-modal__headline {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: #002129;
}

.ccom-password-reset-modal__text {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  color: #002129;
}

.ccom-password-reset-modal__footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e5e7eb;
}

.ccom-password-reset-modal__btn {
  margin: 0;
  padding: 0.5rem 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background-color: #ffffff;
  color: #002129;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.ccom-password-reset-modal__btn:hover {
  background-color: #f9fafb;
}

.ccom-password-reset-modal__btn:focus-visible {
  outline: 2px solid #002129;
  outline-offset: 2px;
}
