/* ============================================================
   SSO Admin — base commune des écrans d'authentification.
   Chargé globalement par header.php (avant style<Page>.css).
   Habillage moderne partagé par login et création de mot de passe :
   glassmorphism, dégradés, glow au survol. Les spécificités de
   chaque page (largeur, en-tête, icône) restent dans style<Page>.css.
   ============================================================ */

/* ---- Fond clair MyCos ---------------------------------------- */
body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f3f6;
    color: #00044c;
    font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
}

main {
    width: 100%;
}

/* ---- Conteneur / carte glassmorphism ------------------------- */
.container-center {
    margin: 0 auto;
    padding: 24px;
}

.card {
    position: relative;
    border: 1px solid #e6e9f2;
    border-radius: 22px;
    background: #ffffff;
    box-shadow:
        0 20px 50px -24px rgba(15, 27, 61, 0.28),
        0 6px 16px -12px rgba(15, 27, 61, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    overflow: hidden;
    animation: card-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(26px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Overlay de chargement : recouvre tout l'encadré de la carte ---- */
.login-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.94);
    z-index: 20;
}

.login-loading-svg {
    width: 72px;
    height: auto;
}

/* ---- En-tête ------------------------------------------------- */
.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    padding: 26px 28px 10px;
}

.card-header h3 {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #C9A227;
    font-size: 2rem;
}

.login-brand-light {
    font-weight: 400;
    color: #428BCA;
}

.card-header small {
    color: #6b7794;
    display: block;
    margin-top: 2px;
    font-size: 1rem;
}

/* Icône d'en-tête : badge image 90x90, halo pulsé */
.header-icon {
    width: 90px;
    height: 90px;
    display: block;
    border-radius: 22px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow:
        0 10px 22px -8px rgba(66, 139, 202, 0.9),
        0 0 0 6px rgba(66, 139, 202, 0.12);
    animation: icon-glow 3.2s ease-in-out infinite;
}

@keyframes icon-glow {
    0%, 100% { box-shadow: 0 10px 22px -8px rgba(66, 139, 202, 0.9), 0 0 0 6px rgba(66, 139, 202, 0.12); }
    50%      { box-shadow: 0 12px 30px -6px rgba(66, 139, 202, 1),   0 0 0 12px rgba(66, 139, 202, 0.04); }
}

/* ---- Corps / formulaire -------------------------------------- */
.card-body {
    padding: 24px 28px 30px;
}

.form-label {
    color: #33405f;
    letter-spacing: 0.01em;
    margin-bottom: 0.4rem;
}

/* Groupe d'input arrondi avec anneau de focus lumineux */
.input-group {
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.08);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    overflow: hidden;
}

.input-group:focus-within {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(66, 139, 202, 0.65),
        0 0 0 5px rgba(66, 139, 202, 0.16),
        0 10px 24px -12px rgba(66, 139, 202, 0.55);
}

.input-group-text {
    border: none;
    background: transparent;
    color: #8a93ab;
    padding-left: 16px;
    transition: color 0.25s ease;
}

.input-group:focus-within .input-group-text {
    color: #428bca;
}

.form-control {
    border: none;
    background: transparent;
    padding: 12px 14px;
    color: #0f1b3d;
}

.form-control::placeholder {
    color: #aab1c4;
}

.form-control:focus {
    border-color: transparent;
    box-shadow: none;
    background: transparent;
}

/* ---- Classe « afficher / masquer » le mot de passe ------------ */
/* Se fond dans le champ : même gris que les icônes, aucun cadre.  */
.toggle-password {
    display: flex;
    align-items: center;
    color: #8a93ab;
    padding: 0 16px;
    cursor: pointer;
    transition: color 0.25s ease;
}

.toggle-password:hover,
.toggle-password:active,
.toggle-password[aria-pressed="true"] {
    color: #428bca;
}

/* ---- Bouton : dégradé + glow au survol ----------------------- */
.btn-primary {
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-border-color: transparent;
    position: relative;
    padding: 11px 30px;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #4aa3ff 0%, #428bca 45%, #3a7fbf 100%);
    box-shadow: 0 10px 24px -10px rgba(66, 139, 202, 0.9);
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.btn-primary::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: saturate(1.15);
    box-shadow:
        0 16px 32px -10px rgba(66, 139, 202, 1),
        0 0 22px rgba(74, 163, 255, 0.6);
    color: #fff;
}

.btn-primary:hover::after {
    left: 130%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px -10px rgba(66, 139, 202, 0.9);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(74, 163, 255, 0.4);
}

/* ---- Alerte d'erreur affinée --------------------------------- */
.alert-danger {
    border: 1px solid rgba(220, 53, 69, 0.25);
    border-radius: 14px;
    background: rgba(255, 235, 238, 0.9);
    color: #a1212f;
    box-shadow: 0 8px 20px -12px rgba(220, 53, 69, 0.5);
    animation: shake 0.45s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ---- Accessibilité : réduit les animations si demandé -------- */
@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after,
    .card,
    .header-icon,
    .btn-primary::after,
    .alert-danger {
        animation: none;
    }
}
