/* =================================================================
   STYLES DE BASE (Desktop First)
   ================================================================= */

/* Reset et typographie */
body {
    font-family: "Fira Sans", serif;
    margin: 0 auto;
    background-position: center;
    background-color: #fff;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1, .sousTitre, .Merriweather {
    font-family: "Merriweather", serif;
}

h1 {
    font-size: 41px;
    margin-top: 20px;
    margin-bottom: 16px;
}

.sousTitre {
    font-style: italic;
    font-size: 18px;
    margin-bottom: 41px;
}

/* Classes utilitaires */
.text-red {
    color: #F22012;
}

.bg-red {
    background-color: #F22012;
}

.border-success {
    border-color: #43A047 !important;
}

.border-danger {
    border-color: #f44336 !important;
}
#page-authorize .btn.btn-deny,
.disabled {
    filter: saturate(0%);
}

/* Layout principal */
.container {
    padding: 0 20px;
    display: flex;
    height: 100vh;
    width: 100%;
    margin: auto 0;
    max-width: 2000px;
}

#logon {
    width: 400px;
    margin: auto 2%;
}

#deco {
    width: 70%;
    margin: auto 2%;
    max-width: 1500px;
    position: relative;
    /*max-height: 80vh;*/
    /*height: 100%;*/
}

/* Formulaires */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 11px 8px;
    border: 1px solid #000;
    border-radius: 3px;
    box-sizing: border-box;
}

.inputContainer {
    position: relative;
    margin-top: 0;
    margin-bottom: 25px;
}

.inputContainer label {
    font-family: "Inter", sans-serif;
    background-color: #fff;
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    margin-left: 5px;
    padding: 2px 4px;
    position: absolute;
    text-transform: uppercase;
    top: -10.5px;
    border-radius: 5px 5px 0 0;
}

.inputContainer input::placeholder {
    color: #d9d9d9;
    font-size: 14px;
    font-weight: 400;
    font-style: italic;
}

.inputContainer input[type=password] {
    padding-right: 3em;
}

.inputContainer input.code-input {
    padding-top: 8px;
}

/* Affichage/masquage mot de passe */
.inputContainer .statePassword {
    align-items: center;
    text-align: center;
    display: flex;
    height: 40px;
    position: absolute;
    right: 0;
    top: 0;
    width: 3em;
}

.inputContainer .statePassword span {
    width: 100%;
    padding: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.showHide img {
    width: 18px;
    height: 18px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.showHide:hover img {
    opacity: 0.5;
}

.show-password .eye-solid {
    display: none;
}

.show-password .eye-slash {
    display: inline-block !important;
}

/* Boutons */
.btn {
    padding: 12px 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#landing-page .btn,
#page-login .btn,
#page-mdpoublie .btn,
#page-resetmdp .btn,
#page-confirmation-email-newsletter .btn,
#page-authorize .btn{
    background-color: #F22012;
    color: white;
    width: 100%;
    transition: background-color 0.5s;
    padding: 14.5px;
    border-radius: 25px;
}

#page-mdpoublie .btn.retour {
    filter: saturate(0%);
}

#landing-page .btn:hover,
#page-login .btn:hover,
#page-mdpoublie .btn:hover,
#page-resetmdp .btn:hover,
#page-confirmation-email-newsletter .btn:hover,
#page-authorize .btn:hover{
    background-color: #D91C10;
}
#landing-page .btn{
    text-decoration: none;
    display: flex;
    justify-content: center;
}

#page-authorize .btn {
    margin-right: 10px;
}

/* Navigation et liens */
#connexion, #reinitmdp {
    margin-top: 15px;
}

.retourconnexion {
    margin-top: 16px;
}

.retourconnexion a {
    color: #000;
    display: inline-block;
    width: 100%;
    padding: 0.25em 0;
    transition: color 1s;
    text-align: center;
}

.retourconnexion a:hover {
    color: #000;
}

#loader{
    height: 0.825em;
    width: 0.825em;
    display: block;
    border: 2px solid #FFF;
    border-radius: 50%;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
}

/* Messages d'état */
.error {
    color: #f44336;
    margin-bottom: 15px;
}

.success {
    color: #4CAF50;
    margin-bottom: 15px;
}

.success, .error {
    animation: fadeIn 0.3s ease-in;
}

