/* Variables de couleurs */
:root {
    --primary-green: #335233;
    --secondary-green: #7a997a;
    --light-green: #749c74;
    --hover-green: #3a5d3a;
    --accent-green: #709670;
    --dark-green: #003300;
    --light-gray: #f0f0f0;
    --border-gray: #cccccc;
    --white: #ffffff;
    --black: #000000;
    --gray: #666666;
}

body {
    background: linear-gradient(0.25turn, rgba(255,255,255,1) 0%, rgba(167,167,167,1) 25%, rgba(0,0,0,1) 50%, rgba(167,167,167,1) 75%, rgba(255,255,255,1) 100%);
    font-family: Verdana, Arial, sans-serif;
    color: var(--black);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    font-size: 1rem;
    line-height: 1.4;
}

#container {
    flex: 1;
    margin: 1.25rem auto;
    width: 80%;
    max-width: 50rem;
}

/* Header/Footer */
header, footer {
    background-color: var(--primary-green);
    color: var(--white);
    padding: 0.625rem;
    text-align: center;
    border: 0.125rem outset #2e492e;
}

header h1 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: bold;
}

footer {
    margin-top: auto;
}

/* Navigation */
nav {
    background-color: var(--secondary-green);
    padding: 0.625rem;
    text-align: center;
    border: 0.125rem outset #436c43;
}

nav a {
    margin: 0 0.625rem;
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    padding: 0.1875rem 0.375rem;
}

nav a:hover {
    text-decoration: underline;
    background-color: var(--hover-green);
}

/* Conteneurs */
.welcome, .dossier-list, .message-list, .add-form {
    background-color: var(--white);
    border: 0.125rem inset var(--border-gray);
    padding: 0.9375rem;
    margin: 0.9375rem 0;
    color: var(--black);
}

.welcome {
    text-align: center;
}

.welcome h2 {
    margin: 0 0 0.625rem 0;
    font-weight: bold;
}

.welcome a, .card-link {
    color: var(--dark-green);
    text-decoration: underline;
    font-weight: bold;
}

.welcome a:hover, .card-link:hover {
    color: #001a00;
    background-color: #e6ffe6;
}

.dossier-list, .message-list {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Messages */
.message {
    background-color: var(--white);
    border: 0.125rem inset var(--border-gray);
    padding: 0;
    margin-bottom: 0.625rem;
    display: table;
    width: 100%;
    table-layout: fixed;
}

.message-avatar {
    display: table-cell;
    width: 4.375rem;
    padding: 0.5rem;
    background-color: var(--light-gray);
    border-right: 0.0625rem solid var(--border-gray);
    vertical-align: top;
    text-align: center;
}

.message-avatar img {
    width: 3.75rem;
    height: 3.75rem;
    border: 0.125rem inset var(--border-gray);
    background-color: var(--white);
    display: block;
    margin: 0 auto;
}

.message-body {
    display: table-cell;
    vertical-align: top;
}

.message-user {
    background-color: var(--gray);
    color: var(--white);
    padding: 0.3125rem 0.625rem;
    font-weight: bold;
    border-bottom: 0.0625rem solid var(--border-gray);
}

.message-content {
    padding: 0.625rem;
    background-color: var(--white);
    color: var(--black);
    line-height: 1.4;
}

.message-date {
    text-align: right;
    font-size: 0.875rem;
    color: var(--black);
    border-top: 0.0625rem solid var(--border-gray);
    padding: 0.3125rem 0.625rem;
    background-color: var(--light-gray);
}

/* Dossiers */
.dossier {
    background-color: var(--white);
    border: 0.125rem inset var(--border-gray);
    margin-bottom: 0.625rem;
    width: 100%;
}

.dossier-title {
    background-color: var(--light-green);
    color: var(--white);
    padding: 0.625rem 0.9375rem;
    font-weight: bold;
    border-bottom: 0.0625rem solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.0625rem;
}

.dossier-title a {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.0625rem;
}

.dossier-title a:hover {
    text-decoration: underline;
}

.blog-date {
    font-size: 0.9375rem;
    color: var(--white);
    font-weight: normal;
}

.dossier-desc {
    background-color: #f9f9f9;
    color: var(--black);
    padding: 0.5rem 0.625rem;
    font-weight: normal;
    border-top: 0.0625rem solid var(--border-gray);
}

/* Formulaires */
.add-form h3 {
    margin: 0 0 0.625rem 0;
    font-weight: bold;
}

.add-form label {
    font-weight: bold;
    display: block;
    margin: 0.5rem 0 0.125rem 0;
}

.add-form input[type="text"], 
.add-form input[type="password"], 
.add-form textarea {
    width: 95%;
    padding: 0.25rem;
    margin: 0.125rem 0 0.5rem 0;
    border: 0.125rem inset var(--border-gray);
    font-family: Verdana, Arial, sans-serif;
    background-color: var(--white);
    color: var(--black);
}

.add-form input[type="text"]:focus, 
.add-form input[type="password"]:focus, 
.add-form textarea:focus {
    outline: 0.125rem solid var(--dark-green);
    outline-offset: 0.0625rem;
    background-color: #fffef0;
}

.add-form textarea {
    resize: vertical;
    min-height: 3.75rem;
}

.add-form input[type="submit"] {
    background-color: var(--accent-green);
    color: var(--white);
    border: 0.125rem outset #74a174;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    font-family: Verdana, Arial, sans-serif;
    font-weight: bold;
    margin-top: 0.3125rem;
}

.width46 {
    width: 46%;
}

.double-form {
    display: flex;
    justify-content: space-between;
    gap: 3%;
}

/* Focus */
a:focus, button:focus, input:focus, textarea:focus, select:focus {
    outline: 0.125rem solid var(--dark-green);
    outline-offset: 0.125rem;
}

nav a:focus, .dossier-title a:focus {
    outline: 0.125rem solid var(--white);
    outline-offset: 0.125rem;
}

/* Skip links */
.skip-link {
    position: absolute;
    top: -2.5rem;
    left: 0.375rem;
    background-color: var(--dark-green);
    color: var(--white);
    padding: 0.5rem;
    text-decoration: none;
    border-radius: 0 0 0.25rem 0.25rem;
    z-index: 1000;
}

.skip-link:focus {
    top: 0;
}

/* Responsive */
@media (max-width: 37.5rem) {
    #container {
        width: 95%;
        margin: 0.625rem auto;
    }
    
    .double-form {
        flex-direction: column;
        gap: 0.625rem;
    }
    
    .width46 {
        width: 100%;
    }
    
    .message {
        display: block;
    }
    
    .message-avatar {
        display: block;
        width: auto;
        padding: 0.3125rem;
        border-right: none;
        border-bottom: 0.0625rem solid var(--border-gray);
        text-align: left;
    }
    
    .message-avatar img {
        display: inline-block;
        margin: 0 0.3125rem 0 0;
        vertical-align: middle;
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .message-body {
        display: block;
    }
    
    nav a {
        display: block;
        margin: 0.125rem 0;
        padding: 0.3125rem;
    }
}