/* Reset minimal pour éviter les conflits */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

/* Container homepage avec fond d'écran */
body:not(.form-page):not(.menu-page) {
    margin: 0;
    overflow: hidden;
    background-color: #f0f0f0;
}


.container:not(.form-container):not(.menu-page) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-image: url("../img/fond_home_page.png");
    background-size: cover;
    background-position: center;
    color: #333;
}

/* Body adjustments for menu page */
body.menu-page {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    min-height: 100vh;
}

/* Container adjustments for menu page */
.container.menu-page {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Titre homepage original */
.container:not(.form-container) h1 {
    font-size: 3em;
    margin-bottom: 20px;
    text-align: center;
    color: #08294b;
}


/* Boutons homepage originaux */
.buttons {
    display: flex;
    gap: 20px;
}

.buttons button {
    padding: 10px 20px;
    font-size: 1.2em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #08294b;
    color: white;
    transition: background-color 0.3s;
}

.buttons button:hover {
    background-color: #0a407a;
}



@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    .buttons {
        flex-direction: column;
    }
}

/* ========================================
   FORMULAIRES - DESIGN PRÉSERVÉ + RESPONSIVE
   ======================================== */

/* Body spécial pour les pages de formulaire */
body.form-page {
    font-family: sans-serif;
    background-color: #f0f0f0;
    background-image: url("../img/fond_home_page.png");
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-x: hidden;
}

/* Container formulaire avec design original */
.form-container {
    width: 350px;
    max-width: 90%;
    margin: 50px auto;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Titre formulaire */
.form-container h1 {
    text-align: center;
    color: #08294b;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

/* Labels originaux */
.form-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #08294b;
}

/* Inputs avec design original */
.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="password"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 25px;
    border: 1px solid #a4c9ef;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: transparent;
    color: #333;
}


/* Boutons formulaire avec design original */
.form-container button[type="submit"] {
    background-color: #08294b;
    color: #ffffff;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    width: 100%;
}


/* ========================================
   SECTIONS D'ERREUR - ALIGNÉES AVEC FORMULAIRE
   ======================================== */

.error-section {
    width: 350px;
    max-width: 90%;
    margin: 20px auto 30px auto;
    padding: 25px;
    background-color: rgba(254, 238, 238, 0.9);
    border: 2px solid #f88;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.message_error {
    color: #d32f2f;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.error-actions {
    margin-top: 1rem;
}

.error-actions p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95em;
}

.btn-login-error {
    display: inline-block;
    background-color: #08294b;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.btn-login-error:hover {
    background-color: #0a407a;
    color: white;
}

/* Footer formulaire */
.form-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.form-footer p {
    font-size: 0.9rem;
    color: #666;
}

.link-login {
    color: #08294b;
    text-decoration: none;
    font-weight: bold;
}

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

/* ========================================
   PAGE MENU - DESIGN ORIGINAL PRÉSERVÉ
   ======================================== */

body.menu-page {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    min-height: 100vh;
}

.container.menu-page {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Header navigation */
.header {
    background-color: rgba(8, 41, 75, 0.9);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    background-color: transparent;
    border: 1px solid white;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Styles menu existants préservés */
.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.welcome-section h1 {
    color: #08294b;
    font-size: 2.5em;
    margin-bottom: 0.5rem;
}

.welcome-section p {
    color: #666;
    font-size: 1.1em;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.menu-card {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #08294b;
}

.menu-icon {
    font-size: 3em;
    margin-bottom: 1rem;
    color: #08294b;
}

.menu-card h3 {
    color: #08294b;
    font-size: 1.4em;
    margin-bottom: 1rem;
}

.menu-card p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.menu-btn {
    background-color: #08294b;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
    width: 100%;
}

.menu-btn:hover {
    background-color: #0a407a;
}

/* ========================================
   RESPONSIVE DESIGN - PRÉSERVE LES STYLES
   ======================================== */

/* Mobile - Homepage */
@media (max-width: 768px) {
    /* Homepage responsive */
    .container:not(.form-container):not(.menu-page) h1 {
        font-size: 2em;
    }

    .buttons {
        flex-direction: column;
        gap: 15px;
    }

    .buttons button {
        padding: 12px 25px;
        font-size: 1.1em;
    }

    /* Formulaires responsive */
    .form-container {
        width: 95%;
        margin: 20px auto;
        padding: 30px 20px;
    }

    .form-container h1 {
        font-size: 1.75rem;
    }

    .error-section {
        width: 95%;
        margin: 15px auto 25px auto;
        padding: 20px;
    }

    /* Menu responsive */
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .container.menu-page {
        padding: 0 1rem;
    }

    .welcome-section h1 {
        font-size: 2em;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .form-container {
        padding: 20px 15px;
    }

    .form-container input[type="text"],
    .form-container input[type="email"],
    .form-container input[type="password"] {
        padding: 12px;
        margin-bottom: 20px;
    }

    .form-container button[type="submit"] {
        padding: 12px 25px;
        font-size: 1em;
    }

    .container:not(.form-container):not(.menu-page) h1 {
        font-size: 1.75em;
    }

    .buttons {
        width: 100%;
    }

    .buttons button {
        width: 100%;
    }
}

/* Écrans larges */
@media (min-width: 1200px) {
    .form-container {
        width: 400px;
    }

    .error-section {
        width: 400px;
    }
}

/* Hauteur d'écran courte (mode paysage mobile) */
@media (max-height: 600px) {
    body.form-page {
        justify-content: flex-start;
        padding-top: 20px;
    }

    .form-container {
        margin: 20px auto;
    }

    .container:not(.form-container):not(.menu-page) {
        justify-content: flex-start;
        padding-top: 50px;
    }
}