/* ═══════════════════════════════════════════════════════════════
   PLOMBIER DEVIS WIDGET — CSS v2
   Animations pleine page, prix mis en avant, design pro
   ═══════════════════════════════════════════════════════════════ */

:root {
    --pdw-primary:    #1a73e8;
    --pdw-secondary:  #0d47a1;
    --pdw-success:    #2e7d32;
    --pdw-error:      #c62828;
    --pdw-bg:         #ffffff;
    --pdw-bg-alt:     #f8f9fa;
    --pdw-border:     #e0e0e0;
    --pdw-text:       #212121;
    --pdw-text-light: #616161;
    --pdw-shadow:     0 8px 32px rgba(26,115,232,.13);
    --pdw-radius:     16px;
    --pdw-anim:       320ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ciblé ── */
.pdw-widget *,
.pdw-widget *::before,
.pdw-widget *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ════════════════════════════════════════════
   CONTENEUR PRINCIPAL
════════════════════════════════════════════ */
.pdw-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    color: var(--pdw-text);
    background: var(--pdw-bg);
    border-radius: var(--pdw-radius);
    box-shadow: var(--pdw-shadow);
    border: 1px solid var(--pdw-border);
    max-width: 700px;
    margin: 32px auto;
    overflow: hidden;
}

/* ════════════════════════════════════════════
   EN-TÊTE
════════════════════════════════════════════ */
.pdw-header {
    background: linear-gradient(135deg, var(--pdw-primary) 0%, var(--pdw-secondary) 100%);
    color: #fff;
    padding: 26px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.pdw-header-icon { font-size: 38px; flex-shrink: 0; }
.pdw-title  { font-size: 20px; font-weight: 700; margin-bottom: 3px; }
.pdw-subtitle { font-size: 13px; opacity: .85; }

/* ════════════════════════════════════════════
   BARRE DE PROGRESSION
════════════════════════════════════════════ */
.pdw-progress-wrap {
    background: var(--pdw-bg-alt);
    border-bottom: 1px solid var(--pdw-border);
    padding: 16px 32px 14px;
}

/* Dots de navigation */
.pdw-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 10px;
}

.pdw-dot-item {
    display: flex;
    align-items: center;
    flex: 1;
}

.pdw-step-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--pdw-border);
    background: var(--pdw-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    color: var(--pdw-text-light);
    flex-shrink: 0;
    transition: all .3s ease;
    position: relative;
    z-index: 1;
}
.pdw-step-dot.active {
    border-color: var(--pdw-primary);
    background: var(--pdw-primary);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(26,115,232,.2);
}
.pdw-step-dot.done {
    border-color: var(--pdw-success);
    background: var(--pdw-success);
    color: #fff;
}
.pdw-step-dot.done::after { content: '✓'; }
.pdw-step-dot:not(.done) .pdw-dot-num { display: block; }
.pdw-step-dot.done .pdw-dot-num { display: none; }

.pdw-dot-label {
    display: none; /* masqué sur mobile, affiché desktop */
    font-size: 11px;
    margin-top: 4px;
    color: var(--pdw-text-light);
    font-weight: 500;
}
.pdw-step-dot.active + .pdw-dot-label { color: var(--pdw-primary); }

.pdw-dot-line {
    flex: 1;
    height: 2px;
    background: var(--pdw-border);
    transition: background .3s ease;
}
.pdw-dot-line.done { background: var(--pdw-success); }

/* Barre de progression */
.pdw-progress-bar {
    background: #e0e0e0;
    border-radius: 4px;
    height: 5px;
    overflow: hidden;
}
.pdw-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--pdw-primary), var(--pdw-secondary));
    border-radius: 4px;
    width: 20%;
    transition: width .4s cubic-bezier(.4,0,.2,1);
}

.pdw-step-counter {
    text-align: center;
    font-size: 12px;
    color: var(--pdw-text-light);
    margin-top: 6px;
}

/* ════════════════════════════════════════════
   ÉTAPES — SYSTÈME D'ANIMATION PLEINE PAGE
════════════════════════════════════════════ */
.pdw-steps-container {
    position: relative;
    overflow: hidden;
}

