/*
|--------------------------------------------------------------------------
| Authentication — Modern light theme
|--------------------------------------------------------------------------
| Shared by password confirmation, reset request and password creation pages.
*/

.auth-modern {
    background:
        radial-gradient(circle at 8% 8%, rgba(185,133,47,.10), transparent 24rem),
        radial-gradient(circle at 92% 92%, rgba(36,90,77,.08), transparent 26rem),
        #f5efe5;
}

.auth-modern .app {
    padding-top: 0 !important;
}

.auth-modern .auth-page {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-modern .auth-page--with-nav {
    min-height: calc(100vh - 110px);
    padding-top: 3rem;
}

.auth-modern .auth-shell {
    width: 100%;
    max-width: 620px;
}

.auth-modern .auth-card {
    position: relative;
    overflow: hidden;

    width: 100%;
    margin: 0 auto;

    color: #3f4c45;
    background:
        linear-gradient(145deg, rgba(255,255,255,.78), transparent 65%),
        #fffdf8;

    border: 1px solid #e7dccd;
    border-radius: 22px;

    box-shadow:
        0 22px 60px rgba(84,67,43,.14);
}

.auth-modern .auth-card--compact {
    max-width: 520px;
}

.auth-modern .auth-card--wide {
    max-width: 700px;
}

.auth-modern .auth-card__header {
    padding: clamp(1.5rem, 3vw, 2.2rem);

    background:
        radial-gradient(circle at 90% 0, rgba(185,133,47,.10), transparent 20rem),
        linear-gradient(135deg, #fffdf8 0%, #f7efdf 100%);

    border-bottom: 1px solid #e6dccb;
}

.auth-modern .auth-card__body {
    padding: clamp(1.4rem, 3vw, 2.1rem);
}

.auth-modern .auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;

    padding: .48rem .82rem;

    color: #8f651f;
    background: #fff3d8;

    border: 1px solid #ead4aa;
    border-radius: 999px;

    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.auth-modern .auth-title {
    margin: 1rem 0 .45rem;

    color: #173f36;

    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 850;
    letter-spacing: -.015em;
}

.auth-modern .auth-subtitle {
    margin-bottom: 0;

    color: #6f756f;

    line-height: 1.65;
}

/* Forms */
.auth-modern .form-label {
    margin-bottom: .5rem;

    color: #173f36;

    font-size: .79rem;
    font-weight: 750;
}

.auth-modern .form-control,
.auth-modern .auth-control {
    min-height: 50px;
    padding: .78rem .95rem;

    color: #3f4c45;
    background: #fff;

    border: 1px solid #ded4c4;
    border-radius: 11px;
}

.auth-modern .form-control::placeholder,
.auth-modern .auth-control::placeholder {
    color: #aaa195;
}

.auth-modern .form-control:focus,
.auth-modern .auth-control:focus {
    color: #3f4c45;
    background: #fff;

    border-color: #c49a4a;
    box-shadow: 0 0 0 .22rem rgba(196,154,74,.14);
}

.auth-modern .form-text {
    color: #6f756f;
    line-height: 1.55;
}

.auth-modern .invalid-feedback {
    color: #a95f56;
    font-weight: 650;
}

/* Password toggles */
.auth-modern .auth-password-wrapper {
    position: relative;
}

.auth-modern .auth-password-wrapper .auth-control {
    padding-right: 3.4rem;
}

.auth-modern .auth-password-toggle {
    position: absolute;
    top: 50%;
    right: .5rem;

    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;
    padding: 0;

    color: #315f6a;
    background: #eef7f8;

    border: 1px solid #cfe2e5;
    border-radius: 10px;

    transform: translateY(-50%);
}

.auth-modern .auth-password-toggle:hover {
    color: #fff;
    background: #315f6a;
    border-color: #315f6a;
}

/* Buttons and links */
.auth-modern .auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;

    min-height: 48px;
    padding: .72rem 1rem;

    border-radius: 11px;

    font-weight: 800;
}

.auth-modern .auth-btn--primary {
    color: #fff;
    background: #245a4d;
    border-color: #245a4d;

    box-shadow: 0 10px 22px rgba(36,90,77,.17);
}

.auth-modern .auth-btn--primary:hover {
    color: #fff;
    background: #173f36;
    border-color: #173f36;

    transform: translateY(-1px);
}

.auth-modern .auth-link {
    color: #245a4d;
    font-weight: 750;
    text-decoration: none;
}

.auth-modern .auth-link:hover {
    color: #8f651f;
}

/* Actions */
.auth-modern .auth-actions {
    display: flex;
    align-items: center;
    gap: .85rem;
    flex-wrap: wrap;
}

/* Alerts */
.auth-modern .auth-alert,
.auth-modern .alert {
    border-radius: 12px;
}

.auth-modern .auth-alert--success,
.auth-modern .alert-success {
    color: #3e705c;
    background: #eff7f2;
    border: 1px solid #d0e3d8;
}

.auth-modern .alert-info {
    color: #315f6a;
    background: #eef7f8;
    border: 1px solid #cfe2e5;
}

.auth-modern .alert-danger {
    color: #934d47;
    background: #fff2ef;
    border: 1px solid #efcfca;
}

/* Info panel */
.auth-modern .auth-info {
    margin-top: 1.5rem;
    padding: 1rem;

    color: #56645e;
    background: #f4f8f6;

    border: 1px solid #d8e5df;
    border-radius: 14px;

    line-height: 1.65;
}

.auth-modern .auth-info i {
    color: #8f651f;
}

/* Remove HUD corners */
.auth-modern .card-arrow {
    display: none !important;
}

/* SweetAlert */
.swal2-popup {
    color: #3f4c45 !important;
    background: #fffdf8 !important;

    border: 1px solid #e7dccd !important;
    border-radius: 16px !important;

    box-shadow: 0 24px 70px rgba(57,46,30,.2) !important;
}

.swal2-title {
    color: #173f36 !important;
}

.swal2-confirm {
    background: #245a4d !important;
}

/* Responsive */
@media (max-width: 575.98px) {
    .auth-modern .auth-page,
    .auth-modern .auth-page--with-nav {
        align-items: flex-start;
        padding: 1rem .65rem 2rem;
    }

    .auth-modern .auth-card {
        border-radius: 18px;
    }

    .auth-modern .auth-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .auth-modern .auth-actions .btn,
    .auth-modern .auth-actions .auth-link {
        width: 100%;
        text-align: center;
    }
}
/* ==========================================================================
   Auth avec navbar publique
   ========================================================================== */

.auth-modern {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 8% 12%,
            rgba(185, 133, 47, .08),
            transparent 25rem
        ),
        radial-gradient(
            circle at 92% 86%,
            rgba(36, 90, 77, .07),
            transparent 28rem
        ),
        #f5f0e7;
}

