/* =====================================================================
   MECAPRO — Devis en ligne V2
   Style épuré / professionnel — charte groupemecapro.com (#086399, Open Sans)
   ===================================================================== */

.mecapro-devis-wrapper {
    --mp-primary:      #086399;
    --mp-primary-dark: #064d77;
    --mp-ink:          #1b2733;   /* titres / texte des champs */
    --mp-text:         #3a4753;   /* texte courant */
    --mp-muted:        #6a7681;   /* texte secondaire */
    --mp-line:         #e4e9ee;   /* filets / séparateurs */
    --mp-line-strong:  #cfd8e0;   /* bordures de champs */
    --mp-bg-soft:      #f6f8fa;
    --mp-req:          #c0392b;
    --mp-success:      #1f9d57;
    --mp-error:        #d33a3a;
    --mp-white:        #ffffff;
    /* Couleur des boutons d'action (surchargée en ligne par les réglages) */
    --mp-accent:       #086399;
    --mp-accent-dark:  #064d77;
    --mp-radius:       8px;
    --mp-radius-sm:    6px;
    --mp-font:         "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    max-width: 640px;
    margin: 40px auto;
    font-family: var(--mp-font);
    color: var(--mp-text);
    -webkit-font-smoothing: antialiased;
    background: var(--mp-white);
    border: 1px solid var(--mp-line);
    border-top: 3px solid var(--mp-primary);
    border-radius: var(--mp-radius);
    box-shadow: 0 1px 2px rgba(16, 42, 67, .04), 0 10px 30px rgba(16, 42, 67, .05);
    overflow: hidden;
}

.mecapro-devis-wrapper *,
.mecapro-devis-wrapper *::before,
.mecapro-devis-wrapper *::after { box-sizing: border-box; }

/* Éléments décoratifs retirés (style épuré) */
.mp-header-icon,
.mp-badges,
.mp-ico { display: none !important; }

/* Contenu réservé aux lecteurs d'écran */
.mp-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* ============ EN-TÊTE ============ */
.mp-header {
    padding: 24px 30px 20px;
    background: var(--mp-white);
    border-bottom: 1px solid var(--mp-line);
    text-align: left;
}
.mp-header-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}
.mp-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 5px;
    color: var(--mp-ink);
    letter-spacing: -0.2px;
}
.mp-subtitle {
    font-size: 14px;
    color: var(--mp-muted);
    margin: 0;
    line-height: 1.5;
    max-width: 520px;
}

