/* Impré'son — styles propres à la page suivi.html */

html,
body {
    min-height: 100vh;
    margin: 0;
    background-color: #f1f5f9;
}

body {
    display: flex;
    flex-direction: column;
    font-family: 'Inter', 'Inter Repli', sans-serif;
}

/* La carte garde la hauteur de son contenu ; le pied de page reste en bas (margin-top: auto) */
main {
    flex: 0 0 auto;
}

.bouton-action-suivi {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bouton-action-suivi:hover {
    background: var(--bleu-impres, #0a2540);
    color: #ffffff;
    border-color: var(--bleu-impres, #0a2540);
}

.bouton-action-atelier {
    background: #c2410c;
    color: white;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    margin-left: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.bouton-action-atelier:hover {
    background: #9a3412;
}

.corps-commandes tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.corps-commandes tr:hover {
    background: #f8fafc;
}

.corps-commandes td {
    padding: 0.85rem 0.5rem;
    color: #334155;
}

/* « Mes commandes » (centre connecté avec son code) : filtres par statut et pastilles de statut */
.filtres-commandes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
}

.filtre-commandes {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 36px;
}

.filtre-commandes[aria-pressed="true"] {
    background: var(--bleu-fonce, #0a2540);
    border-color: var(--bleu-fonce, #0a2540);
    color: #ffffff;
}

.info-liste-commandes {
    margin: 0 0 0.75rem;
    color: #475569;
    font-size: 0.88rem;
}

.info-liste-commandes button {
    background: none;
    border: none;
    padding: 0;
    color: var(--orange-action, #c2410c);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.pastille-statut {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #eff6ff;
    color: #1e40af;
    white-space: nowrap;
}

.pastille-statut.expediee { background: #ecfdf5; color: #047857; }
.pastille-statut.attente { background: #fff7ed; color: #9a3412; }
.pastille-statut.annulee { background: #f1f5f9; color: #64748b; }

.lien-colis {
    color: var(--orange-action, #c2410c);
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: 6px;
}

/* Pied de page calé en bas */
footer {
    flex-shrink: 0;
    margin-top: auto;
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 1.25rem 1rem;
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
}

/* Modale d'authentification Pro */
.modal-auth-fond {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.modal-auth-boite {
    background: #ffffff;
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: apparitionModal 0.2s ease-out;
}

@keyframes apparitionModal {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---------- Téléphone & tablette ---------- */

/* La carte blanche prend la largeur disponible : sans cela, son contenu le plus
   large (tableau, frise) l'élargissait au-delà de l'écran */
main.commande-container {
    width: 100%;
    box-sizing: border-box;
}

/* Frise de fabrication verticale quand les 6 étapes ne tiennent plus côte à côte */
@media (max-width: 800px) {
    .timeline {
        flex-direction: column;
        align-items: stretch;
        padding: 0.25rem 0;
        margin-top: 1.5rem !important;
    }

    .timeline::before,
    .timeline-progression {
        display: none;
    }

    .etape-suivi {
        flex-direction: row;
        width: auto;
        gap: 0.85rem;
        padding: 0.5rem 0;
    }

    /* Trait reliant chaque étape à la précédente, orange une fois l'étape atteinte */
    .etape-suivi::before {
        content: '';
        position: absolute;
        left: 14.5px;
        top: -0.5rem;
        height: 1rem;
        width: 3px;
        background: #e2e8f0;
    }

    #etape-1::before {
        display: none;
    }

    .etape-suivi.actif::before {
        background: var(--orange-impres, #ea580c);
    }

    .etape-cercle {
        flex-shrink: 0;
    }

    .etape-texte {
        text-align: left;
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    main.commande-container {
        width: calc(100% - 1.5rem);
        margin-top: 1rem !important;
    }

    .commande-header h1 {
        font-size: 1.6rem;
        line-height: 1.25;
        margin: 0 0 0.5rem;
    }

    .commande-header p {
        font-size: 0.95rem;
    }

    .recherche-suivi {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .recherche-suivi .bouton-validation {
        width: 100% !important;
        padding: 0.85rem 1rem !important;
        font-size: 1.05rem;
    }

    #resultat-suivi,
    .bloc-historique,
    .bloc-mes-commandes {
        padding: 1.25rem 1rem !important;
    }

    /* Boutons d'action de la commande : un par ligne, pleine largeur */
    #resultat-suivi button {
        width: 100%;
        justify-content: center;
    }
}

/* Historique : chaque commande devient une fiche lisible au lieu d'un tableau trop large
   (jusqu'à 700 px : entre 601 et 680 px, le tableau débordait encore et défilait de côté) */
@media (max-width: 700px) {
    .bloc-historique thead,
    .bloc-mes-commandes thead {
        display: none;
    }

    .bloc-historique table,
    .bloc-historique tbody,
    .bloc-mes-commandes table,
    .bloc-mes-commandes tbody,
    .corps-commandes tr,
    .corps-commandes td {
        display: block;
        width: 100%;
    }

    .corps-commandes tr {
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 0.75rem 0.9rem;
        margin-bottom: 0.75rem;
    }

    .corps-commandes td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.3rem 0;
        text-align: right;
    }

    .corps-commandes td:first-child {
        font-size: 1rem;
        justify-content: flex-start;
        gap: 0.4rem;
        padding-bottom: 0.45rem;
    }

    .corps-commandes td:nth-child(2)::before { content: "Date"; }
    .corps-commandes td:nth-child(3)::before { content: "Patient"; }
    .corps-commandes td:nth-child(4)::before { content: "Forme"; }
    .corps-commandes td:nth-child(5)::before { content: "Statut"; }

    .corps-commandes td::before {
        color: #64748b;
        font-weight: 600;
        text-align: left;
        flex-shrink: 0;
    }

    .corps-commandes td:last-child {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 0.6rem;
        text-align: left !important;
    }

    .corps-commandes td:last-child .bouton-action-atelier {
        margin-left: 0;
    }

    .corps-commandes .bouton-action-suivi,
    .corps-commandes .bouton-action-atelier {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        padding: 0.45rem 1rem;
    }
}
