/*
 * Unicomm Theme — Page de connexion (pages anonymes).
 *
 * Restyle le DOM standard de GLPI 11 + plugin singlesignon SANS modifier le core.
 * Le logo (servi par front/logo.php), le titre et le sous-titre sont injectés
 * DANS la carte par js/login.js. Deux boutons empilés :
 *   - « Je suis un collaborateur » (SSO, plein) ;
 *   - « Je suis un client » (formulaire GLPI, contour).
 *
 * NB : l'URL du logo (js/login.js) suppose GLPI à la racine du domaine.
 */

/* ---- Fond institutionnel + trame technique ---- */
body.welcome-anonymous {
    background: linear-gradient(135deg, #e8eef2 0%, #f5f7f9 100%);
    min-height: 100vh;
    position: relative;
}

body.welcome-anonymous::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(90deg, rgba(58, 79, 92, 0.02) 0, transparent 1px, transparent 40px, rgba(58, 79, 92, 0.02) 41px),
        repeating-linear-gradient(0deg, rgba(58, 79, 92, 0.02) 0, transparent 1px, transparent 40px, rgba(58, 79, 92, 0.02) 41px);
}

/* On retire le logo GLPI flottant au-dessus de la carte : il est réinjecté dedans. */
.page-anonymous > .flex-fill .text-center:has(> .col-md > .glpi-logo) {
    display: none;
}

/* ---- Carte ---- */
.page-anonymous .main-content-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(58, 79, 92, 0.1);
    box-shadow: 0 4px 24px rgba(58, 79, 92, 0.10);
    overflow: hidden;
    position: relative;
}

/* Liseré dégradé en haut de la carte */
.page-anonymous .main-content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        transparent 0%, rgba(58, 79, 92, 0.3) 25%,
        rgba(58, 79, 92, 0.5) 50%, rgba(58, 79, 92, 0.3) 75%, transparent 100%);
    z-index: 2;
}

.page-anonymous .main-content-card .card-body {
    background: linear-gradient(to bottom, #fafbfc 0%, #ffffff 100%);
    position: relative;
    padding: 2rem 2.25rem 2.25rem;
}

/* Clin d'œil "code" discret dans les coins */
.page-anonymous .main-content-card .card-body::before {
    content: '{ }';
    position: absolute;
    top: 12px; right: 18px;
    font: bold 32px 'Courier New', monospace;
    color: rgba(58, 79, 92, 0.05);
    pointer-events: none;
}
.page-anonymous .main-content-card .card-body::after {
    content: '</>';
    position: absolute;
    bottom: 12px; left: 18px;
    font: bold 32px 'Courier New', monospace;
    color: rgba(58, 79, 92, 0.05);
    pointer-events: none;
}

/* ---- En-tête injecté (logo + titre + sous-titre) ---- */
.unicommtheme-header {
    text-align: center;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(58, 79, 92, 0.1);
    position: relative;
}
.unicommtheme-logo {
    display: block;
    max-width: 230px;
    max-height: 120px;
    height: auto;
    margin: 0 auto 1.1rem;
}
.unicommtheme-title {
    font-size: 22px;
    font-weight: 600;
    color: #3a4f5c;
    letter-spacing: -0.3px;
    margin: 0 0 6px;
}
.unicommtheme-subtitle {
    font-size: 15px;
    color: #6c757d;
    margin: 0;
}

/* ---- Boutons de choix (empilés) ---- */
.page-anonymous .singlesignon-login-buttons {
    gap: 0.75rem !important;
}

/* « Je suis un collaborateur » (SSO, plein) */
.page-anonymous .singlesignon-login-button {
    width: 100%;
    justify-content: center;
    white-space: normal;          /* évite le débordement du libellé */
    background: #3a4f5c !important;
    border: 1px solid #3a4f5c !important;
    color: #fff !important;
    font-weight: 600;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(58, 79, 92, 0.18);
}
.page-anonymous .singlesignon-login-button:hover {
    background: #2f414c !important;
    border-color: #2f414c !important;
    color: #fff !important;
}
.page-anonymous .singlesignon-login-button .singlesignon-login-label {
    white-space: normal;
}

/* « Je suis un client » (formulaire GLPI, contour) */
.page-anonymous .unicommtheme-client-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
    background: #fff;
    border: 1px solid #3a4f5c;
    color: #3a4f5c;
    font-weight: 600;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.page-anonymous .unicommtheme-client-btn:hover {
    background: #3a4f5c;
    color: #fff;
}

/* ---- Pied de page ---- */
/* Masque le copyright GLPI, on garde la mention société injectée par js/login.js */
.page-anonymous .text-muted.mt-3 .copyright {
    display: none;
}
.unicommtheme-footer {
    font-size: 13px;
    color: rgba(58, 79, 92, 0.7);
    margin-top: 4px;
}
