/* ===================== LAYOUT GLOBAL ===================== */

#mst-devis.mst-theme-dark {
    max-width: 100%;
    margin: 60px auto;
    padding: 0 24px;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #f5f5f7;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;

    background: #111213;
}

.mst-progress {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.mst-card {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: #151618;
    border-radius: 24px;
    padding: 32px 32px 34px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.80);
}

/* ===================== STEPPER ===================== */

.mst-progress-track {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0;
    height: 4px;
}

.mst-progress-dot {
    flex: 0 0 44px;
    height: 4px;
    border-radius: 999px;
    background: #2b2e33;
    transition: background 0.18s ease, opacity 0.18s ease;
}

.mst-progress-dot.active {
    background: #f5f5f7;
}

.mst-progress-dot.completed {
    background: #f5f5f7;
    opacity: 0.4;
}

/* ===================== HEADERS & FOOTERS ===================== */

.mst-step-header {
    margin-bottom: 24px;
}

.mst-step-header h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #f5f5f7;
}

.mst-step-header p {
    margin: 0;
    font-size: 14px;
    color: #aeb2c0;
}

.mst-step-footer {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===================== BOUTONS ===================== */

.mst-btn-primary,
.mst-btn-ghost {
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease, transform 0.12s ease, opacity 0.12s ease, box-shadow 0.15s ease;
}

.mst-btn-ghost {
    background: #191b1f;
    color: #f5f5f7;
    border: 1px solid #2b2e36;
    border-radius: 12px;
}

.mst-btn-ghost:hover {
    background: #1f2227;
}

.mst-btn-primary {
    background: #f5f5f7;
    color: #131416;
    border-radius: 12px;
}

.mst-btn-primary:hover {
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.mst-btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

/* on ne montre plus les .mst-next */
#mst-devis.mst-theme-dark .mst-next {
    display: none !important;
}

.mst-btn-large {
    padding: 12px 24px;
    font-size: 15px;
}

/* ===================== GRILLES ===================== */

.mst-grid {
    display: grid;
    gap: 18px;
}

.mst-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Responsive */
@media (max-width: 1024px) {
    .mst-grid-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .mst-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mst-card {
        padding: 24px 18px 26px;
        border-radius: 20px;
    }

    .mst-step-header h2 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .mst-grid-4 {
        grid-template-columns: 1fr;
    }

    #mst-devis.mst-theme-dark {
        padding: 0 12px;
    }
}

/* ===================== TUILES (appareil / marque / modèle / panne / qualité) ===================== */

.mst-device-grid,
.mst-option-grid {
    margin-top: 10px;
    margin-bottom: 20px;
}

/* style global tuiles */
#mst-devis.mst-theme-dark .mst-device-card,
#mst-devis.mst-theme-dark .mst-option-card {
    background: #1e2329 !important;
    border: none !important;
    border-radius: 22px !important;
    padding: 18px 22px !important;
    cursor: pointer;

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;

    color: #f5f5f7 !important;
    font-size: 15px;
    font-weight: 500;

    box-shadow: none !important;
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

/* hover */
#mst-devis.mst-theme-dark .mst-device-card:hover,
#mst-devis.mst-theme-dark .mst-option-card:hover {
    background: #2d353e !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35) !important;
}

/* active + glow subtil */
#mst-devis.mst-theme-dark .mst-device-card.active,
#mst-devis.mst-theme-dark .mst-option-card.active {
    background: #2d353e !important;
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.06),
        0 14px 34px rgba(0, 0, 0, 0.55),
        0 0 18px rgba(0, 0, 0, 0.75) !important;
}

#mst-devis.mst-theme-dark .mst-device-icon,
#mst-devis.mst-theme-dark .mst-option-icon {
    font-size: 20px;
    opacity: 0.9;
}

/* Logos des marques (structure par défaut) */
#mst-devis.mst-theme-dark .mst-option-icon-brand img {
    display: block;
    width: 60px;
    height: auto;
}

/* fallback texte accessibilité */
#mst-devis.mst-theme-dark .mst-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Pannes (texte un peu plus compact) */
.mst-issue-card {
    font-size: 14px;
    line-height: 1.3;
}

.mst-issue-card .mst-issue-price {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #d5d7df;
    opacity: 0.8;
}

/* ===================== QUALITÉ (bloc sous les pannes) ===================== */

#mst-quality-wrapper {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #202329;
}

/* ===================== SELECTS CACHÉS ===================== */

.mst-hidden-select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    height: 0;
}

/* ===================== SEARCH BARS ===================== */

.mst-search-bar {
    margin-top: 10px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #191b20;
    border-radius: 999px;
    padding: 8px 14px;
    border: 1px solid #262932;
}

.mst-search-icon {
    font-size: 14px;
    color: #8b909d;
}

.mst-search-bar input {
    border: none;
    background: transparent;
    outline: none;
    color: #f5f5f7;
    font-size: 14px;
    width: 100%;
}

.mst-search-bar input::placeholder {
    color: #6f7481;
}

/* ===================== STEP 5 : RÉCAP & FORM ===================== */

.mst-summary-card {
    margin-top: 4px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 16px;
    background: #191b20;
    border: 1px solid #2b2f37;
}

.mst-summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #c2c5d4;
    margin-bottom: 6px;
}

.mst-summary-line strong {
    color: #f5f5f7;
}

.mst-summary-line.mst-summary-price {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #2b2f37;
    font-size: 15px;
}

.mst-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.mst-form-grid label {
    font-size: 13px;
    color: #c0c3d2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mst-form-grid input {
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #2b2f37;
    background: #14161a;
    color: #f5f5f7;
    font-size: 14px;
    outline: none;
}

