* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, #ff9a9e, #fad0c4, #a1c4fd);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Bouton Back */
.back-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    padding: 12px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 2px;
    transition: 0.5s;
    border: none;
    background: linear-gradient(90deg, #ff9a9e, #a1c4fd);
    color: white;
    text-decoration: none;
    display: inline-block;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.back-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.container {
    position: relative;
    width: 400px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    animation: containerFloat 6s ease-in-out infinite;
}

@keyframes containerFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.form {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 40px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

form {
    width: 100%;
}

.alert-success {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
    font-size: 0.9em;
    text-align: center;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo span {
    font-size: 2.5em;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(45deg, #ff9a9e, #a1c4fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.inputBox {
    position: relative;
    width: 100%;
    margin-top: 30px;
}

.inputBox input {
    width: 100%;
    padding: 15px 20px;
    outline: none;
    font-size: 1em;
    color: #333;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: 0.5s;
}

.inputBox {
    position: relative;
    width: 100%;
    margin-top: 30px;
}

.inputBox input {
    width: 100%;
    padding: 18px 20px 12px 20px;
    outline: none;
    font-size: 1em;
    color: #333;
    border-radius: 10px;
    border: none;
    background: rgba(255,255,255,0.7);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: .3s;
}

.inputBox span {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 1em;
    color: #777;
    transition: .25s ease;
    background: transparent;
}

/* Quand on clique ou qu'il y a du texte */
.inputBox input:focus ~ span,
.inputBox input:not(:placeholder-shown) ~ span {
    top: -10px;
    left: 14px;
    transform: none;
    font-size: 0.75em;
    color: #6d9dfc;
    background: white;
    padding: 2px 8px;
    border-radius: 20px;
}

.inputBox input:valid,
.inputBox input:focus {
    border-bottom: 2px solid #a1c4fd;
}

#togglePassword {
    position: absolute;
    right: 15px;
    top: 17px;
    cursor: pointer;
    color: #666;
    font-size: 1.1em;
    z-index: 999;
}

.enter {
    position: relative;
    width: 100%;
    height: 50px;
    margin-top: 40px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 2px;
    transition: 0.5s;
    border: none;
    overflow: hidden;
    background: linear-gradient(90deg, #ff9a9e, #a1c4fd);
    color: white;
}

.enter:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.enter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
}

.links {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.links a {
    color: #666;
    text-decoration: none;
    font-size: 0.9em;
    transition: 0.3s;
}

.links a:hover {
    color: #a1c4fd;
}

.alert {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: rgba(255, 107, 107, 0.2);
    color: #d32f2f;
    font-size: 0.9em;
    text-align: center;
}

@media (max-width: 430px) {

    body {
        align-items: center !important;
        padding: 1rem !important;
        height: 100svh !important;
        overflow: hidden !important;
    }

    .back-btn {
        top: 1rem !important;
        left: 1rem !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.75rem !important;
        border-radius: 0.5rem !important;
    }

    .container {
        width: 92vw !important;
        height: auto !important;
        min-height: unset !important;
        padding: 0 !important;
        animation: none !important;
    }

    .form {
        padding: 1.75rem 1.25rem !important;
    }

    .logo {
        margin-bottom: 1rem !important;
    }

    .logo img {
        max-width: 90px !important;
    }

    .logo span {
        font-size: 1.75rem !important;
    }

    .inputBox {
        margin-top: 1.25rem !important;
    }

    .inputBox input {
        padding: 0.75rem 45px 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .inputBox span {
        left: 1rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 0 !important;
        font-size: 0.9rem !important;
    }

    /* Label flottant corrigé mobile */
    .inputBox input:focus ~ span,
    .inputBox input:not(:placeholder-shown) ~ span {
        top: -8px !important;
        left: 12px !important;
        transform: none !important;
        font-size: 0.65rem !important;
        color: #6d9dfc !important;
        background: white !important;
        padding: 2px 7px !important;
        border-radius: 20px !important;
    }

    #togglePassword {
        top: 14px !important;
        right: 12px !important;
        font-size: 1rem !important;
    }

    .alert,
    .alert-success {
        font-size: 0.8rem !important;
        padding: 0.6rem !important;
        margin-bottom: 0.75rem !important;
    }

    .enter {
        height: 42px !important;
        margin-top: 1.5rem !important;
        font-size: 0.85rem !important;
        letter-spacing: 0.1em !important;
    }

    .links {
        margin-top: 1.25rem !important;
    }

    .links a {
        font-size: 0.8rem !important;
    }
}