.auth-modern .app {
    min-height: 100vh;
    padding-top: 0 !important;
}

.auth-public-layout {
    min-height: 100vh;
}

.auth-modern .auth-page--with-nav {
    min-height: calc(100vh - 76px);
    padding: 4rem 1rem;
}

/* Empêche la carte d'être trop basse ou trop large */
.auth-modern .auth-card--wide {
    width: min(100%, 700px);
    margin-inline: auto;
}

/* Information de sécurité */
.auth-modern .auth-info {
    display: flex;
    align-items: flex-start;
    gap: .9rem;

    margin-top: 1.5rem;
    padding: 1rem 1.1rem;

    color: #56645e;
    background: #f4f8f6;

    border: 1px solid #d8e5df;
    border-radius: 14px;

    font-size: .88rem;
    line-height: 1.7;
}

.auth-modern .auth-info__icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;

    width: 34px;
    height: 34px;

    color: #8f651f;
    background: #fff3d8;

    border: 1px solid #ead4aa;
    border-radius: 10px;
}

.auth-modern .auth-info__content {
    flex: 1;
    min-width: 0;
}

/* Retour à la connexion */
.auth-modern .auth-back-link {
    margin-top: 1.25rem;
    text-align: center;
}

.auth-modern .auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;

    color: #245a4d;

    font-size: .86rem;
    font-weight: 750;
    text-decoration: none;
}

.auth-modern .auth-link:hover {
    color: #8f651f;
}

/* Le bouton occupe bien toute la largeur */
.auth-modern .auth-btn--primary {
    width: 100%;
    min-height: 50px;
}

/* ==========================================================================
   Correction de la navbar sur les pages d'authentification
   ========================================================================== */

.auth-modern .public-navbar {
    position: relative;
    z-index: 1050;
}

.auth-modern .public-navbar-container {
    width: min(100%, 1320px);
    margin-inline: auto;
}

/*
 * Évite que les menus mobiles restent visibles sur ordinateur si une règle
 * Bootstrap ou publique manque.
 */
