/* Convertisseur Cuisine, styles de l'outil.
   DA reprise de la ToolBox : fond degrade violet, conteneur blanc
   arrondi et ombre, cartes blanches. Les boutons sont un peu plus
   fonces que le motif d'origine pour garantir un contraste d'au moins
   4,5:1 entre le texte blanc et le fond. */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.tool-content {
    padding: 20px 0;
    display: grid;
    gap: 20px;
}

/* min-width: 0 sur les items de grille, sinon un select aux longs libelles
   ou un tableau impose sa largeur minimale a la piste et fait deborder la
   page sur mobile. */
.tool-content > *,
.convertisseur-form > .champ,
.resultat-mesures > li {
    min-width: 0;
}

.form-control {
    max-width: 100%;
}

/* Introduction sous le header */
.lead {
    font-size: 1.05em;
    line-height: 1.6;
    color: #2c3e50;
    background: #f8f9fa;
    border-left: 4px solid #2471a3;
    border-radius: 8px;
    padding: 15px 20px;
}

/* Cartes */
.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3em;
    font-weight: 600;
}

.card h2 i {
    color: #2471a3;
}

.card h3 {
    color: #2c3e50;
    margin: 20px 0 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.card p {
    line-height: 1.6;
    margin-bottom: 10px;
}

.card p:last-child {
    margin-bottom: 0;
}

/* Formulaire du convertisseur */
.convertisseur-form {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) 2fr 2fr auto;
    gap: 15px;
    align-items: end;
}

.champ label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    color: #212529;
    background: #f8f9fa;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-control:focus {
    border-color: #2471a3;
    background: white;
    outline: 3px solid rgba(36, 113, 163, 0.35);
    outline-offset: 1px;
}

.champ-aide {
    margin-top: 12px;
    font-size: 13px;
    color: #595959;
}

/* Boutons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(145deg, #2471a3, #1b5a85);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 113, 163, 0.35);
}

.btn:active {
    transform: translateY(0);
}

/* Exemples rapides */
.exemples {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.exemples-titre {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.exemple {
    padding: 8px 14px;
    border: 2px solid #2471a3;
    border-radius: 20px;
    background: white;
    color: #1b5a85;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.exemple:hover {
    background: #2471a3;
    color: white;
    transform: translateY(-1px);
}

/* Panneau de resultat */
.resultat {
    margin-top: 20px;
    background: #f0f6fb;
    border: 1px solid #cfe3f2;
    border-radius: 10px;
    padding: 20px;
}

.resultat-placeholder {
    color: #44515e;
    font-style: italic;
    margin: 0;
}

.resultat-titre {
    color: #1b5a85;
    font-size: 1.15em;
    font-weight: 600;
    margin: 0 0 15px;
}

.resultat-principal {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.resultat-principal .valeur {
    flex: 1 1 180px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.resultat-principal .nombre {
    display: block;
    font-size: 1.6em;
    font-weight: 700;
    color: #1b5a85;
}

.resultat-principal .legende {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #595959;
}

.resultat-sous-titre {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.resultat-mesures {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.resultat-mesures li {
    background: white;
    border-radius: 6px;
    padding: 10px 12px;
    color: #2c3e50;
}

.resultat-mesures .precision {
    color: #595959;
    font-size: 12px;
}

.resultat-note {
    font-size: 13px;
    color: #595959;
    margin: 0;
}

/* Tableau de reference */
.table-scroll {
    overflow-x: auto;
    margin-top: 10px;
}

.table-reference {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
    font-size: 14px;
}

.table-reference caption {
    caption-side: bottom;
    padding-top: 10px;
    font-size: 12px;
    color: #595959;
    text-align: left;
}

.table-reference th,
.table-reference td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table-reference thead th {
    background: #2c3e50;
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

.table-reference tbody th {
    font-weight: 600;
    color: #2c3e50;
}

.table-reference tbody tr:nth-child(even) {
    background: #f8f9fa;
}

/* FAQ */
.faq-item {
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-item h3 {
    margin: 0 0 8px;
}

.faq-item p {
    margin: 0;
    color: #333;
}

/* Liens et focus visibles au clavier */
a {
    color: #1976d2;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid #1b5a85;
    outline-offset: 2px;
}

/* Responsive : une colonne sous 768 px, aucun debordement de page */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
        border-radius: 10px;
    }

    .convertisseur-form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .champ-bouton .btn {
        width: 100%;
        justify-content: center;
    }

    .card {
        padding: 18px;
    }
}

@media (max-width: 480px) {
    .tool-content {
        padding: 10px 0;
    }

    .resultat-principal .nombre {
        font-size: 1.3em;
    }
}

/* Impression : l'outil interactif et la pub n'ont pas d'interet */
@media print {
    body {
        background: white;
    }

    .container {
        box-shadow: none;
        margin: 0;
    }

    .exemples,
    .champ-bouton {
        display: none;
    }
}