/* Sélecteur de langue — segmenté discret */
.mp-lang {
    display: inline-flex;
    border: 1px solid var(--mp-line-strong);
    border-radius: var(--mp-radius-sm);
    overflow: hidden;
}
.mp-lang-btn {
    border: none;
    background: var(--mp-white);
    color: var(--mp-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.mp-lang-btn + .mp-lang-btn { border-left: 1px solid var(--mp-line-strong); }
.mp-lang-btn:hover { color: var(--mp-ink); }
.mp-lang-btn.active { background: var(--mp-primary); color: #fff; }

/* ============ ÉTAPES ============ */
.mp-steps {
    padding: 18px 30px;
    background: var(--mp-white);
    border-bottom: 1px solid var(--mp-line);
}
.mp-progress {
    height: 3px;
    background: var(--mp-line);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}
.mp-progress-fill {
    height: 100%; width: 0%;
    background: var(--mp-primary);
    transition: width .35s ease;
}
.mp-steps-row { display: flex; justify-content: space-between; gap: 8px; }
.mp-step { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mp-step-number {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--mp-bg-soft);
    border: 1px solid var(--mp-line-strong);
    color: var(--mp-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 700;
    flex-shrink: 0;
    transition: background .2s, color .2s, border-color .2s;
}
.mp-step.active .mp-step-number,
.mp-step.completed .mp-step-number {
    background: var(--mp-primary);
    border-color: var(--mp-primary);
    color: #fff;
}
.mp-step-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--mp-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mp-step.active .mp-step-label { color: var(--mp-ink); }

/* ============ PANNEAUX ============ */
.mecapro-devis-form { background: var(--mp-white); }
.mp-panel { display: none; padding: 26px 30px 30px; }
.mp-panel.active { display: block; animation: mpFade .25s ease; }
@keyframes mpFade { from { opacity: 0; } to { opacity: 1; } }

.mp-panel-title {
    font-size: 16px; font-weight: 700;
    color: var(--mp-ink);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--mp-line);
}

/* ============ CHAMPS ============ */
.mp-group { margin-bottom: 18px; }
.mp-group label {
    display: flex; align-items: center; gap: 5px;
    font-size: 13px; font-weight: 600;
    color: var(--mp-text);
    margin-bottom: 7px;
}
.mp-req { color: var(--mp-req); font-weight: 700; }
.mp-opt { color: var(--mp-muted); font-weight: 400; font-size: 12px; }

.mp-group input[type="text"],
.mp-group input[type="email"],
.mp-group input[type="tel"],
.mp-group select,
.mp-group textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--mp-line-strong);
    border-radius: var(--mp-radius-sm);
    font-size: 15px;
    font-family: inherit;
    line-height: 1.4;
    color: var(--mp-ink);
    background-color: var(--mp-white);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.mp-group input:focus,
.mp-group select:focus,
.mp-group textarea:focus {
    border-color: var(--mp-primary);
    box-shadow: 0 0 0 3px rgba(8, 99, 153, .12);
}
.mp-group input.mp-invalid,
.mp-group select.mp-invalid,
.mp-group textarea.mp-invalid {
    border-color: var(--mp-error);
    box-shadow: 0 0 0 3px rgba(211, 58, 58, .10);
}
.mp-group textarea { resize: vertical; min-height: 118px; }

/* --- Robustesse face au thème du site : empêcher le texte de devenir
       blanc/invisible au focus, à la sélection ou à l'autocomplétion.
       (priorité élevée volontaire pour passer devant le thème) --- */
.mecapro-devis-wrapper .mp-group input,
.mecapro-devis-wrapper .mp-group input:focus,
.mecapro-devis-wrapper .mp-group input:active,
.mecapro-devis-wrapper .mp-group input:hover,
.mecapro-devis-wrapper .mp-group textarea,
.mecapro-devis-wrapper .mp-group textarea:focus,
.mecapro-devis-wrapper .mp-group textarea:active,
.mecapro-devis-wrapper .mp-group select,
.mecapro-devis-wrapper .mp-group select:focus {
    color: #1b2733 !important;
    -webkit-text-fill-color: #1b2733 !important;
    background-color: #ffffff !important;
    caret-color: #086399;
    opacity: 1 !important;
}
.mecapro-devis-wrapper .mp-group input::selection,
.mecapro-devis-wrapper .mp-group textarea::selection {
    background: rgba(8, 99, 153, .18);
    color: #1b2733;
}
.mecapro-devis-wrapper .mp-group input:-webkit-autofill,
.mecapro-devis-wrapper .mp-group input:-webkit-autofill:hover,
.mecapro-devis-wrapper .mp-group input:-webkit-autofill:focus,
.mecapro-devis-wrapper .mp-group textarea:-webkit-autofill {
    -webkit-text-fill-color: #1b2733 !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    caret-color: #086399;
}
.mecapro-devis-wrapper .mp-group input::placeholder,
.mecapro-devis-wrapper .mp-group textarea::placeholder {
    color: var(--mp-muted) !important;
    -webkit-text-fill-color: var(--mp-muted) !important;
    opacity: 1 !important;
}

/* Select : chevron discret */
.mp-select-wrap { position: relative; }
.mp-select-wrap::after {
    content: '';
    position: absolute;
    right: 14px; top: 50%;
    width: 8px; height: 8px;
    border-right: 2px solid var(--mp-muted);
    border-bottom: 2px solid var(--mp-muted);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}
.mp-group select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    padding-right: 36px;
    cursor: pointer;
}

.mp-error { display: none; font-size: 12px; color: var(--mp-error); margin-top: 5px; }
.mp-error.visible { display: block; }

.mp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Honeypot — invisible */
.mp-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px; overflow: hidden;
}

/* ============ PIÈCES JOINTES ============ */
.mp-dropzone {
    position: relative;
    border: 1px dashed var(--mp-line-strong);
    border-radius: var(--mp-radius-sm);
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: var(--mp-bg-soft);
}
.mp-dropzone:hover, .mp-dropzone.dragover {
    border-color: var(--mp-primary);
    background: rgba(8, 99, 153, .03);
}
.mp-dropzone-icon { width: 30px; height: 30px; color: var(--mp-muted); margin-bottom: 8px; }
.mp-dropzone-text { font-size: 14px; color: var(--mp-text); margin: 0 0 4px; }
.mp-dropzone-browse { color: var(--mp-primary); font-weight: 600; text-decoration: underline; }
.mp-dropzone-hint { font-size: 12px; color: var(--mp-muted); margin: 0; line-height: 1.5; }
.mp-file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.mp-file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mp-file-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 13px;
    background: var(--mp-bg-soft);
    border: 1px solid var(--mp-line);
    border-radius: var(--mp-radius-sm);
    font-size: 13px;
}
.mp-file-info { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.mp-file-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--mp-muted); }
.mp-file-name { font-weight: 600; color: var(--mp-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-file-size { font-size: 12px; color: var(--mp-muted); flex-shrink: 0; }
.mp-file-remove {
    background: none; border: none; cursor: pointer;
    color: var(--mp-muted); padding: 4px; border-radius: 4px;
    display: flex; align-items: center; transition: color .15s, background .15s; flex-shrink: 0;
}
.mp-file-remove:hover { color: var(--mp-error); background: rgba(211, 58, 58, .08); }
.mp-file-remove svg { width: 15px; height: 15px; }

/* ============ RÉCAPITULATIF ============ */
.mp-recap {
    background: var(--mp-bg-soft);
    border: 1px solid var(--mp-line);
    border-radius: var(--mp-radius-sm);
    padding: 4px 20px;
    margin-bottom: 20px;
}
.mp-recap-row { padding: 12px 0; border-bottom: 1px solid var(--mp-line); }
.mp-recap-row:last-child { border-bottom: none; }
.mp-recap-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
    color: var(--mp-muted); margin-bottom: 3px;
}
.mp-recap-value { font-size: 15px; color: var(--mp-ink); font-weight: 600; word-break: break-word; }
.mp-recap-desc { font-weight: 400; font-size: 14px; white-space: pre-wrap; line-height: 1.55; color: var(--mp-text); }

/* ============ RGPD ============ */
.mp-rgpd { margin-top: 4px; }
.mp-checkbox-label {
    display: flex !important; align-items: flex-start; gap: 10px;
    cursor: pointer; font-size: 13px !important; color: var(--mp-text) !important;
    line-height: 1.5; font-weight: 400 !important;
}
.mp-checkbox-label input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.mp-checkmark {
    width: 18px; height: 18px; min-width: 18px;
    border: 1px solid var(--mp-line-strong); border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s; margin-top: 1px;
}
.mp-checkbox-label input:checked + .mp-checkmark { background: var(--mp-primary); border-color: var(--mp-primary); }
.mp-checkbox-label input:checked + .mp-checkmark::after {
    content: ''; width: 5px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg); margin-top: -2px;
}
.mp-checkbox-label input:focus-visible + .mp-checkmark { box-shadow: 0 0 0 3px rgba(8, 99, 153, .2); }
.mp-checkmark.mp-invalid { border-color: var(--mp-error); box-shadow: 0 0 0 3px rgba(211, 58, 58, .10); }

