/* --- Style Général & Mobile First --- */
:root {
    --primary-color: #005a9c; /* Bleu France */
    --secondary-color: #e1000f; /* Rouge Marianne */
    --text-color: #161616;
    --bg-color: #f9f9f9;
    --border-color: #ddd;
    --success-color: #008753;
    --error-color: #d63626;
}

body {
    font-family: 'Marianne', Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

main {
    flex-grow: 1;
}

/* --- Header & Footer --- */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    border-bottom: 2px solid var(--secondary-color);
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

footer {
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* --- Formulaire de Recherche --- */
.search-section, .results-section {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

h2 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box; /* Important pour le padding */
}

.search-button {
    width: 100%;
    padding: 0.9rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #00437a;
}

/* --- Section des Résultats --- */
.result-message {
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
}

.result-message.loading {
    background-color: #eef6ff;
    border: 1px solid #b3d4fc;
}

.result-message.error {
    background-color: #fdecea;
    border: 1px solid var(--error-color);
    color: var(--error-color);
    font-weight: bold;
}

.result-message.not-found {
    background-color: #fff8e5;
    border: 1px solid #ffc84a;
}

.result-item {
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-item strong {
    color: var(--primary-color);
}

.download-button {
    padding: 0.7rem 1rem;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 0.5rem;
    align-self: flex-start; /* Aligne le bouton à gauche */
}

.download-button:hover {
    background-color: #006941;
}

/* --- Media Queries pour Desktop --- */
@media (min-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .search-button {
        width: auto;
        padding: 0.9rem 2rem;
    }
    
    .result-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .download-button {
        margin-top: 0;
    }
}
