:root {
  --color-primary-base: 32 62 97;
  --color-primary-gradient: 91 123 162;
  --color-primary-button-text: 32 62 97;
  --color-primary-button-alternative-text: 255 255 255;
  --color-secondary-base: 242 103 34;
  --color-secondary-gradient: 194 57 0;
  --color-secondary-button-text: 255 255 255;
  --color-tertiary-base: 68 68 68;
  --color-tertiary-gradient: 134 134 134;
  --color-tertiary-button-text: 68 68 68;
  --color-success-base: 122 166 12;
  --color-success-gradient: 84 125 0;
  --color-success-button-text: 255 255 255;
  --color-info-base: 53 132 228;
  --color-info-gradient: 0 94 187;
  --color-info-button-text: 255 255 255;
  --color-warning-base: 240 163 13;
  --color-warning-gradient: 188 115 0;
  --color-warning-button-text: 0 0 0;
  --color-danger-base: 224 27 36;
  --color-danger-gradient: 182 0 0;
  --color-danger-button-text: 255 255 255;
  --color-form-base: 32 62 97;
}

/* ==========================================
   SKYLINE EDUCATION - HORIZON
   THEME PERSONNALISE CHAMILO 3.0.2

   Pages concernees :
   - Accueil public /
   - Connexion /login
   - Recuperation du mot de passe

   ========================================== */


/* ==========================================
   1. FOND SKYLINE HORIZON
   ========================================== */

