@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

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

body {
    font-family: "Poppins", Arial, sans-serif;
    background-color: #fff6ac;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    width: 90%; /* Ajustez si nécessaire */
    max-width: 1000px; /* Limiter la largeur du conteneur */
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-weight: 400;
    text-align: center;
    margin: 30px 0;
}

h1 span {
    font-weight: bold;
}

form#weight-form,
form.credential {
    width: 60%; /* Faites en sorte que le formulaire prenne toute la largeur du conteneur */
    padding: 15px;
    background-color: #fffde3; /* Ajoutez un fond pour plus de visibilité */
    border-radius: 8px; /* Ajoutez des coins arrondis */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Ajoutez une ombre */
}

form .div-form {
    display: flex;
    flex-direction: column;
    margin-top: 15px;
}

form .div-form input,
form .div-form select,
form .div-form button,
form .div-form label {
    align-self: center;
    width: 100%; /* Étendre ces éléments à la largeur du formulaire */
    max-width: 350px; /* Limiter la largeur si nécessaire */
}

form .div-form label {
    margin-bottom: 5px;
}

form .div-form button {
    margin-top: 10px;
    padding: 10px 20px;
    width: 200px;
    border-radius: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

form .div-form button:hover {
    background-color: #3e9142;
}

.error {
    color: red;
    font-weight: bold;
    margin-bottom: 20px;
}
.success {
    color: green;
    font-weight: bold;
    margin-bottom: 20px;
}

.message {
    margin: 25px 0;
    text-align: center;
}

.success-message {
    color : #251590;
    font-weight: bold;
}

form#deco {
    text-align: right;
    margin-top: 15px;
}

form#deco button {
    background-color: #f44336;
    padding: 10px 20px;
    border-radius: 12px;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

form#deco button:hover {
    background-color: #ab1b1b;
}

.link-modification {
    margin: 25px 0;
    text-align: center;
}

.modification {
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 12px;
    background-color: rgb(0, 0, 255);
    color: #fff;
    transition: all 0.2s;
}

.modification:hover {
    background-color: rgb(0, 0, 128);
}

.credential:first-of-type {
    margin-bottom: 20px;
}

/* AJOUT : Sélecteur d’année */
#yearSelect {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    background-color: #fff;
    transition: border 0.2s, box-shadow 0.2s;
}

#yearSelect:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

/* Centrer le sélecteur d’année */
.div-form-year {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 25px 0;
}

/* CANVAS (petit espacement au-dessus du graphique) */
#weightChart {
    margin-top: 30px;
    width: 100%;
    max-width: 600px; /* le graphique sera plus large mais reste fluide */
    height: auto;   /*  Chart.js gère le ratio */
    display: block;
    margin-left: auto;
    margin-right: auto;
}