/* Toutes les étapes */
.pdw-step {
    padding: 32px 32px 24px;
    width: 100%;
    /* Pas de position absolute par défaut = layout normal */
}

/* Étape active (visible) */
.pdw-step.pdw-step-active {
    display: block;
}

/* Étape cachée */
.pdw-step.pdw-step-hidden {
    display: none;
}

/* ── Animations de sortie ── */
/* L'étape sortante devient absolute pour ne pas perturber le layout */
.pdw-step.pdw-exit-left,
.pdw-step.pdw-exit-right {
    position: absolute !important;
    top: 0; left: 0;
    width: 100%;
    pointer-events: none;
}

/* Sortie vers la gauche (aller) */
.pdw-step.pdw-exit-left.pdw-exiting {
    animation: pdwExitLeft var(--pdw-anim) forwards;
}

/* Sortie vers la droite (retour) */
.pdw-step.pdw-exit-right.pdw-exiting {
    animation: pdwExitRight var(--pdw-anim) forwards;
}

/* ── Animations d'entrée ── */
/* Entrée depuis la droite (aller) */
.pdw-step.pdw-enter-right {
    animation: none;
    opacity: 0;
    transform: translateX(60px);
}
.pdw-step.pdw-enter-right.pdw-entering {
    animation: pdwEnterRight var(--pdw-anim) forwards;
}

/* Entrée depuis la gauche (retour) */
.pdw-step.pdw-enter-left {
    opacity: 0;
    transform: translateX(-60px);
}
.pdw-step.pdw-enter-left.pdw-entering {
    animation: pdwEnterLeft var(--pdw-anim) forwards;
}

@keyframes pdwExitLeft {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-60px); }
}
@keyframes pdwExitRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(60px); }
}
@keyframes pdwEnterRight {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pdwEnterLeft {
    from { opacity: 0; transform: translateX(-60px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ════════════════════════════════════════════
   EN-TÊTE D'ÉTAPE
════════════════════════════════════════════ */
.pdw-step-header { margin-bottom: 24px; }
.pdw-step-header h3 {
    font-size: 19px; font-weight: 700;
    color: var(--pdw-text);
    margin-bottom: 5px;
    line-height: 1.3;
}
.pdw-step-header p { font-size: 14px; color: var(--pdw-text-light); }

/* Indication si choix requis */
.pdw-step-hint {
    font-size: 13px;
    color: var(--pdw-error);
    margin-top: 10px;
    padding: 8px 14px;
    background: #ffebee;
    border-radius: 6px;
    border-left: 3px solid var(--pdw-error);
}
@keyframes pdwShake {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-6px); }
    40%,80% { transform: translateX(6px); }
}
.pdw-shake { animation: pdwShake .5s ease; }

/* ════════════════════════════════════════════
   GRILLE DE CHOIX
════════════════════════════════════════════ */
.pdw-choices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.pdw-choice { cursor: pointer; display: block; position: relative; }
.pdw-choice input[type="radio"],
.pdw-choice input[type="checkbox"] {
    position: absolute; opacity: 0; width: 0; height: 0;
}

.pdw-choice-inner {
    border: 2px solid var(--pdw-border);
    border-radius: 12px;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all .2s ease;
    background: var(--pdw-bg);
    user-select: none;
}

.pdw-choice:hover .pdw-choice-inner {
    border-color: var(--pdw-primary);
    box-shadow: 0 2px 12px rgba(26,115,232,.15);
    transform: translateY(-2px);
}

.pdw-choice.pdw-selected .pdw-choice-inner,
.pdw-choice input:checked + .pdw-choice-inner {
    border-color: var(--pdw-primary);
    background: linear-gradient(135deg, rgba(26,115,232,.06), rgba(13,71,161,.03));
    box-shadow: 0 3px 14px rgba(26,115,232,.18);
}

.pdw-choice-icon  { font-size: 30px; flex-shrink: 0; }
.pdw-choice-label { font-size: 14px; font-weight: 500; line-height: 1.35; }

/* Checkbox */
.pdw-choice-checkbox .pdw-choice-inner { justify-content: space-between; }
.pdw-choice-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pdw-choice-price { font-size: 13px; color: var(--pdw-primary); font-weight: 700; }
.pdw-check-mark {
    font-size: 18px; color: var(--pdw-primary); font-weight: 700;
    opacity: 0; transition: opacity .2s; flex-shrink: 0;
}
.pdw-choice.pdw-selected .pdw-check-mark { opacity: 1; }

.pdw-options-note { margin-top: 14px; font-size: 13px; color: var(--pdw-text-light); }

/* ════════════════════════════════════════════
   ÉTAPE 5 — ESTIMATION + FORMULAIRE
════════════════════════════════════════════ */

/* ── Box estimation principale (gros, bien visible) ── */
.pdw-estimation-box {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border: 2px solid #66bb6a;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.pdw-estimation-box::before {
    content: '💶';
    position: absolute;
    right: 20px; top: 16px;
    font-size: 48px;
    opacity: .12;
}

.pdw-price-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .6px;
    color: #388e3c;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.pdw-price-value {
    font-size: 44px;
    font-weight: 800;
    color: #2e7d32;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.pdw-price-mention {
    font-size: 13px;
    color: #558b2f;
    line-height: 1.5;
    max-width: 380px;
    margin: 0 auto 16px;
}

/* CTA téléphone dans la box */
.pdw-phone-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2e7d32;
    color: #fff;
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    transition: background .2s, transform .2s;
    letter-spacing: .3px;
}
.pdw-phone-cta:hover {
    background: #1b5e20;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}
.pdw-phone-cta-icon { font-size: 20px; }

/* Animation prix */
@keyframes pdwPricePop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}
.pdw-price-pop .pdw-price-value { animation: pdwPricePop .35s ease; }

