:root {
    --primary-color: #2563eb; /* Bleu moderne */
    --primary-dark: #1e40af;
    --accent-green: #10b981; /* Vert Succès */
    --accent-red: #ef4444;   /* Rouge Débit */
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --radius: 12px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    line-height: 1.5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Header */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Calculator Wrapper */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    align-items: start;
}

@media (max-width: 768px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Form Styling */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 15px;
    padding-left: 35px; /* Espace pour le € */
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.currency-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 600;
}

.input-wrapper input:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    box-sizing: border-box;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Custom Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.checkbox-wrapper label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 400;
}

/* Buttons */
.btn-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: #f1f5f9;
    color: var(--text-muted);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    margin-top: 10px;
}

.btn-reset:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

/* Results Box */
.calculator-results {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.calculator-results.active {
    opacity: 1;
    border-color: var(--primary-color);
    background: #eff6ff; /* Bleu très pâle */
}

.result-header {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 700;
}

.result-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.small-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.result-line.negative span:last-child {
    color: var(--accent-red);
}

.result-divider {
    height: 1px;
    background: #cbd5e1;
    margin: 15px 0;
}

.result-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--primary-dark);
}

.total-value {
    color: var(--accent-green);
    font-size: 1.6rem;
}

.disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 20px;
    font-style: italic;
    text-align: center;
}

/* SEO Content Section */
.seo-content {
    margin-top: 50px;
    padding: 30px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.seo-content h2 {
    color: var(--primary-dark);
    margin-top: 0;
}

.seo-content h3 {
    margin-top: 25px;
    font-size: 1.2rem;
}

.seo-content p {
    color: #4b5563;
    line-height: 1.7;
}

/* --- Styles pour l'Article SEO --- */

.seo-content ul {
    padding-left: 20px;
    margin-bottom: 25px;
}

.seo-content li {
    margin-bottom: 10px;
    color: #374151;
}

/* Design des Tableaux */
.seo-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.95rem;
    background: #fff;
    border-radius: 8px;
    overflow: hidden; /* Pour les coins arrondis */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.seo-content th, 
.seo-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.seo-content th {
    background-color: #f8fafc;
    color: var(--primary-dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.seo-content tr:last-child td {
    border-bottom: none;
}

.seo-content tr:nth-child(even) {
    background-color: #f9fafb; /* Effet Zebra */
}

/* FAQ Styling */
.faq-item {
    background: #fdfdfd;
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.faq-item h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.faq-item p {
    margin-bottom: 0;
}

/* Correction typo titre article */
.seo-content h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
}

/* --- FOOTER MODERNE --- */

.site-footer {
    background-color: #1e293b; /* Couleur sombre "Slate" très pro */
    color: #94a3b8; /* Texte gris clair lisible */
    padding-top: 60px;
    padding-bottom: 30px;
    margin-top: 80px;
    font-size: 0.95rem;
    border-top: 1px solid #334155;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr; /* 3 Colonnes inégales */
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col h3 {
    color: #ffffff; /* Titres en blanc */
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-col p {
    line-height: 1.6;
    margin: 0;
}

/* Liens */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
    display: inline-block;
}

.footer-links a:hover {
    color: #3b82f6; /* Bleu au survol */
    padding-left: 5px; /* Petit effet de glissement */
}

/* Texte Légal plus petit */
.legal-text {
    font-size: 0.85rem;
    color: #64748b;
}

/* Partie Basse (Copyright) */
.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.made-with {
    font-weight: 500;
    color: #cbd5e1;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr; /* Une seule colonne */
        gap: 30px;
        text-align: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* --- Pages Légales --- */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    background: #fff;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.legal-page h2 {
    color: var(--primary-dark);
    margin-top: 35px;
    font-size: 1.4rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.legal-page h3 {
    color: #374151;
    margin-top: 25px;
    font-size: 1.1rem;
}

.legal-page p {
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 15px;
}

.last-update {
    margin-top: 50px;
    font-size: 0.85rem;
    color: #9ca3af;
    font-style: italic;
}

/* --- PAGE CONTACT --- */

.contact-container {
    max-width: 600px; /* Plus étroit que la page d'accueil pour le focus */
    margin: 0 auto;
}

.contact-card {
    background: #ffffff;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* Zone de texte */
textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif; /* Important pour textarea */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: vertical; /* L'utilisateur peut agrandir en hauteur seulement */
    min-height: 120px;
    box-sizing: border-box;
}

textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Bouton d'envoi (Bleu primaire) */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 10px;
}

.btn-submit:hover {
    background-color: var(--primary-dark);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* Feedback messages */
.form-feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
}

.form-feedback.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-feedback.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Lien email en bas */
.contact-info {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
}

.email-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
}

.email-link:hover {
    text-decoration: underline;
}