/* ==========================================================================
   AGRICA (NEC ENT) — Pages réinitialisation et mise à jour du mot de passe
   ========================================================================== */

/* ===== Largeur de la carte — page reset password uniquement ===== */
body.reset-password .card-pf,
body.reset-password .pf-v5-c-login__main {
    width: auto !important;
    max-width: 540px !important;
}

/* ===== Titre réinitialisation ===== */
.reset-title-line { font-size: 25px; }

/* ===== Champ saisie ===== */
#kc-reset-password-form input.rpwd-input {
    height: var(--field-h, 44px);
    font-size: var(--field-fs, 16px);
    line-height: var(--field-h, 44px);
    padding: 0 .75rem;
    background: transparent;
    border: 0 !important;
    border-bottom: 2px solid var(--agrica-yellow, #ffcc30) !important;
    border-radius: 0;
    box-shadow: none !important;
    color: var(--agrica-blue, #154292);
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
#kc-reset-password-form input.rpwd-input::placeholder { color: var(--ph-color, #9fb0d6); opacity: .9; }
#kc-reset-password-form input.rpwd-input:focus {
    outline: none;
    border-bottom: 2px solid var(--agrica-blue, #154292) !important;
    box-shadow: 0 0 0 2px rgba(255, 204, 48, .25) !important;
}
#kc-reset-password-form input.rpwd-input[aria-invalid="true"] {
    border-bottom: 2px solid var(--danger, #c9190b) !important;
}

/* ===== Colonne boutons pleine largeur, sans chevron ===== */
.reset-buttons-col { display: flex; flex-direction: column; gap: .75rem; margin-top: 1.2rem; }
.reset-btn-primary {
    display: block; width: 100%;
    background: var(--agrica-yellow, #ffcc30);
    color: var(--agrica-blue, #154292);
    border: 2px solid var(--agrica-yellow, #ffcc30);
    border-radius: 0;
    padding: var(--btn-py, 10px) var(--btn-px, 28px);
    font-weight: var(--btn-fw, 600); font-size: var(--btn-fs, 18px); line-height: 125%;
    text-align: center; cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
    text-decoration: none !important;
}
.reset-btn-primary:hover { background: var(--agrica-blue, #154292); border-color: var(--agrica-blue, #154292); color: #fff; }
.reset-btn-secondary { display: block; width: 100%; box-sizing: border-box; text-align: center; padding-left: var(--btn-px, 28px) !important; }
.no-chevron::before { display: none !important; }

/* ===== Message d'erreur ===== */
.pf-m-error { color: var(--danger, #c9190b) !important; font-weight: 400; }

/* ===== Texte d'instruction ===== */
.reset-info-text { margin-top: .75rem; font-size: .875rem; color: var(--agrica-blue, #154292); line-height: 1.5; }

/* ===== Titre "Mise à jour du mot de passe" ===== */
.underlined-title {
    display: inline;
    padding-right: 2rem;
    padding-bottom: 0;
    border-bottom: 7px solid #92d0d0;
    font-size: 2rem;
    font-family: Gilroy, Helvetica, Arial, sans-serif;
    font-weight: 700;
    color: #22438d !important;
}

/* ==========================================================================
   AGRICA (NEC ENT) — Page mise à jour du mot de passe
   ========================================================================== */

/* ===== Carte / layout ===== */
body.newpassword .card-pf,
body.newpassword .pf-v5-c-login__main {
    margin: 0 auto;
    padding: 0 20px;
    border: 5px solid #f9de58;
    width: 60%;
}
body.newpassword .pf-v5-c-login__main-body { padding-bottom: 0 !important; }
body.newpassword .login-pf .container { padding: 0px 12px 13px 14px !important; }
body.newpassword .container.maincontainer { display: flex; }

/* ===== Colonnes ===== */
body.newpassword .container-left {
    flex: 0 0 58%;
    max-width: 58%;
    min-width: 0;
    padding: 25px;
    box-sizing: border-box;
}
body.newpassword .container-right {
    flex: 0 0 42%;
    max-width: 42%;
    min-width: 0;
    display: flex;
    align-items: flex-start;   /* panneau prend sa hauteur naturelle, pas stretch */
    padding: 25px 0;
    box-sizing: border-box;
}

/* ===== Sous-texte ===== */
body.newpassword .notif { color: #22438d !important; margin: 1rem 0 1.2rem; font-size: .95rem; }

/* ===== Champs input ===== */
body.newpassword .upd-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: .75rem;
}
body.newpassword .upd-field-wrap .upd-input {
    flex: 1;
    min-width: 0;
    height: var(--field-h, 44px);
    font-size: var(--field-fs, 16px);
    padding: 0 2.5rem 0 .75rem;
    background: transparent;
    border: 0 !important;
    border-bottom: 2px solid var(--agrica-yellow, #ffcc30) !important;
    border-radius: 0;
    box-shadow: none !important;
    color: var(--agrica-blue, #154292);
    transition: border-color .15s, box-shadow .15s;
}
body.newpassword .upd-field-wrap .upd-input::placeholder { color: var(--ph-color, #9fb0d6); opacity: .9; }
body.newpassword .upd-field-wrap .upd-input:focus {
    outline: none;
    border-bottom: 2px solid var(--agrica-blue, #154292) !important;
    box-shadow: 0 0 0 2px rgba(255, 204, 48, .25) !important;
}
body.newpassword .upd-field-wrap .upd-input[aria-invalid="true"] {
    border-bottom: 2px solid var(--danger, #c9190b) !important;
}

/* ===== Bouton œil ===== */
body.newpassword .upd-eye-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--agrica-blue, #154292);
}

/* ===== Checkbox "Se déconnecter des autres appareils" ===== */
body.newpassword .logout-sessions-row { /*margin: .75rem 0 .5rem;*/ visibility: hidden; position: absolute; top: 0}
body.newpassword .logout-sessions-row .pf-v5-c-check,
body.newpassword .logout-sessions-row .pf-c-check { display: flex; flex-direction: row; align-items: center; gap: .6rem; }
body.newpassword #logout-sessions {
    appearance: none; -webkit-appearance: none; display: inherit;
    width: 18px; height: 18px; min-width: 18px;
    border: 2px solid var(--agrica-yellow, #ffcc30) !important;
    border-radius: 4px; background: #fff; position: relative;
    cursor: pointer; vertical-align: middle; opacity: 1 !important;
}
body.newpassword #logout-sessions:checked { background: var(--agrica-blue, #154292); border-color: var(--agrica-blue, #154292) !important; }
body.newpassword #logout-sessions:checked::after {
    content: ""; position: absolute; inset: 0; background: #fff;
    mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M6.2 11.6L2.6 8l1.4-1.4 2.2 2.2L12 3l1.4 1.4z'/%3E%3C/svg%3E") center/12px 12px no-repeat;
    -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M6.2 11.6L2.6 8l1.4-1.4 2.2 2.2L12 3l1.4 1.4z'/%3E%3C/svg%3E") center/12px 12px no-repeat;
}
body.newpassword .logout-sessions-row .pf-v5-c-check__input { opacity: 1 !important; width: 18px !important; }
body.newpassword .logout-sessions-row label,
body.newpassword .logout-sessions-row .pf-v5-c-check__label {
    font-weight: 600; font-size: .9rem; color: var(--agrica-blue, #154292);
    margin: 0; cursor: pointer; padding-top: 4px;
}
body.newpassword .logout-sessions-row .pf-v5-c-check label::before { display: none; }

/* ===== Boutons ===== */
body.newpassword #kc-form-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: .75rem;
    margin-top: 1.5rem;
}

/* Style commun aux boutons */
body.newpassword #kc-form-buttons .pf-v5-c-button,
body.newpassword #kc-form-buttons .pf-c-button,
body.newpassword #kc-form-buttons button[type="submit"] {
    border: 2px solid var(--agrica-yellow, #ffcc30);
    background-color: var(--agrica-yellow, #ffcc30);
    color: var(--agrica-blue, #154292);
    padding: .75rem 2rem;
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 700; font-size: 16px; line-height: 125%;
    text-align: center; white-space: nowrap;
    text-decoration: none !important;
    cursor: pointer; transition: all .2s ease-in-out;
    border-radius: 0; box-sizing: border-box;
}
body.newpassword #kc-form-buttons .pf-v5-c-button:hover,
body.newpassword #kc-form-buttons .pf-c-button:hover,
body.newpassword #kc-form-buttons button[type="submit"]:hover {
    border: 2px solid var(--agrica-blue, #154292);
    background-color: var(--agrica-blue, #154292);
    color: #fff;
}

/* 1 bouton : taille auto avec min-width, aligné à gauche */
body.newpassword #kc-form-buttons.buttons--single .pf-v5-c-button,
body.newpassword #kc-form-buttons.buttons--single .pf-c-button,
body.newpassword #kc-form-buttons.buttons--single button[type="submit"] {
    flex: 0 0 auto;
    min-width: 250px;
}

/* Multi-boutons : chacun prend 50% de la largeur */
body.newpassword #kc-form-buttons.buttons--multi .pf-v5-c-button,
body.newpassword #kc-form-buttons.buttons--multi .pf-c-button,
body.newpassword #kc-form-buttons.buttons--multi button[type="submit"] {
    flex: 1 1 0;
    min-width: 0;
}

/* ===== Panneau règles (droite) ===== */
body.newpassword .panel {
    display: block;
    background: #ffffff;
    border: 2px solid #27aabf;
    margin: 10px;
    width: calc(100% - 20px);
    height: auto;
    box-sizing: border-box;
}
body.newpassword .panel-body { padding: 15px; }
body.newpassword .panel-title { font-size: 18px; font-weight: bold; }
body.newpassword .agricaLightBlue { color: #27aabf; }
body.newpassword .panel2 {
    min-width: 265px;
    min-height: 329px;
    height: auto;
}
body.newpassword .panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    border-top-right-radius: 3px;
    border-top-left-radius: 3px;
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
    background-image: linear-gradient(to bottom, #d9edf7 0, #c4e3f3 100%);
    background-repeat: repeat-x;
}
body.newpassword .mtop10 { margin-top: 10px; }
body.newpassword .mright10 { margin-right: 10px; }

/* ===== Responsive ===== */
@media (min-width: 768px) {
    body.newpassword div.pf-v5-c-login__main-header { padding-top: 20px; }
}

/* Colonne unique sous 1400px + centrage + chevron masqué */
@media (max-width: 1400px) {
    body.newpassword .pf-v5-c-login__main-body { padding: 0; }
    body.newpassword .pf-v5-c-login__main { width: 100% !important; }
    body.newpassword .container.maincontainer {
        flex-direction: column !important;
        align-items: center;
    }
    body.newpassword .container-left {
        flex: none !important;
        width: 100% !important;
        max-width: 600px !important;
        padding: 20px 16px !important;
        box-sizing: border-box;
    }
    body.newpassword .container-right {
        flex: none !important;
        width: 100% !important;
        max-width: 600px !important;
        padding: 0 16px 20px !important;
        box-sizing: border-box;
    }
    body.newpassword .panel2 { width: 100% !important; }
    /* Boutons : pleine largeur + sans chevron en colonne unique */
    body.newpassword #kc-form-buttons {
        flex-wrap: wrap;
    }
    body.newpassword #kc-form-buttons .pf-v5-c-button,
    body.newpassword #kc-form-buttons .pf-c-button,
    body.newpassword #kc-form-buttons button[type="submit"] {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        padding: .75rem 1rem;
    }
    body.newpassword #kc-form-buttons .pf-v5-c-button::before,
    body.newpassword #kc-form-buttons .pf-c-button::before,
    body.newpassword #kc-form-buttons button[type="submit"]::before {
        display: none !important;
    }
}