/* ── Récapitulatif ── */
.pdw-recap {
    background: var(--pdw-bg-alt);
    border: 1px solid var(--pdw-border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.pdw-recap h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--pdw-text-light); text-transform: uppercase; letter-spacing: .5px; }
.pdw-recap ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pdw-recap li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.pdw-recap-icon { font-size: 16px; }

/* ════════════════════════════════════════════
   FORMULAIRE DE CONTACT
════════════════════════════════════════════ */
.pdw-form-title {
    font-size: 17px; font-weight: 700;
    margin-bottom: 4px; color: var(--pdw-text);
}
.pdw-form-subtitle { font-size: 13px; color: var(--pdw-text-light); margin-bottom: 20px; }

.pdw-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.pdw-field { display: flex; flex-direction: column; gap: 5px; }
.pdw-field-full { grid-column: 1 / -1; }

.pdw-field label { font-size: 13px; font-weight: 600; color: var(--pdw-text); }

.pdw-field input,
.pdw-field textarea {
    border: 2px solid var(--pdw-border);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--pdw-text);
    background: var(--pdw-bg);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    width: 100%;
}
.pdw-field input:focus,
.pdw-field textarea:focus {
    border-color: var(--pdw-primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,.13);
}
.pdw-field input.pdw-field-invalid,
.pdw-field textarea.pdw-field-invalid { border-color: var(--pdw-error); }
.pdw-field-error { font-size: 12px; color: var(--pdw-error); min-height: 15px; }
.required { color: var(--pdw-error); }
.pdw-field textarea { resize: vertical; min-height: 80px; }

/* RGPD */
.pdw-gdpr { margin: 14px 0; }
.pdw-gdpr label {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13px; color: var(--pdw-text-light); cursor: pointer; line-height: 1.5;
}
.pdw-gdpr input[type="checkbox"] {
    margin-top: 2px; flex-shrink: 0;
    width: 16px; height: 16px;
    accent-color: var(--pdw-primary);
}

/* ════════════════════════════════════════════
   BOUTONS
════════════════════════════════════════════ */
.pdw-navigation {
    padding: 12px 32px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--pdw-border);
    background: var(--pdw-bg-alt);
}

