/*
  Adaptation du css pour affichage SSO
*/

#id {
  padding-bottom: 1em;
}

.btn {
  text-align: center;
  vertical-align: middle;
  user-select: none;
  line-height: 1.5;
  font-family: barlowregular, sans-serif;
  font-size: 1em;
  font-weight: 400;
  padding: .15em 1.7em;
  max-height: 28px;
  line-height: inherit;
}

span.tooltip {
  display: none; /* Etat initial */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  line-height: 19.2px;
}

.message-content {
  padding: 12px 20px 12px 20px;
}

.login:not(.new-design-login) .submit {
  text-align: center;
  vertical-align: middle;
  user-select: none;
  line-height: 1.5;
  font-family: barlowregular, sans-serif;
  line-height: inherit;
  font-size: 1em;
  font-weight: 400;
  padding: .15em 1.7em;
  max-height: 28px;
  line-height: inherit;
}

.js-validate-error-label {
  color: #dc3545 !important;
  margin-top: 0.25rem;
  font-size: 80%;
  font-weight: 400;
}

.error-message p {
  margin-bottom: 10px;
}

.error-message .btn-zone {
  margin-top: 20px;
}

.separator {
  height: 1px;
  margin: 32px 0 8px 0;
  background-color: #ccc;
}

.separator-text-container {
  text-align: center;
  margin-top: -16px;
  margin-bottom: 20px;
}

.separator-text {
  width: 35px;
  background-color: #ffffff;
  display: inline-block;
}

.expired-password {
  border-radius: 10px;
  padding: 1rem;
  color: #009c9e;
  border: solid 1px currentColor;
  margin-bottom: 2rem;
}

#wrapper {
  position: fixed;
  margin-left:auto;
  margin-right:auto;
  height:auto;
  width:auto;
  z-index: 10;
  pointer-events: none;
}
#banner {
  float:left;
}

#navbar {
  clear: left;
}
#navbar>img {
  width: 100%;
}

.navbar {
  width: 100%;
}

.banner {
  width: 100%;
  background-color: orange;
  color: #fff;
  text-align: center;
  padding: 6.5px;
  font-size: medium;
  display: block;
}

.otp-container {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

input[type="text"].otp-box {
    height: 2.25rem;
    width: 2.5rem;
    border: 1.5px solid #d9D9D9;
    text-align: center;
    font-size: 1.5rem;
    padding: 0 !important;
    line-height: 2.5rem !important;
}

input[type="text"].otp-box:focus {
    border-color: #FC8A76 !important;
    box-shadow: 0 0 0 0.25rem rgba(252, 138, 118, 0.25) !important;
    outline: none !important;
}

@media (max-width: 480px) {
    .otp-container {
        gap: 0.375rem;
    }
    input[type="text"].otp-box {
        width: 2.375rem;
        height: 3rem;
        line-height: 3rem !important;
    }
}

.success {
  border-radius: 10px;
  padding: 1rem;
  color: #009c9e;
  border: solid 1px currentColor;
  margin-bottom: 2rem;
}

.action-resend {
  background-color: transparent !important;
  border: none !important;
  color: #6D6D6D !important;
  font-size: 1em !important;
  padding: 0.7em 2em !important;
  cursor: pointer;
}

.action-resend:hover, .action-resend:focus {
  color: #d73f3c !important;
}

.mfa-design-box .mfa-page-header h2 {
    color: #3A001E;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-size: 40px;
    font-weight: 700;
    height: 50px;
    letter-spacing: 0;
    line-height: 125%;
    margin: 0 0 24px;
    padding: 0 !important;
    text-align: left;
    text-transform: none;
    width: 100%;
}

.mfa-design-box main {
    border: none !important;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.15) !important;
    gap: 24px !important;
    height: auto !important;
    padding: 24px !important;
}

.mfa-design-box .mfa-instruction {
    color: #3A001E;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-size: 16px;
    font-weight: 400;
    line-height: 125%;
    margin: 0;
    max-width: 648px;
    position: relative;
    text-align: left;
}

.mfa-design-box .mfa-code-label {
    color: #3A001E;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-size: 14px;
    font-weight: 400;
    line-height: 125%;
    margin: 0;
    padding: 0;
    text-align: left;
    width: 280px;
}

