/* =========================
   Variables
   ========================= */

:root {
    --primary: #0d6efd;
    --primary-hover: #0b5ed7;
    --background: #f8f9fa;
    --surface: #ffffff;
    --border: #dee2e6;
    --text: #333;
    --muted: #666;
    --success: #198754;
    --success-bg: #e6ffed;
    --danger: #dc3545;
    --danger-bg: #ffe5e5;
}


/* =========================
   Style global
   ========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
}


/* =========================
   Header
   ========================= */

header {
    background-color: var(--primary);
    color: white;
    padding: 1rem;
    text-align: center;
    font-size: 1.5rem;
}


/* =========================
   Navigation
   ========================= */

nav {
    background-color: #e9ecef;
    border-bottom: 1px solid var(--border);
}

nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0.75rem 1rem;
}

nav ul li {
    margin: 0;
}

nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

nav a:hover {
    text-decoration: underline;
}


/* =========================
   Contenu
   ========================= */

main,
section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: var(--surface);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}


/* =========================
   Formulaires
   ========================= */

form {
    width: 100%;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select {
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;

    border: 1px solid #ccc;
    border-radius: 5px;

    background-color: white;
    font: inherit;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}


/* =========================
   Boutons
   ========================= */

button,
input[type="submit"] {
    background-color: var(--primary);
    color: white;

    border: none;
    border-radius: 5px;

    padding: 0.6rem 1rem;

    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

button:hover,
input[type="submit"]:hover {
    background-color: var(--primary-hover);
}

button:focus,
input[type="submit"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}


/* =========================
   Images
   ========================= */

img {
    max-width: 100%;
    height: auto;
}


/* =========================
   Tableaux
   ========================= */

.table-style {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;

    background-color: var(--surface);

    border-radius: 10px;
    overflow: hidden;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.table-style th,
.table-style td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.table-style th {
    background-color: #f0f0f0;
    font-weight: 600;
}

.table-style tr:hover {
    background-color: #f9f9f9;
}

.table-style tr:last-child td {
    border-bottom: none;
}


/* =========================
   Messages
   ========================= */

p[style*="color:red"] {
    color: var(--danger) !important;
    background-color: var(--danger-bg);
    border: 1px solid var(--danger);
    padding: 0.75rem;
    border-radius: 5px;
}

p[style*="color:green"] {
    color: var(--success) !important;
    background-color: var(--success-bg);
    border: 1px solid var(--success);
    padding: 0.75rem;
    border-radius: 5px;
}


/* =========================
   Footer
   ========================= */

footer {
    margin-top: 2rem;
    padding: 1rem;

    background-color: var(--primary);
    color: white;

    text-align: center;
}


/* =========================
   Mobile
   ========================= */

@media (max-width: 600px) {
    header {
        font-size: 1.25rem;
    }

    main,
    section {
        margin: 1rem;
        padding: 1rem;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    .table-style {
        display: block;
        overflow-x: auto;
    }
}