/* Focus sur les champs */
.code-input:focus {
    outline: none;
    border-color: #4CAF50 !important;
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

/* Scopes et autorisations */
.scope-list {
    margin: 20px 0;
}

.scope-item {
    margin-bottom: 10px;
}

.additional-scopes {
    background-color: #FFF9C4;
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 15px;
}

/* Éléments visuels */
kbd {
    background-color: #eee;
    border-radius: 3px;
    border: 1px solid #b4b4b4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
    color: #333;
    display: inline-block;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    white-space: nowrap;
}

/* Image de couverture */
.cover {
    width: 100%;
    /*height: 100%;*/
    background: url('/assets/img/cover-square.jpg') no-repeat center center;
    aspect-ratio: 1/1;
    max-height: 80vh;
    max-width: 80vh;
    background-size: cover;
    overflow: hidden;
    border-radius: 20px;
    position: relative;
    margin: auto;
}

.credit {
    color: white;
    font-family: "Inter", sans-serif;
    font-size: 10px;
    transform: rotate(-90deg);
    display: block;
    position: absolute;
    width: 100%;
    z-index: 1000;
    text-align: center;
    top: 50%;
    right: -48.5%;
    opacity: 0.4;
}

/* Marques */
.brand {
    position: absolute;
    bottom: 3%;
    left: 2%;
    right: 2%;
    width: auto;
    max-width: 77vh;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 5%;
}

.brand img {
    -webkit-filter: invert(100%);
    filter: invert(100%) drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.5));
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

/* Styles spéciaux */
#landing-page h1 span:before,
#page-confirmation-email-newsletter-success h1 span:before,
#page-mdpoublie h1 span:before {
    content: ".";
    position: absolute;
    color: #F22012;
    margin-left: 0.07em;
}
#page-confirmation-email-newsletter-success h1 span:before,
#landing-page h1 span:before{
    margin-left: 0.015em;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
#codeunique{
    display: flex;
    justify-content: center;
}
#code-unique-form {
    animation: slideIn 0.4s ease-out;
}

#loader{
    animation: spinner 1s linear infinite;
    margin-right: .5em;
}
@keyframes spinner {
    to { transform: rotate(360deg); }
}


/* =================================================================
   MEDIA QUERIES - RESPONSIVE
   ================================================================= */

/* Tablettes et mobiles (720px et moins) */
@media (max-width: 720px) {
    .container {
        max-width: 100%;
        width: 100%;
        flex-direction: column;
    }

    #deco, #logon {
        width: auto;
        margin: 0;
    }

    /* Reset des propriétés desktop pour #deco */
    #deco {
        position: static;
        max-height: none;
        height: auto;
    }

    h1 {
        font-size: 26px;
    }

    .sousTitre {
        font-size: 14px;
        margin-bottom: 33px;
    }

    #connexion {
        margin-top: 7px;
    }

    .retourconnexion {
        margin-bottom: 25px;
    }

    .cover {
        aspect-ratio: 4/3;
        background-position: center 66%;
        height: auto;
        max-width: 100%;
    }

    .credit {
        right: -47%;
    }

    .brand {
        position: static;
        bottom: auto;
        width: auto;
        max-width: 40%;
        margin: 0 auto 27px;
        max-height: none;
        gap: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        left: auto;
        right: auto;
    }

    .brand img {
        margin-top: 27px;
        /* Reset des filtres desktop */
        filter: none;
        -webkit-filter: none;
        flex: none;
        min-width: auto;
        overflow: visible;
        user-drag: none;
        -webkit-user-drag: none;
        user-select: none;
        -moz-user-select: none;
        -webkit-user-select: none;
        -ms-user-select: none;
    }

    #brand-edl,
    #brand-aboliv,
    #brand-rdsevres {
        max-width: 100%;
    }

    #brand-edl-ecole {
        margin: 27px 12% 0;
    }

    #brand-max,
    #brand-kili {
        margin: 27px 24% 0;
    }

    .Logo {
        margin-top: 40px;
    }
}

/* Mobiles étroits (640px et moins) */
@media (max-width: 640px) {
    .credit {
        font-size: 0.75em;
    }
}

/* Très petits écrans (320px et moins) */
@media (max-width: 320px) {
    .credit {
        font-size: 0.5em;
    }
}