.mst-form-grid input:focus {
    border-color: #f5f5f7;
    box-shadow: 0 0 0 1px #f5f5f7;
}

.mst-form-grid textarea {
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #2b2f37;
    background: #14161a;
    color: #f5f5f7;
    font-size: 14px;
    outline: none;
    resize: vertical;
    min-height: 80px;
}

.mst-form-grid textarea:focus {
    border-color: #f5f5f7;
    box-shadow: 0 0 0 1px #f5f5f7;
}

/* Mise en forme plus premium du formulaire (étape 5) */
#mst-devis.mst-theme-dark .mst-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px 20px;
}

/* Chaque champ = label au-dessus, champ en dessous */
#mst-devis.mst-theme-dark .mst-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: #e5e7eb;
}

/* Inputs & textarea harmonisés */
#mst-devis.mst-theme-dark .mst-form-grid input,
#mst-devis.mst-theme-dark .mst-form-grid textarea {
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #2b2f37;
    background: #14161a;
    color: #f5f5f7;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#mst-devis.mst-theme-dark .mst-form-grid input:focus,
#mst-devis.mst-theme-dark .mst-form-grid textarea:focus {
    border-color: #f5f5f7;
    box-shadow: 0 0 0 1px #f5f5f7;
    background: #101218;
}

/* Le commentaire prend toute la largeur du grid */
#mst-devis.mst-theme-dark .mst-form-grid .mst-form-full {
    grid-column: 1 / -1;
}

/* Et il est plus grand, plus confortable */
#mst-devis.mst-theme-dark .mst-form-grid textarea[name="customer_comment"] {
    min-height: 130px;
    resize: vertical;
}

/* ===================== MESSAGE SUCCESS ===================== */

.mst-success {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: 16px;
    background: #152019;
    border: 1px solid rgba(82, 206, 122, 0.5);
    color: #e0ffe8;
}

.mst-success h3 {
    margin: 0 0 4px;
}

.mst-success p {
    margin: 0;
    font-size: 14px;
}

/* ===================== ORDRE VISUEL ÉTAPE 4 ===================== */

#mst-issue-grid {
    order: 1;
}

/* Forcer l'ordre visuel des éléments à l'étape 4 */
.mst-step[data-step="4"] {
    display: flex;
    flex-direction: column;
}

/* 1. Titre + texte explicatif */
.mst-step[data-step="4"] > .mst-step-header:first-of-type {
    order: 1;
}

/* 2. Grille des pannes */
.mst-step[data-step="4"] #mst-issue-grid {
    order: 2;
}

/* 3. Bloc qualité (titre + tuiles qualité) */
.mst-step[data-step="4"] #mst-quality-wrapper {
    order: 3;
}

/* 4. Footer (bouton Retour) */
.mst-step[data-step="4"] > .mst-step-footer {
    order: 4;
}

/* Bloc récap & formulaire un peu plus aéré */
#mst-devis.mst-theme-dark .mst-summary {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #151821;
    border: 1px solid #252b37;
}
/* ===================== MARQUES : logos plus gros & centrés (étape 2) ===================== */

.mst-step[data-step="2"] .mst-option-card {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 18px !important;
    gap: 10px;
}

/* Wrapper de l'icône / logo */
.mst-step[data-step="2"] .mst-option-icon-brand {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Les logos de marques : taille principale */
.mst-step[data-step="2"] .mst-option-icon-brand img {
    display: block;
    width: 90px;
    max-height: 60px;
    height: auto;
    object-fit: contain;
}

/* Titre de la marque sous le logo */
.mst-step[data-step="2"] .mst-option-label {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

/* Cacher le libellé texte sous les logos de marques */
.mst-brand-card .mst-option-label {
    display: none;
}

/* On s’assure qu’aucun label texte ne s’affiche dans les cartes de marques */
#mst-devis.mst-theme-dark .mst-brand-card .mst-option-label {
    display: none !important;
}


/* Image pour les cartes de modèles */
.mst-model-card .mst-option-icon-model {
    text-align: center;
    margin-bottom: 6px;
}

.mst-model-card .mst-option-icon-model img {
    display: block;
    width: 60px;
    height: auto;
    margin: 0 auto;
}

/* ========== FORMULAIRE : ÉTAT DES CHAMPS ========== */

#mst-devis.mst-theme-dark .mst-form-grid label {
    position: relative;
}

/* Bordures rouges quand erreur */
#mst-devis.mst-theme-dark .mst-form-grid .mst-field-error input,
#mst-devis.mst-theme-dark .mst-form-grid .mst-field-error textarea {
    border-color: #f97373;
    box-shadow: 0 0 0 1px rgba(249, 115, 115, 0.45);
}

/* Message d’erreur sous le champ */
#mst-devis.mst-theme-dark .mst-field-error-message {
    font-size: 12px;
    color: #f97373;
    margin-top: 4px;
}

/* ========== BOUTON AVEC LOADER ========== */

#mst-devis.mst-theme-dark #mst-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 190px;
}

#mst-devis.mst-theme-dark #mst-submit-btn .mst-submit-loader {
    display: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(229, 231, 235, 0.35);
    border-top-color: #f5f5f7;
    animation: mst-spin 0.6s linear infinite;
}

#mst-devis.mst-theme-dark #mst-submit-btn.mst-btn-loading .mst-submit-loader {
    display: inline-block;
}

#mst-devis.mst-theme-dark #mst-submit-btn.mst-btn-loading {
    opacity: 0.75;
    cursor: wait;
}

@keyframes mst-spin {
    to { transform: rotate(360deg); }
}