.mfa-design-box .mfa-code-group {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.mfa-design-box .otp-container.mfa-spaced {
    align-items: center;
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
    justify-content: center;
    margin: 0;
    width: 280px;
}

.mfa-design-box input[type="text"].otp-box {
    border: 1px solid #D9D9D9;
    border-radius: 6px;
    box-sizing: border-box;
    color: #3A001E;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-size: 14px;
    font-weight: 400;
    height: 36px;
    line-height: 36px !important;
    width: 40px;
}

.mfa-design-box .mfa-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mfa-design-box .mfa-checkbox {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
    accent-color: #d73f3c;
    margin: 0;
}

.mfa-design-box .mfa-checkbox-label {
    cursor: pointer;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    margin: 0;
    padding: 0;
    padding-top: 0.15rem;
    font-size: 0.95em;
}

.mfa-design-box #login,
.mfa-design-box #mfa-form {
    width: 100%;
}

.mfa-design-box #mfa-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mfa-design-box .mfa-btn-zone {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-direction: column !important;
    gap: 8px;
    margin: 0 !important;
}

/* Message d'erreur et succès stylisés */
.message-content {
    box-sizing: border-box;
    color: #3A001E;
    display: flex;
    align-items: center;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-weight: 400;
    line-height: 125%;
    max-width: 100% !important;
    border-radius: 0.5rem;
    padding: 0.5rem !important;
    gap: 0.375rem;
    width: 100% !important;
    font-size: 14px !important;
}

.message-content.error {
    background-color: #FFFFFF;
    border: 1px solid #E43C2F;
}

.mfa-design-box .message-content {
    box-shadow: 2px 2px 10px 5px #F8F1ED;
    padding-bottom: 7px !important;
    padding-top: 7px !important;
    min-height: 40px;
}

.message-content.success {
    background-color: #F0FDF4;
    border: 1px solid #15803D;
    color: #15803D;
}

.new-design-login #login > .error {
    margin-bottom: 24px;
}

.new-design-login #login > .error .message-content {
    border-radius: 0;
    display: block;
    flex: 1 1 auto;
    padding: 0 !important;
    width: auto !important;
}

.mfa-design-box .mfa-btn-submit {
    height: 55px !important;
    width: 100% !important;
    margin: 0 !important;
    background-color: #FC8A76 !important;
    color: #3A001E !important;
    border-radius: 32px !important;
    box-shadow: 2px 2px 5px #D9D9D9 !important;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-weight: 700 !important;
    font-size: 18px !important;
    line-height: 125%;
    border: none !important;
    max-height: none !important;
    transition: opacity 0.2s ease-in-out;
    padding: 16px !important;
}

.mfa-design-box .mfa-btn-submit:hover,
.mfa-design-box .mfa-btn-submit:focus {
    opacity: 0.9;
}

.mfa-design-box .mfa-btn-resend {
    background-color: #fff !important;
    border: none !important;
    text-decoration: underline !important;
    color: #3A001E !important;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-size: 16px !important;
    font-weight: 400;
    height: 44px;
    line-height: 125%;
    padding: 12px !important;
    width: 100%;
}

.mfa-design-box .mfa-btn-resend:hover, .mfa-design-box .mfa-btn-resend:focus {
    color: #3b0018 !important;
}

.mfa-design-box .mfa-restart-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    width: 100%;
}

.mfa-design-box .mfa-restart-link {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-size: 16px !important;
    font-weight: 500;
    height: 44px;
    justify-content: center;
    line-height: 125%;
    width: 100%;
    background-color: #F9F9F9 !important;
    color: #3A001E !important;
    border: 1px solid #FC8A76 !important;
    border-radius: 32px !important;
    box-shadow: 2px 2px 5px #D9D9D9;
    padding: 12px !important;
    text-decoration: none !important;
    text-align: center;
    transition: background-color 0.2s ease-in-out;
}

.mfa-design-box .mfa-restart-link:hover, .mfa-design-box .mfa-restart-link:focus {
    background-color: #EEEEEE !important;
    border: 1px solid #FC8A76 !important;
    color: #3A001E !important;
}

@media (max-width: 480px) {
    .mfa-btn-zone {
        flex-direction: column !important;
        gap: 0.5rem;
    }
    .mfa-btn-submit, .mfa-btn-resend {
        width: 100% !important;
    }
}

@media (max-width: 700px) {
    .mfa-design-box .mfa-page-header h2 {
        font-size: 1.5rem;
        height: auto;
        overflow-wrap: break-word;
    }
}

