/*
 * Diagnostic express « Une panne ? Que vérifier avant d'appeler »
 * ---------------------------------------------------------------
 * Le visiteur choisit sa situation dans la liste de gauche ; la carte de
 * droite affiche les vérifications correspondantes et le bouton d'appel.
 * Le comportement (sélection, clavier) est dans js/diagnostic.js.
 *
 * Sans JavaScript, la liste de choix reste masquée et les quatre fiches
 * sont affichées l'une sous l'autre dans la carte.
 */

.diagnostic {
    scroll-margin-top: 110px; /* la barre de navigation est fixe en haut de page */
}

.diagnostic-intro {
    max-width: 640px;
    margin: -1.5rem auto 2.5rem;
    color: #555;
    font-size: 1.1rem;
    text-align: center;
}

.diagnostic-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    max-width: 760px;
    margin: 0 auto;
}

.diagnostic-layout.is-ready {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    max-width: none;
}

/* ----- Liste des situations ----- */
.diagnostic-choices {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}

.diagnostic-layout.is-ready .diagnostic-choices {
    display: flex;
}

.diagnostic-choice {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    min-height: 64px;
    padding: 1rem 1.2rem;
    border: 2px solid #e6e6e6;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.diagnostic-choice:hover {
    border-color: #ff3333;
    box-shadow: 0 6px 18px rgba(255, 51, 51, 0.18);
}

.diagnostic-choice:focus-visible {
    outline: 3px solid #ff3333;
    outline-offset: 3px;
}

.diagnostic-choice[aria-selected="true"] {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: #fff;
}

.diagnostic-choice-icon {
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.diagnostic-choice-label {
    flex: 1 1 auto;
}

.diagnostic-choice-arrow {
    flex-shrink: 0;
    color: #ff3333;
    font-size: 1.3rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.diagnostic-choice[aria-selected="true"] .diagnostic-choice-arrow {
    opacity: 1;
}

/* ----- Carte de réponse ----- */
.diagnostic-card {
    padding: 2rem;
    border-radius: 15px;
    background: #1a1a1a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #fff;
    transition: background-color 0.3s;
}

/* Situation dangereuse : la carte passe au rouge */
.diagnostic-card.is-urgent {
    background: #c40000;
}

.diagnostic-panel:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 6px;
    border-radius: 6px;
}

/* Sans JavaScript : les fiches se suivent, séparées par un filet */
.diagnostic-panel + .diagnostic-panel {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.diagnostic-layout.is-ready .diagnostic-panel + .diagnostic-panel {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.diagnostic-panel[hidden] {
    display: none;
}

.diagnostic-tag {
    margin: 0 0 0.6rem;
    color: #ff9c9c;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.diagnostic-card.is-urgent .diagnostic-tag {
    color: #fff;
}

.diagnostic-panel h3 {
    margin: 0 0 1.4rem;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1.2;
}

.diagnostic-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: diagnostic-step;
}

.diagnostic-steps li {
    position: relative;
    min-height: 2rem;
    padding-left: 3rem;
    font-size: 1.05rem;
    line-height: 1.5;
    counter-increment: diagnostic-step;
}

.diagnostic-steps li::before {
    content: counter(diagnostic-step);
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 700;
}

.diagnostic-call {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.8rem;
    padding: 0.9rem 1.5rem;
    border-radius: 12px;
    background: #fff;
    color: #1a1a1a;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.diagnostic-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.diagnostic-call-icon {
    font-size: 1.5rem;
}

.diagnostic-call-number {
    display: block;
    font-size: 1.35rem;
    font-weight: 900;
}

.diagnostic-note {
    margin: 1.2rem 0 0;
    color: #d6d6d6;
    font-size: 0.9rem;
    line-height: 1.5;
}

.diagnostic-card.is-urgent .diagnostic-note {
    color: #fff;
}

@media (max-width: 860px) {
    .diagnostic-layout.is-ready {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
    }

    .diagnostic-intro {
        margin: -0.75rem auto 1.5rem;
        font-size: 1rem;
    }

    .diagnostic-choice {
        min-height: 56px;
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }

    .diagnostic-card {
        padding: 1.4rem 1.2rem;
    }

    .diagnostic-panel h3 {
        font-size: 1.25rem;
    }

    .diagnostic-steps li {
        font-size: 1rem;
    }

    .diagnostic-call {
        display: flex;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .diagnostic-choice,
    .diagnostic-card,
    .diagnostic-call {
        transition: none;
    }
}