@media (min-width: 992px) {
    .auth-modern .public-navbar-mobile-panel,
    .auth-modern .public-mobile-menu {
        display: none;
    }
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 767.98px) {
    .auth-modern .auth-page--with-nav {
        align-items: flex-start;
        min-height: auto;
        padding: 1.5rem .7rem 2.5rem;
    }

    .auth-modern .auth-card__header,
    .auth-modern .auth-card__body {
        padding: 1.25rem;
    }

    .auth-modern .auth-card {
        border-radius: 18px;
    }

    .auth-modern .auth-title {
        font-size: 1.55rem;
    }

    .auth-modern .auth-info {
        font-size: .82rem;
    }
}

/* Page d’authentification utilisant la navigation publique */
.auth-modern .auth-public-page {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 8% 12%,
            rgba(185, 133, 47, .08),
            transparent 25rem
        ),
        radial-gradient(
            circle at 92% 86%,
            rgba(36, 90, 77, .07),
            transparent 28rem
        ),
        #f5f0e7;
}

.auth-modern .auth-page--with-nav {
    min-height: calc(100vh - var(--nav-height, 78px));
    padding: 4rem 1rem;
}

.auth-modern .auth-card--wide {
    width: min(100%, 700px);
}

/* Bloc information */
.auth-modern .auth-info {
    display: flex;
    align-items: flex-start;
    gap: .9rem;

    margin-top: 1.5rem;
    padding: 1rem 1.1rem;

    color: #56645e;
    background: #f4f8f6;

    border: 1px solid #d8e5df;
    border-radius: 14px;

    font-size: .88rem;
    line-height: 1.7;
}

.auth-modern .auth-info__icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;

    width: 34px;
    height: 34px;

    color: #8f651f;
    background: #fff3d8;

    border: 1px solid #ead4aa;
    border-radius: 10px;
}

.auth-modern .auth-info__content {
    flex: 1;
    min-width: 0;
}

/* La carte QR doit rester flottante */
.auth-modern .desktop-mobile-app-card.public-mobile-app-card,
.auth-modern .public-mobile-app-card {
    position: fixed !important;
    top: auto !important;
    left: 1.15rem !important;
    bottom: 1.15rem !important;

    width: min(275px, calc(100vw - 2.3rem)) !important;
    margin: 0 !important;
}

/* Le QR doit être masqué hors survol */
.auth-modern .public-mobile-app-card .desktop-mobile-app-qrcode {
    display: none !important;
}

@media (max-width: 767.98px) {
    .auth-modern .auth-page--with-nav {
        min-height: auto;
        padding: 1.5rem .7rem 2.5rem;
    }

    .auth-modern .auth-card__header,
    .auth-modern .auth-card__body {
        padding: 1.25rem;
    }
}

/* ==========================================================================
   Auth intégrée au thème public
   ========================================================================== */

.auth-modern .auth-public-page {
    min-height: 100vh;
}

.auth-modern .auth-main {
    min-height: calc(100vh - 76px);
}

.auth-modern .auth-page--with-nav {
    min-height: calc(100vh - 76px);
    padding: 3.5rem 1rem;
}

/*
 * Le header public possède déjà sa hauteur et sa position.
 * On évite donc de recréer un décalage supplémentaire.
 */
.auth-modern .public-navbar + .auth-main {
    padding-top: 0;
}

/*
 * Sécurité supplémentaire :
 * la sidebar mobile et son overlay ne doivent jamais être visibles
 * sur ordinateur lorsqu’ils sont fermés.
 */
@media (min-width: 992px) {
    .auth-modern .navigation-sidebar {
        visibility: hidden;
        transform: translateX(-105%);
        pointer-events: none;
    }

    .auth-modern .navigation-sidebar.active,
    .auth-modern .navigation-sidebar.show,
    .auth-modern .navigation-sidebar.is-open {
        visibility: visible;
        transform: translateX(0);
        pointer-events: auto;
    }

    .auth-modern .navigation-sidebar-overlay {
        display: none;
    }
}

/* Carte d’installation mobile : ne doit pas occuper le flux de la page */
.auth-modern .desktop-mobile-app-card,
.auth-modern .public-mobile-app-card {
    position: fixed;
    z-index: 1040;
}

/* Mobile */
@media (max-width: 767.98px) {
    .auth-modern .auth-page--with-nav {
        min-height: auto;
        padding: 1.5rem .7rem 2.5rem;
    }
}

.auth-modern .auth-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-modern .auth-actions .auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

@media (max-width: 575.98px) {
    .auth-modern .auth-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .auth-modern .auth-actions .btn,
    .auth-modern .auth-actions .auth-link {
        width: 100%;
        text-align: center;
    }
}