/* ============ BOUTONS ============ */
.mp-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 12px; }
.mp-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px;
    border: 1px solid transparent; border-radius: var(--mp-radius-sm);
    font-size: 15px; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: background .15s, color .15s, border-color .15s; line-height: 1.2;
}
.mp-btn svg { width: 17px; height: 17px; }
.mp-btn-next, .mp-btn-submit, .mp-btn-new {
    background: var(--mp-accent); color: #fff; margin-left: auto;
}
.mp-btn-next:hover, .mp-btn-submit:hover, .mp-btn-new:hover { background: var(--mp-accent-dark); }
.mp-btn-submit { padding: 12px 26px; }
.mp-btn-prev {
    background: transparent; color: var(--mp-muted);
    border-color: transparent; padding-left: 6px;
}
.mp-btn-prev:hover { color: var(--mp-ink); }
.mp-btn-submit:disabled { opacity: .6; cursor: not-allowed; }
.mp-btn-submit.mp-loading { pointer-events: none; }
.mp-btn-submit.mp-loading svg { display: none; }
.mp-btn-submit.mp-loading::before {
    content: ''; width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
    border-radius: 50%; animation: mpSpin .6s linear infinite;
}
@keyframes mpSpin { to { transform: rotate(360deg); } }
.mp-btn:focus-visible { outline: 2px solid rgba(8, 99, 153, .5); outline-offset: 2px; }

/* ============ SUCCÈS ============ */
.mp-success { text-align: center; padding: 50px 36px; animation: mpFade .3s ease; }
.mp-success-icon {
    width: 56px; height: 56px; margin: 0 auto 18px;
    background: rgba(31, 157, 87, .10); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.mp-success-icon svg { width: 28px; height: 28px; color: var(--mp-success); }
.mp-success h3 { font-size: 20px; font-weight: 700; color: var(--mp-ink); margin: 0 0 10px; outline: none; }
.mp-success p { font-size: 14.5px; color: var(--mp-muted); margin: 0 auto 26px; line-height: 1.6; max-width: 420px; }

/* ============ ERREUR GLOBALE ============ */
.mp-global-error {
    background: rgba(211, 58, 58, .06);
    border: 1px solid rgba(211, 58, 58, .25);
    border-radius: var(--mp-radius-sm);
    padding: 11px 14px; margin-bottom: 18px;
    font-size: 14px; color: var(--mp-error);
    display: flex; align-items: center; gap: 9px;
}
.mp-global-error svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
    .mecapro-devis-wrapper { margin: 16px 10px; }
    .mp-header { padding: 20px 18px 18px; }
    .mp-title { font-size: 18px; }
    .mp-steps { padding: 16px 18px; }
    .mp-step-label { display: none; }
    .mp-panel { padding: 22px 18px 26px; }
    .mp-row { grid-template-columns: 1fr; gap: 0; }
    .mp-actions { flex-direction: column-reverse; gap: 8px; }
    .mp-btn { width: 100%; justify-content: center; }
    .mp-btn-next, .mp-btn-submit, .mp-btn-new { margin-left: 0; }
    .mp-success { padding: 36px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .mecapro-devis-wrapper *, .mp-progress-fill { animation: none !important; transition: none !important; }
}
