@import url("./variables.css");

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    min-height:100vh;
    font-family:'Montserrat',Arial,sans-serif;
    overflow:hidden;
    background:#f5f7fa;
}

/* SPLASH */

.splash{
    position:fixed;
    inset:0;
    z-index:9999;
    pointer-events:none;
}

.splash-panel{
    position:absolute;
    left:0;
    width:100%;
    height:50%;
    transition:transform 1.2s ease;
}

.splash-top{
    top:0;
    background:#D62828;
}

.splash-bottom{
    bottom:0;
    background:#0B4B3A;
}

.splash-line {
    position:absolute;
    top:50%;
    left:0;
    width:100%;
    height:4px;
    background:#E53935;
    transform:translateY(-50%);
}

.splash-logo{
    position:absolute;
    top:50%;
    left:50%;
    width:340px;
    transform:translate(-50%,-50%);
    filter:brightness(0) invert(1);
    z-index:10000;
}

.splash.open .splash-top{
    transform:translateY(-100%);
}

.splash.open .splash-bottom{
    transform:translateY(100%);
}

.splash.open .splash-logo{
    opacity:0;
}

/* PAGE */

.login-page{
    height:100vh;
    display:grid;
    grid-template-columns:52% 48%;
}

/* GAUCHE */

.login-visual{
    position:relative;
    overflow:hidden;

    background:
    linear-gradient(
        rgba(5,40,31,.72),
        rgba(5,40,31,.90)
    ),
    url('../images/bg-construction.webp');

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

    display:flex;
    align-items:center;
}

.login-visual-content{
    position:relative;
    z-index:2;
    padding-left:70px;
    max-width:650px;
    color:white;
}

.login-logo-left{
    width:280px;
    margin-bottom:90px;
    filter:brightness(0) invert(1);
}

.red-line-top{
    width:60px;
    height:4px;
    background:white;
    margin-bottom:30px;
}

.login-title{
    font-size:76px;
    line-height:1.05;
    font-weight:800;
    margin-bottom:30px;
}

.login-title span{
    color:#E53935;
}

.login-text{
    font-size:22px;
    line-height:1.7;
    max-width:470px;
}

.login-features{
    margin-top:80px;
    display:flex;
    gap:50px;
}

.login-feature{
    display:flex;
    flex-direction:column;
    gap:12px;
    font-size:14px;
}

.login-feature i{
    font-size:34px;
}

/* DROITE */

.login-panel{
    position:relative;

    background:
    linear-gradient(
        rgba(255,255,255,.92),
        rgba(255,255,255,.95)
    ),
    url('../images/bg-construction.webp');

    background-size:cover;
    background-position:center;

    display:flex;
    justify-content:center;
    align-items:center;

    clip-path:polygon(
        12% 0,
        100% 0,
        100% 100%,
        0 100%,
        6% 50%
    );

    border-left:4px solid #E53935;
}

/* CARD */

.login-card{

    position:relative;
    z-index:1;

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

    background:rgba(255,255,255,.96);

    padding:42px;

    border-radius:32px;

    box-shadow:
    0 25px 70px rgba(0,0,0,.12);

}

.login-avatar{
    width:70px;
    height:70px;

    border-radius:50%;

    background:#FCEAEA;

    color:#E53935;

    margin:0 auto 25px;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:28px;
}

.login-card h2{
    text-align:center;
    color:#073328;
    font-size:42px;
    margin-bottom:12px;
}

.login-subtitle{
    text-align:center;
    color:#6B7280;
}

.login-card-line{
    width:60px;
    height:4px;
    background:white;
    margin:25px auto 35px;
}

.form-group{
    margin-bottom:22px;
}

.form-group label{
    display:block;
    margin-bottom:10px;
    font-weight:700;
    color:#073328;
}

.input-wrapper{
    display:flex;
    align-items:center;
    gap:12px;

    border:1px solid #D8DDE3;

    border-radius:12px;

    height:56px;

    padding:0 16px;

    background:white;
}

.input-wrapper i{
    color:#073328;
}

.input-wrapper input{
    flex:1;
    border:none;
    outline:none;
    font-size:15px;
    background:transparent;
}

.toggle-password{
    border:none;
    background:none;
    cursor:pointer;
}

.login-button{
    width:100%;
    height:62px;

    border:none;

    border-radius:14px;

    background:white;

    color:white;

    font-size:18px;
    font-weight:700;

    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;

    cursor:pointer;
}