:is(
    body.page-login,
    body.page-home:has(.login-section #password),
    body.page-main:has(form#lost_password)
) {
    background-color: #0B1530 !important;
    background-image:
        url('/skyline/skyline-horizon-bg.svg') !important;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    min-height: 100vh;
}


/* ==========================================
   2. ACCUEIL PUBLIC
   ========================================== */

/* Masquer l'en-tete uniquement sur l'accueil
   comportant le formulaire de connexion */

body.page-home:has(.login-section #password)
.app-topbar {
    display: none !important;
}

/* Masquer l'en-tete de recuperation */

body.page-main:has(form#lost_password)
.app-topbar {
    display: none !important;
}

/* Chamilo conserve un padding meme lorsque la topbar est masquee.
   48px sur / pour aligner le haut de la carte avec /login.
   70px sur lostPassword.php pour supprimer le scroll de 15px. */

body.page-home:has(.login-section #password) .app-main {
    padding-top: 48px !important;
}

body.page-main:has(form#lost_password) .app-main {
    padding-top: 70px !important;
}

/* Centrer le formulaire d'accueil */

body.page-home:has(.login-section #password)
.app-main--no-sidebar
> .container:has(.login-section) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;

    gap: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Masquer les autres colonnes de l'accueil */

body.page-home:has(.login-section #password)
.app-main--no-sidebar
> .container:has(.login-section)
> :not(:has(.login-section)) {
    display: none !important;
}

/* Largeur du conteneur */

body.page-home:has(.login-section #password)
.app-main--no-sidebar
> .container:has(.login-section)
> div:has(> .login-section) {
    width: 100% !important;
    max-width: 448px !important;

    flex: none !important;
    margin: 0 auto !important;
    order: 0 !important;
}


/* ==========================================
   3. CARTES DES FORMULAIRES
   ========================================== */

:is(
    body.page-login .login-section,
    body.page-home:has(.login-section #password)
        .login-section,
    body.page-main:has(form#lost_password)
        form#lost_password
) {
    position: relative;
    display: block !important;
    box-sizing: border-box;

    width: 100%;
    max-width: 520px;

    height: auto !important;
    min-height: 0 !important;

    margin: 115px auto 24px !important;
    padding: 28px 40px 26px !important;

    background: #FFFFFF !important;
    border-radius: 24px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.20);

    overflow: visible;
}

/* La page d'accueil utilise un conteneur Chamilo different de /login.
   Fixer la carte a 448px, largeur observee sur /login. */

body.page-home:has(.login-section #password) .login-section {
    width: min(448px, 100%) !important;
    max-width: 448px !important;
    box-sizing: border-box !important;
}

/* Conteneur du formulaire de recuperation */

body.page-main:has(form#lost_password)
#sectionMainContent {
    width: 100%;
    box-sizing: border-box;
}

/* Largeur specifique de recuperation */

body.page-main:has(form#lost_password)
form#lost_password {
    width: min(448px, calc(100% - 32px));
    max-width: 448px;
}


/* ==========================================
   4. LOGO SKYLINE EDUCATION
   ========================================== */

:is(
    body.page-login .login-section,
    body.page-home:has(.login-section #password)
        .login-section,
    body.page-main:has(form#lost_password)
        form#lost_password
)::before {
    content: "";
    display: block;
    position: absolute;

    width: 250px;
    max-width: 80%;
    height: 85px;

    top: -108px;
    left: 50%;
    transform: translateX(-50%);

    background-image:
        url('/skyline/skyline-education-logo-net.svg');

    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;

    pointer-events: none;
}


/* ==========================================
   5. TITRES
   ========================================== */

:is(
    body.page-login .login-section__title,
    body.page-home:has(.login-section #password)
        .login-section__title,
    body.page-main:has(form#lost_password)
        form#lost_password h1
) {
    margin: 0 0 20px !important;
    padding: 0 !important;

    font-size: 28px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;

    text-align: center;
    color: #0B1530 !important;
}

/* Supprimer le trait sous le titre
   du mot de passe perdu */

body.page-main:has(form#lost_password)
form#lost_password h1 hr {
    display: none !important;
}


/* ==========================================
   6. FORMULAIRE DE CONNEXION
   ========================================== */

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section__form {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

/* Espacement des champs */

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section__form .field {
    margin-bottom: 16px !important;
}

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section__form .field:last-child {
    margin-bottom: 0 !important;
}

/* Champ mot de passe */

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section__form .p-password {
    width: 100%;
}

/* Identifiant et mot de passe */

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section__form
:is(#login, #password) {
    width: 100%;
    box-sizing: border-box;

    background: #F2F5FA;
    color: #0B1530;

    border-radius: 10px;
}

/* Focus */

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section__form
:is(#login, #password):focus {
    border-color: #164BFF;
}

/* Se souvenir de moi */

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section__remember-me {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}


/* ==========================================
   7. BOUTON DE CONNEXION
   ========================================== */

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section__buttons .p-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 48px;

    background: #164BFF !important;
    border-color: #164BFF !important;
    color: #FFFFFF !important;

    border-radius: 10px;
    font-weight: 600;

    transition: background-color 0.2s ease;
}

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section__buttons .p-button:hover {
    background: #103ADB !important;
    border-color: #103ADB !important;
}

/* Mot de passe oublie */

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section #forgot {
    color: #164BFF !important;
    font-weight: 500;
    text-decoration: none;
}

:is(
    body.page-login,
    body.page-home:has(.login-section #password)
) .login-section #forgot:hover {
    text-decoration: underline;
}


/* ==========================================
   8. RECUPERATION DU MOT DE PASSE
   ========================================== */

/* Champ et libelle */

body.page-main:has(form#lost_password)
#lost_password .field {
    margin-bottom: 16px !important;
}

/* Transformer le label flottant en
   libelle stable au-dessus du champ.
   Un vrai placeholder necessite du HTML ou JS. */

body.page-main:has(form#lost_password)
#lost_password .p-floatlabel {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
}

body.page-main:has(form#lost_password)
#lost_password .p-floatlabel label {
    position: static !important;
    display: block !important;
    order: -1;

    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;

    font-size: 14px !important;
    line-height: 1.4;
    color: #30425F !important;
    pointer-events: auto;
}

/* L'asterisque est presente en bas
   avec Information requise */

body.page-main:has(form#lost_password)
#lost_password .p-floatlabel label
.form_required {
    display: none !important;
}

/* Champ de saisie */

body.page-main:has(form#lost_password)
#lost_password_user {
    width: 100% !important;
    min-height: 56px;

    box-sizing: border-box;
    padding: 0 18px !important;

    background: #F2F5FA !important;
    color: #0B1530 !important;

    border: 1px solid #6E7D9A !important;
    border-radius: 10px !important;

    box-shadow: none !important;
    font-size: 16px;
}

body.page-main:has(form#lost_password)
#lost_password_user:focus {
    border-color: #164BFF !important;
    outline: 2px solid transparent;
    box-shadow:
        0 0 0 2px rgba(22, 75, 255, 0.15) !important;
}

body.page-main:has(form#lost_password)
#lost_password_user::placeholder {
    color: #93A9C5;
    opacity: 1;
}

/* Texte explicatif */

body.page-main:has(form#lost_password)
#lost_password .field small {
    display: block;
    margin-top: 12px;

    font-size: 14px;
    line-height: 1.55;
    color: #64748B !important;
}

/* Zone du bouton */

body.page-main:has(form#lost_password)
#lost_password .form-actions {
    margin: 22px 0 12px !important;
    padding: 0 !important;
}

/* Bouton Envoyer */

body.page-main:has(form#lost_password)
#lost_password_submit {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100% !important;
    min-height: 52px;
    margin: 0 !important;
    padding: 0 18px !important;

    background: #164BFF !important;
    border: 1px solid #164BFF !important;
    color: #FFFFFF !important;

    border-radius: 10px !important;
    box-shadow: none !important;

    font-size: 16px;
    font-weight: 600;
    cursor: pointer;

    transition: background-color 0.2s ease;
}

body.page-main:has(form#lost_password)
#lost_password_submit:hover {
    background: #103ADB !important;
    border-color: #103ADB !important;
}

/* ==========================================
   9. INFORMATION REQUISE
   ========================================== */

/* Conteneur sous le bouton */

body.page-main:has(form#lost_password)
#lost_password .form-group {
    display: block !important;
    width: 100%;
    margin: 8px 0 0 !important;
    padding: 0 !important;
}

/* Aligner l'asterisque et le texte
   sur une seule ligne */

body.page-main:has(form#lost_password)
#lost_password .form-group
.col-sm-10 {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 6px;

    width: 100% !important;
    max-width: 100% !important;
    float: none !important;

    margin: 0 !important;
    padding: 0 !important;

    text-align: left !important;
}

/* Asterisque */

body.page-main:has(form#lost_password)
#lost_password .form-group
.form_required {
    display: inline !important;
    margin: 0 !important;

    color: #64748B !important;
    font-size: 14px;
    font-weight: 700;
}

/* Information requise */

body.page-main:has(form#lost_password)
#lost_password .form-group small {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;

    color: #64748B !important;
    font-size: 13px;
    line-height: 1.4;
}




/* ==========================================
   10. MOBILE ET TABLETTE
   ========================================== */

@media (max-width: 700px) {

    :is(
        body.page-login,
        body.page-home:has(.login-section #password),
        body.page-main:has(form#lost_password)
    ) {
        background-attachment: scroll !important;
    }

    /* Conteneur accueil */

    body.page-home:has(.login-section #password)
    .app-main--no-sidebar
    > .container:has(.login-section)
    > div:has(> .login-section) {
        width: calc(100% - 32px) !important;
        max-width: 480px !important;
    }

    /* Cartes mobiles */

    :is(
        body.page-login .login-section,
        body.page-home:has(.login-section #password)
            .login-section,
        body.page-main:has(form#lost_password)
            form#lost_password
    ) {
        max-width: 480px;
        margin: 120px auto 24px !important;
        padding: 28px 24px !important;
        border-radius: 20px;
    }

    /* Eviter le debordement du formulaire */

    body.page-main:has(form#lost_password)
    form#lost_password {
        width: calc(100% - 32px);
    }

    /* Logos */

    :is(
        body.page-login .login-section,
        body.page-home:has(.login-section #password)
            .login-section,
        body.page-main:has(form#lost_password)
            form#lost_password
    )::before {
        width: 220px;
        height: 75px;
        top: -98px;
    }

    /* Titres */

    :is(
        body.page-login .login-section__title,
        body.page-home:has(.login-section #password)
            .login-section__title,
        body.page-main:has(form#lost_password)
            form#lost_password h1
    ) {
        font-size: 25px !important;
        margin-bottom: 20px !important;
    }
}


/* ==========================================
   11. PETITS SMARTPHONES
   ========================================== */

@media (max-width: 380px) {

    :is(
        body.page-login .login-section,
        body.page-home:has(.login-section #password)
            .login-section,
        body.page-main:has(form#lost_password)
            form#lost_password
    ) {
        padding: 24px 18px !important;
    }

    :is(
        body.page-login .login-section,
        body.page-home:has(.login-section #password)
            .login-section,
        body.page-main:has(form#lost_password)
            form#lost_password
    )::before {
        width: 190px;
        height: 65px;
        top: -88px;
    }

    :is(
        body.page-login .login-section__title,
        body.page-home:has(.login-section #password)
            .login-section__title,
        body.page-main:has(form#lost_password)
            form#lost_password h1
    ) {
        font-size: 23px !important;
    }
}



/* ==========================================
   FIN - SKYLINE EDUCATION HORIZON
   ========================================== */
