/* =============================================================================
   forms.css — Tous les formulaires : contact, commande, coordonnées client.
   Structure HTML : <form class="card form"> … <div class="form-field">label + champ</div>
   ============================================================================= */

/* ---------- CHAMPS ---------- */

.form-field {
    padding: 0.5rem 0;
    text-align: left;
}

.form label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 700;
    color: var(--blue-dark);
}

.form input,
.form select,
.form textarea {
    width: 100%;
    padding: 0.4rem 1rem;
    border: none;
    border-radius: var(--radius-s);
    background-color: var(--grey-input);
    font-size: 0.9rem;
    color: #262626;
}

.form textarea {
    resize: vertical;
    min-height: 8rem;
}

.form ::placeholder {
    color: var(--grey-placeholder);
}

.form input:focus-visible,
.form select:focus-visible,
.form textarea:focus-visible {
    outline: 2px solid var(--green-light);
    outline-offset: 1px;
}

/* Case à cocher : case + texte sur la même ligne */
.form-field--check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.form .form-field--check input {
    width: auto;
}

.form .form-field--check label {
    margin: 0;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 0.9rem;
}

.form-field--check a {
    text-decoration: underline;
}

/* Champ piège anti-robots : hors de l'écran */
.form-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- COMMANDE ---------- */

/* Choix (livraison, quantité, « En main propre ») */
.form-choices {
    padding: 1rem 0;
    text-align: center;
}

.form-choices .form-field {
    display: inline-block;
    text-align: center;
}

.form-choices label {
    text-align: center;
}

.form-choices select {
    width: auto;
    min-width: 6rem;
}

/* Total de la commande */
.form-summary {
    padding: 1rem 0;
    text-align: center;
}

.form-summary .btn {
    margin-bottom: 1.5rem;
}

.form-summary p {
    margin-bottom: 0.4rem;
}

/* Petites mentions sous un bloc */
.card .form-note p {
    font-size: 0.75rem;
    text-align: left;
}

/* ---------- PARCOURS DE COMMANDE (components/commande.php) ---------- */

/* Étapes : 1. Livraison · 2. Vos informations · 3. Paiement sécurisé */
.order-steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    max-width: var(--content-max);
    margin: 1rem var(--gutter) 1.5rem;
    padding: 0;
    list-style: none;
}

.order-steps li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    font-size: 0.8rem;
    color: var(--grey-text);
    opacity: 0.6;
}

.order-step-number {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--grey-input);
    font-weight: 700;
}

.order-steps .is-current,
.order-steps .is-done {
    opacity: 1;
}

.order-steps .is-current .order-step-number {
    background-color: var(--green-dark);
    color: var(--white-pure);
}

.order-steps .is-done .order-step-number {
    background-color: var(--green-mint);
    color: var(--white-pure);
}

.order-steps .is-current .order-step-label {
    font-weight: 700;
}

/* Carte des points relais (Mondial Relay) */
.relay-picker {
    margin: 0.5rem 0 1rem;
    padding: 0;
    border: none;
}

.relay-picker[hidden] {
    display: none;
}

.relay-picker legend {
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--grey-dark);
}

.card .relay-help {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-style: normal;
    text-align: left;
}

/* Le widget Mondial Relay a son propre style : on lui laisse toute la largeur */
.relay-widget {
    width: 100%;
    min-height: 3rem;
    overflow: hidden;
    border-radius: var(--radius-s);
    font-size: 0.9rem;
}

.relay-widget input[type="text"] {
    width: auto;
}

/* Point relais choisi */
.relay-selected {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-s);
    background-color: var(--success-bg);
    color: var(--grey-dark);
    text-align: left;
}

.relay-selected[hidden] {
    display: none;
}

.relay-selected-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success-text);
}

.card .relay-error {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-s);
    background-color: var(--error-bg);
    font-style: normal;
}

/* Bouton « Suivant » bloqué tant qu'aucun point relais n'est choisi */
.order-next:disabled {
    filter: grayscale(0.8);
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Total mis en avant */
.order-total {
    font-size: 1.3rem;
}

/* Option secondaire sous un bloc (« Acheter sur place », « Revenir… ») */
.order-alt {
    padding: 1rem var(--gutter) 2rem;
    text-align: center;
}

/* Récapitulatif (étape 2) */
.order-summary {
    position: relative;
    margin-bottom: 1rem;
}

.order-summary dl {
    margin: 0;
}

.order-summary dl div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--grey-input);
}

.order-summary dd {
    margin: 0;
    font-weight: 700;
    white-space: nowrap;
}

.order-summary-relay dd {
    font-weight: 400;
    text-align: right;
    white-space: normal;
}

.order-summary-total {
    font-size: 1.15rem;
    border-bottom: none !important;
}

.order-summary-edit {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    text-decoration: underline;
    color: var(--green-dark);
}

.order-secure {
    margin-top: 1rem;
    text-align: center;
}

/* ---------- TABLETTE ET PLUS ---------- */

@media (min-width: 768px) {
    .order-steps {
        margin: 1.5rem auto 2rem;
    }

    .order-steps li {
        flex-direction: row;
        justify-content: center;
        font-size: 0.9rem;
    }

    .form-choices {
        display: flex;
        justify-content: space-around;
    }

    .form-field {
        width: 80%;
        margin: auto;
    }
}