.login-button:hover{
    background:#c62828;
}

.forgot-password{
    margin-top:24px;
    text-align:center;
}

.forgot-password a{
    color:#073328;
    text-decoration:none;
    font-weight:700;
}

.secure-note{
    position:absolute;
    bottom:90px;

    text-align:center;

    color:#073328;

    font-weight:700;
}

.login-version{
    position:absolute;
    bottom:40px;
    color:#6B7280;
}

.login-error{
    display:none;
}

@media(max-width:1200px){

    .login-page{
        grid-template-columns:1fr;
    }

    .login-visual{
        display:none;
    }

    .login-panel{
        clip-path:none;
        border:none;
    }

}


.splash.open .splash-line{
    opacity:0;
    transition:none;
}





.login-card{
    animation:cardAppear .7s ease;
}

@keyframes cardAppear{

    from{
        opacity:0;
        transform:translateY(30px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }

}

.input-wrapper{
    background:white !important;
    border:1px solid #D8DDE3 !important;
}

.input-wrapper input{
    color:#073328 !important;
}

/* Champs de connexion : neutraliser le bleu natif/autofill et
   harmoniser les interactions avec la charte DUHALDE. */
.login-card .input-wrapper{
    transition:border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.login-card .input-wrapper:focus-within{
    border-color:#0C6551 !important;
    box-shadow:0 0 0 3px rgba(12,101,81,.10);
}
.login-card .input-wrapper input{
    min-width:0;
    width:100%;
    font-family:inherit;
    font-weight:500;
    line-height:1.4;
    caret-color:#0C6551;
    -webkit-appearance:none;
    appearance:none;
}
.login-card .input-wrapper input::placeholder{
    color:#929DA4;
    font-weight:400;
}
.login-card .input-wrapper input::selection{
    background:rgba(12,101,81,.16);
    color:#073328;
}
.login-card .input-wrapper input:-webkit-autofill,
.login-card .input-wrapper input:-webkit-autofill:hover,
.login-card .input-wrapper input:-webkit-autofill:focus{
    -webkit-text-fill-color:#073328 !important;
    -webkit-box-shadow:0 0 0 1000px #fff inset !important;
    box-shadow:0 0 0 1000px #fff inset !important;
    caret-color:#0C6551;
    transition:background-color 9999s ease-out 0s;
}
.login-card .toggle-password{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 28px;
    height:32px;
    border-radius:8px;
    color:#52655F;
    transition:background-color .18s ease,color .18s ease;
}
.login-card .toggle-password:hover{
    background:#F0F5F2;
    color:#073328;
}



.login-button{
    background:#E53935 !important;
    color:white !important;
}

.login-button:hover{
    background:#C62828 !important;
}


/* RESET / FORGOT PASSWORD */

.reset-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    background:
        linear-gradient(rgba(7,51,40,.82),rgba(7,51,40,.9)),
        url("../images/bg-construction.webp");
    background-size:cover;
    background-position:center;
    padding:24px;
}

.reset-card{
    width:100%;
    max-width:460px;
    background:rgba(255,255,255,.97);
    border-radius:28px;
    padding:44px;
    box-shadow:0 28px 70px rgba(0,0,0,.22);
    text-align:center;
    animation:cardAppear .55s ease;
}

.reset-logo{
    width:210px;
    margin-bottom:28px;
}

.reset-card h1{
    color:#073328;
    font-size:34px;
    margin-bottom:12px;
}

.reset-card p{
    color:#6B7280;
    font-size:15px;
    line-height:1.6;
    margin-bottom:26px;
}

.message-box{
    display:none;
    margin-bottom:20px;
    padding:14px 16px;
    border-radius:12px;
    font-weight:700;
    font-size:14px;
    line-height:1.4;
}

.message-box.success{
    display:block;
    background:#E8F5EE;
    color:#0B4B3A;
    border:1px solid #B7E1C8;
}

.message-box.error{
    display:block;
    background:#FDECEC;
    color:#C62828;
    border:1px solid #F3B8B8;
}

.back-link{
    display:inline-block;
    margin-top:24px;
    color:#073328;
    font-weight:700;
    text-decoration:none;
}

.back-link:hover{
    text-decoration:underline;
}


.login-overlay{

    position:fixed;
    inset:0;

    background:rgba(7,51,40,.45);

    backdrop-filter:blur(3px);

    display:flex;
    align-items:center;
    justify-content:center;

    opacity:0;
    visibility:hidden;

    transition:.25s;

    z-index:100000;

}

.login-overlay.active{

    opacity:1;
    visibility:visible;

}

.login-loader-card{

    width:240px;

    background:white;

    border-radius:22px;

    padding:30px;

    display:flex;
    flex-direction:column;
    align-items:center;
    gap:20px;

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

}

.login-spinner{

    width:54px;
    height:54px;

    border:5px solid #ececec;
    border-top:5px solid #D62828;

    border-radius:50%;

    animation:loginSpin .8s linear infinite;

}

.login-loader-card span{

    font-weight:700;
    color:#073328;

}

@keyframes loginSpin{

    to{

        transform:rotate(360deg);

    }

}

.modal-overlay{

    position:fixed;
    inset:0;

    display:none;

    align-items:center;
    justify-content:center;

    width:100vw;
    min-height:100vh;
    padding:24px;

    background:rgba(0,0,0,.45);

    z-index:2147483647;

    overflow:auto;

}

.modal-overlay.active{

    display:flex;

}

.modal{

    width:100%;
    max-width:430px;
    max-height:calc(100vh - 48px);

    background:#ffffff;

    border-radius:18px;

    overflow:hidden;

    box-shadow:0 25px 70px rgba(0,0,0,.25);

}

.modal-header{

    padding:22px 24px;

    background:#D62828;

    color:#ffffff;

}

.modal-header h2{

    margin:0;
    font-size:24px;

}

.modal-body{

    padding:34px 30px;

    color:#073328;

    font-size:20px;
    font-weight:600;
    line-height:1.8;

    text-align:center;

}

.modal-footer{

    padding:0 30px 30px;

    display:flex;
    justify-content:center;

}

.btn-principal{

    border:none;

    background:#D62828;

    color:#ffffff;

    padding:12px 22px;

    border-radius:10px;

    cursor:pointer;

    font-weight:700;

}

.btn-principal:hover{

    background:#B71C1C;

}

.premiere-connexion-modal{
    max-width:500px;
    border-radius:20px;
    box-shadow:0 28px 80px rgba(7,51,40,.24);
}

.premiere-connexion-modal .modal-header{
    padding:24px 30px;
}

.premiere-connexion-modal .modal-header h2{
    font-size:22px;
    line-height:1.25;
    letter-spacing:-.3px;
}

.premiere-connexion-body{
    padding:28px 30px 20px;
    text-align:left;
    font-size:14px;
    font-weight:400;
    line-height:1.55;
}

.premiere-connexion-body p{
    margin:0 0 10px;
    color:#36534c;
}

.premiere-connexion-body p:first-child{
    color:#073328;
    font-size:16px;
    font-weight:700;
}

.premiere-connexion-body .form-group{
    margin-top:18px;
}

.premiere-connexion-body .form-group label{
    display:block;
    margin-bottom:8px;
    color:#073328;
    font-size:13px;
    font-weight:700;
}

.premiere-connexion-body .input-wrapper{
    position:relative;
}

.premiere-connexion-body .input-wrapper input{
    height:52px;
    padding-right:52px;
    border-radius:12px;
    transition:border-color .18s ease, box-shadow .18s ease;
}

.premiere-connexion-body .input-wrapper input:focus{
    border-color:transparent;
    box-shadow:none;
    outline:none;
}

.premiere-connexion-body .premiere-password-toggle{
    position:absolute;
    right:8px;
    top:50%;
    transform:translateY(-50%);
    width:38px;
    height:38px;
    border:0;
    background:transparent;
    color:#58716b;
    cursor:pointer;
}

.premiere-connexion-body .login-error{
    margin:12px 0 2px;
    padding:10px 12px;
    border-radius:10px;
    background:#fff1f1;
    color:#b42318;
    font-size:13px;
    font-weight:600;
    line-height:1.4;
}

.premiere-connexion-modal .modal-footer{
    padding:6px 30px 28px;
}

.premiere-connexion-modal .btn-principal{
    min-width:190px;
    min-height:44px;
    border-radius:11px;
    transition:transform .15s ease, background .15s ease, opacity .15s ease;
}

.premiere-connexion-modal .btn-principal:hover:not(:disabled){
    transform:translateY(-1px);
}

.premiere-connexion-modal .btn-principal:disabled{
    cursor:wait;
    opacity:.75;
}