.pdw-btn {
    padding: 12px 26px;
    border-radius: 8px;
    border: 2px solid transparent;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.pdw-btn-primary {
    background: var(--pdw-primary);
    color: #fff;
    border-color: var(--pdw-primary);
    margin-left: auto;
}
.pdw-btn-primary:hover {
    background: var(--pdw-secondary);
    border-color: var(--pdw-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26,115,232,.28);
}
.pdw-btn-primary:active { transform: translateY(0); }

.pdw-btn-loading {
    opacity: .7;
    cursor: wait;
}
.pdw-btn-loading::after {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pdwSpin .7s linear infinite;
    margin-left: 8px;
}
@keyframes pdwSpin { to { transform: rotate(360deg); } }

.pdw-btn-back {
    background: transparent;
    color: var(--pdw-text-light);
    border-color: var(--pdw-border);
}
.pdw-btn-back:hover { border-color: #bbb; color: var(--pdw-text); }

.pdw-btn-submit {
    width: 100%;
    justify-content: center;
    padding: 15px;
    font-size: 16px;
    margin-top: 8px;
}

/* Alertes */
.pdw-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 12px;
}
.pdw-alert-error { background: #ffebee; color: var(--pdw-error); border: 1px solid #ef9a9a; }

/* ════════════════════════════════════════════
   ÉCRAN SUCCÈS
════════════════════════════════════════════ */
.pdw-success {
    text-align: center;
    padding: 32px 24px 16px;
}
.pdw-success-icon {
    font-size: 68px; margin-bottom: 16px;
    animation: pdwSuccessBounce .6s ease;
    display: block;
}
@keyframes pdwSuccessBounce {
    0%   { transform: scale(.4); opacity: 0; }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1);   opacity: 1; }
}
.pdw-success-title { font-size: 22px; font-weight: 700; color: var(--pdw-success); margin-bottom: 10px; }
.pdw-success-msg { font-size: 15px; color: var(--pdw-text-light); line-height: 1.6; max-width: 440px; margin: 0 auto 20px; }
.pdw-success-badges { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pdw-badge {
    background: #e8f5e9; color: var(--pdw-success);
    border: 1px solid #a5d6a7; padding: 6px 14px;
    border-radius: 20px; font-size: 13px; font-weight: 600;
}

/* ════════════════════════════════════════════
   TRUST SIGNALS
════════════════════════════════════════════ */
.pdw-trust {
    background: var(--pdw-bg-alt);
    border-top: 1px solid var(--pdw-border);
    padding: 11px 32px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.pdw-trust span { font-size: 12px; color: var(--pdw-text-light); font-weight: 500; }

/* ════════════════════════════════════════════
   UTILITAIRES
════════════════════════════════════════════ */
.pdw-hidden { display: none !important; }

/* ════════════════════════════════════════════
   RESPONSIVE — MOBILE
════════════════════════════════════════════ */
@media (max-width: 580px) {
    .pdw-widget { margin: 16px 0; border-radius: 12px; }
    .pdw-header { padding: 18px 18px; gap: 10px; }
    .pdw-header-icon { font-size: 28px; }
    .pdw-title  { font-size: 16px; }

    .pdw-progress-wrap { padding: 12px 18px 10px; }
    .pdw-step-dot { width: 22px; height: 22px; font-size: 10px; }

    .pdw-step { padding: 20px 18px 16px; }
    .pdw-step-header h3 { font-size: 16px; }
    .pdw-choices-grid { grid-template-columns: 1fr; }
    .pdw-form-grid { grid-template-columns: 1fr; }

    .pdw-price-value { font-size: 34px; }

    .pdw-navigation { padding: 10px 18px 16px; }
    .pdw-trust { padding: 10px 18px; gap: 12px; }
    .pdw-trust span { font-size: 11px; }
}

@media (min-width: 480px) {
    .pdw-dot-label { display: block; }
    .pdw-dots { flex-direction: column; gap: 4px; }
    .pdw-dots { flex-direction: row; }
}