@media (max-width: 500px) {
    body, html {
        margin: 0;
        padding: 0;
        width: 100%;
        overflow-x: hidden;
    }
    #kc-content, #kc-content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    #navbar>img {
        object-fit: cover;
        height: auto;
        max-height: 150px;
        object-position: left;
    }
    .login.new-design-login {
        width: 100% !important;
        height: auto !important;
        min-height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding: 24px !important;
    }
    .login.new-design-login:has(.error) {
        justify-content: flex-start !important;
    }
    .login.new-design-login > .box {
        margin-top: 24px !important;
    }
    .mfa-design-box .mfa-code-label,
    .mfa-design-box .otp-container.mfa-spaced {
        max-width: 280px;
        width: 100%;
    }
    .mfa-design-box .otp-container.mfa-spaced {
        gap: 6px;
    }
    .mfa-design-box input[type="text"].otp-box {
        flex: 1 1 0;
        max-width: 40px;
        min-width: 0;
        width: calc((100% - 30px) / 6);
    }
    .login.new-design-login > div:last-child:not(.new-design-box) {
        margin-top: auto !important;
        width: 100%;
    }
    .login.new-design-login footer {
        position: static !important;
        margin-top: 2rem !important;
        border-radius: 0 !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* =========================================
   STYLES DE LA POPIN "CODE NON REÇU"
   ========================================= */

/* Fond grisé (Overlay) */
.mfa-popin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* État actif */
.mfa-popin-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* La boîte blanche */
.mfa-popin-container {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-sizing: border-box;
    width: min(744px, calc(100vw - 48px));
    padding: 1.5rem;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
    transform: translateY(1.25rem);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    gap: 1.5rem; /* 24px */
}

.mfa-popin-overlay.active .mfa-popin-container {
    transform: translateY(0);
}

/* En-tête (Titre + Croix) */
.mfa-popin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mfa-popin-header h3 {
    text-transform: none !important;
    color: #3A001E;
    background: none;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-size: 1rem;
    font-weight: bold;
    line-height: 125%;
    margin: 0;
    padding: 0 !important;
}

.mfa-popin-close {
    background: none;
    border: none;
    font-size: 1.5rem; /* 24px */
    color: #3A001E;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 1.5rem; /* 24px */
    height: 1.5rem; /* 24px */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contenu textuel */
.mfa-popin-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* 24px */
}

.mfa-popin-text {
    color: #3A001E;
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-size: 1rem; /* 16px */
    font-weight: 400;
    line-height: 125%;
    margin: 0;
}

/* Bouton principal de la popin */
.mfa-popin-btn-submit {
    background-color: #FC8A76;
    color: #3A001E;
    border: none;
    border-radius: 2rem; /* 32px */
    padding: 1rem; /* 16px */
    font-family: var(--font-generic, "Quicksand", sans-serif);
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    cursor: pointer;
    box-shadow: 2px 2px 10px #D9D9D9;
    box-sizing: border-box;
    height: 55px;
    transition: opacity 0.2s ease-in-out;
    width: auto;
    min-width: 11.5rem; /* ~184px */
}

.mfa-popin-btn-submit:hover,
.mfa-popin-btn-submit:focus {
    opacity: 0.9;
}

@media (max-width: 500px) {
    .mfa-popin-overlay {
        box-sizing: border-box;
        padding: 24px 0;
        overflow-y: auto;
    }

    .mfa-popin-container {
        max-height: calc(100vh - 48px);
        overflow-y: auto;
    }
}

/* Bouton désactivé aligné sur les parcours mot de passe/identifiant oublié */
.mfa-popin-btn-submit:disabled,
.mfa-popin-btn-submit:disabled:hover,
.mfa-popin-btn-submit:disabled:focus,
.mfa-design-box .btn-zone .mfa-btn-submit:disabled,
.mfa-design-box .btn-zone .mfa-btn-submit:disabled:hover,
.mfa-design-box .btn-zone .mfa-btn-submit:disabled:focus {
    background-color: #FC8A76 !important;
    color: #3A001E !important;
    cursor: default;
    opacity: 0.5;
}

/* Zone de message de retour dans la popin */
.mfa-popin-container .message-content {
    font-size: 16px !important;
    line-height: 125%;
    margin-bottom: 0 !important;
    padding: 11px 12px !important;
}

/* Taille de l'icône dans la popin (annule le margin par défaut pour utiliser le gap) */
.mfa-popin-container .mfa-success-icon,
.mfa-popin-container .mfa-error-icon {
    width: 1.5rem; /* 24px */
    height: 1.5rem; /* 24px */
    margin: 0;
    object-fit: contain;
}

.mfa-popin-container .mfa-close-icon {
    width: 12px;
    height: 12px;
    margin: 0;
    object-fit: contain;
}

.mfa-popin-container .mfa-message-text {
    margin: 0;
}
