/* =========================================================
   TDV · Devis — Les Toits Du Var  [CSS v1.2.0]
   Palette : jaune #f9bf21 · bleu 7bb9e7→0078be · vert #5c7d33 · dark #002a4c
   ========================================================= */
.tdv-d{
    --tdv-accent:#f9bf21;
    --tdv-primary:#0078be;
    --tdv-dark:#002a4c;
    --tdv-light:#f6f9fb;
    position:relative; font-family:inherit;
}
.tdv-d-card{
    background:#fff; border-radius:24px; padding:36px;
    box-shadow:0 16px 50px rgba(0,42,76,.1); max-width:780px; margin:0 auto;
}

/* En-tête */
.tdv-d-head{ text-align:center; margin-bottom:26px; }
.tdv-d-title{ margin:0 0 8px; font-size:1.6rem; font-weight:800; color:var(--tdv-dark); line-height:1.2; }
.tdv-d-subtitle{ margin:0; color:#5a6b7a; font-size:1rem; line-height:1.55; }

/* Barre de progression */
.tdv-d-progress{ height:6px; background:var(--tdv-light); border-radius:30px; overflow:hidden; margin-bottom:12px; }
.tdv-d-progress-bar{ height:100%; background:linear-gradient(90deg, var(--tdv-primary), var(--tdv-accent)); border-radius:30px; transition:width .4s cubic-bezier(.2,.7,.2,1); }
.tdv-d-progress-steps{ display:flex; justify-content:space-between; margin-bottom:28px; }
.tdv-d-progress-steps span{ font-size:.8rem; font-weight:700; color:#b3c0cc; transition:color .3s ease; }
.tdv-d-progress-steps span.is-active{ color:var(--tdv-primary); }
.tdv-d-progress-steps span.is-done{ color:var(--tdv-dark); }

/* Étapes */
.tdv-d-step{ display:none; animation:tdvDFade .4s ease; }
.tdv-d-step.is-active{ display:block; }
.tdv-d-step-title{ margin:0 0 20px; font-size:1.25rem; font-weight:800; color:var(--tdv-dark); }
@keyframes tdvDFade{ from{ opacity:0; transform:translateX(12px); } to{ opacity:1; transform:none; } }

/* Cases prestations */
.tdv-d-services{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.tdv-d-svc{
    position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
    padding:22px 14px; border-radius:18px; border:2px solid #e8eef3; background:#fff;
    cursor:pointer; text-align:center; transition:border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.tdv-d-svc:hover{ border-color:var(--tdv-primary); transform:translateY(-3px); box-shadow:0 10px 24px rgba(0,42,76,.1); }
.tdv-d-svc.is-selected{ border-color:var(--tdv-primary); background:rgba(0,120,190,.08); }
.tdv-d-svc-input{ position:absolute; opacity:0; pointer-events:none; }
.tdv-d-svc-icon{ font-size:30px; color:var(--tdv-primary); line-height:1; }
.tdv-d-svc-icon svg{ width:1em; height:1em; fill:currentColor; }
.tdv-d-svc-label{ font-size:.9rem; font-weight:700; color:var(--tdv-dark); line-height:1.3; }
.tdv-d-svc-check{
    position:absolute; top:10px; right:10px; width:22px; height:22px; border-radius:50%;
    background:var(--tdv-primary); color:#fff; display:flex; align-items:center; justify-content:center;
    opacity:0; transform:scale(.5); transition:opacity .2s ease, transform .2s ease;
}
.tdv-d-svc.is-selected .tdv-d-svc-check{ opacity:1; transform:scale(1); }

/* Champs */
.tdv-d-row{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.tdv-d-group{ display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.tdv-d-group label{ font-size:.82rem; font-weight:700; color:var(--tdv-dark); }
.tdv-d-field{
    width:100%; box-sizing:border-box;
    background-color:var(--tdv-light);
    border:1.5px solid #e2e9ef; border-radius:30px !important;
    padding:14px 22px; font-size:.97rem; color:var(--tdv-dark); font-family:inherit;
    transition:border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.tdv-d-field:focus{ outline:none; border-color:var(--tdv-primary); background-color:#fff; box-shadow:0 0 0 4px rgba(0,120,190,.12); }
.tdv-d-field.is-error{ border-color:#e0413e; box-shadow:0 0 0 4px rgba(224,65,62,.1); }
textarea.tdv-d-field{ resize:vertical; min-height:110px; border-radius:22px !important; }
select.tdv-d-field{
    appearance:none; -webkit-appearance:none; -moz-appearance:none;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath fill='none' stroke='%230078be' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M5 7l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 20px center; background-size:18px; padding-right:48px; cursor:pointer;
}

.tdv-d-hp{ position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }

.tdv-d-rgpd{ display:flex; align-items:flex-start; gap:10px; font-size:.82rem; color:#5a6b7a; line-height:1.5; cursor:pointer; margin-top:6px; }
.tdv-d-rgpd input{ margin-top:3px; accent-color:var(--tdv-primary); flex:0 0 auto; width:16px; height:16px; }
.tdv-d-rgpd-link{ color:var(--tdv-primary); font-weight:700; text-decoration:underline; text-underline-offset:2px; }
.tdv-d-rgpd-link:hover{ color:var(--tdv-dark); }

/* Message d'erreur inline */
.tdv-d-err{ display:block; color:#e0413e; font-size:.8rem; font-weight:600; margin-top:6px; animation:tdvDErr .25s ease; }
.tdv-d-services-err{ grid-column:1 / -1; margin-top:4px; }
@keyframes tdvDErr{ from{ opacity:0; transform:translateY(-4px); } to{ opacity:1; transform:none; } }

/* Navigation */
.tdv-d-nav{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:28px; }
.tdv-d-prev, .tdv-d-next, .tdv-d-submit{
    display:inline-flex; align-items:center; justify-content:center; gap:8px;
    border:none; border-radius:30px !important; padding:14px 26px;
    font-size:.97rem; font-weight:800; cursor:pointer; font-family:inherit;
    transition:transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.tdv-d-prev{ background:transparent; color:#8595a3; border:1.5px solid #e2e9ef !important; }
.tdv-d-prev:hover{ border-color:var(--tdv-primary) !important; color:var(--tdv-primary); }
.tdv-d-next{ background:var(--tdv-primary); color:#fff; box-shadow:0 8px 22px rgba(0,120,190,.3); }
.tdv-d-next:hover{ transform:translateY(-2px); box-shadow:0 12px 28px rgba(0,120,190,.4); }
.tdv-d-submit{ position:relative; background:var(--tdv-accent); color:var(--tdv-dark); box-shadow:0 8px 22px rgba(249,191,33,.32); }
.tdv-d-submit:hover{ transform:translateY(-2px); box-shadow:0 12px 28px rgba(249,191,33,.42); }
.tdv-d-submit:disabled{ opacity:.7; cursor:not-allowed; transform:none; }
.tdv-d-prev svg, .tdv-d-next svg, .tdv-d-submit svg{ flex:0 0 auto; }
.tdv-d-spinner{ width:18px; height:18px; border-radius:50%; border:2.5px solid rgba(0,42,76,.25); border-top-color:var(--tdv-dark); display:none; animation:tdvDSpin .7s linear infinite; }
.tdv-d-submit.is-loading .tdv-d-spinner{ display:inline-block; }
.tdv-d-submit.is-loading .tdv-d-submit-text{ opacity:.6; }
@keyframes tdvDSpin{ to{ transform:rotate(360deg); } }

/* POPUP */
.tdv-d-popup{ position:fixed; inset:0; z-index:99999; display:none; align-items:center; justify-content:center; padding:20px; }
.tdv-d-popup.is-open{ display:flex; }
.tdv-d-popup-overlay{ position:absolute; inset:0; background:rgba(0,42,76,.6); backdrop-filter:blur(5px); animation:tdvDPopFade .3s ease; }
.tdv-d-popup-box{ position:relative; z-index:1; background:#fff; border-radius:26px; max-width:460px; width:100%; text-align:center; box-shadow:0 30px 90px rgba(0,42,76,.45); animation:tdvDPop .5s cubic-bezier(.2,.85,.3,1); overflow:hidden; }
.tdv-d-popup-head{ position:relative; background:linear-gradient(150deg,#002a4c 0%,#0078be 100%); padding:40px 30px 54px; }
.tdv-d-popup.is-error .tdv-d-popup-head{ background:linear-gradient(150deg,#7a1f1d 0%,#e0413e 100%); }
.tdv-d-popup-icon{ position:relative; z-index:1; width:92px; height:92px; margin:0 auto; }
.tdv-d-popup-icon svg{ width:100%; height:100%; background:#fff; border-radius:50%; padding:6px; box-sizing:border-box; }
.tdv-d-popup-icon circle{ stroke:#5c7d33; stroke-width:2.5; stroke-dasharray:151; stroke-dashoffset:151; animation:tdvDCircle .6s .2s cubic-bezier(.65,0,.45,1) forwards; }
.tdv-d-popup-icon path{ stroke:#5c7d33; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:48; stroke-dashoffset:48; animation:tdvDCheck .4s .75s cubic-bezier(.65,0,.45,1) forwards; }
.tdv-d-popup.is-error .tdv-d-popup-icon circle{ stroke:#e0413e; }
.tdv-d-popup.is-error .tdv-d-popup-icon path{ stroke:#e0413e; }
.tdv-d-popup-body{ padding:30px 34px 34px; margin-top:-24px; position:relative; z-index:1; }
.tdv-d-popup-title{ margin:0 0 10px; font-size:1.5rem; font-weight:800; color:var(--tdv-dark); }
.tdv-d-popup-text{ margin:0 0 24px; color:#5a6b7a; font-size:.97rem; line-height:1.6; }
.tdv-d-popup-steps{ display:flex; flex-direction:column; gap:12px; text-align:left; margin:0 0 24px; }
.tdv-d-popup-step{ display:flex; align-items:center; gap:12px; background:#f6f9fb; border-radius:14px; padding:13px 16px; }
.tdv-d-popup-step-ic{ flex:0 0 auto; width:36px; height:36px; border-radius:10px; background:rgba(0,120,190,.1); color:var(--tdv-primary); display:flex; align-items:center; justify-content:center; }
.tdv-d-popup-step-tx{ font-size:.9rem; color:var(--tdv-dark); font-weight:600; line-height:1.4; }
.tdv-d-popup-urgent{ margin:0 0 12px; font-size:.85rem; color:#8595a3; font-weight:600; }
.tdv-d-popup-phones{ display:flex; gap:10px; margin:0 0 24px; }
.tdv-d-popup-phone{ flex:1; display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:13px 12px; border-radius:30px; text-decoration:none; font-size:.95rem; font-weight:700; transition:transform .2s ease, box-shadow .2s ease; }
.tdv-d-popup-phone svg{ flex:0 0 auto; }
.tdv-d-popup-phone.is-primary{ background:var(--tdv-primary); color:#fff; box-shadow:0 6px 18px rgba(0,120,190,.3); }
.tdv-d-popup-phone.is-accent{ background:var(--tdv-accent); color:var(--tdv-dark); box-shadow:0 6px 18px rgba(249,191,33,.3); }
.tdv-d-popup-phone:hover{ transform:translateY(-2px); }
.tdv-d-popup-btn{ background:none; color:#8595a3; border:1.5px solid #e2e9ef; border-radius:30px; padding:13px 40px; font-size:.95rem; font-weight:700; cursor:pointer; font-family:inherit; transition:border-color .2s ease, color .2s ease; }
.tdv-d-popup-btn:hover{ border-color:var(--tdv-primary); color:var(--tdv-primary); }
@keyframes tdvDPopFade{ from{ opacity:0; } to{ opacity:1; } }
@keyframes tdvDPop{ from{ opacity:0; transform:translateY(28px) scale(.92); } to{ opacity:1; transform:none; } }
@keyframes tdvDCircle{ to{ stroke-dashoffset:0; } }
@keyframes tdvDCheck{ to{ stroke-dashoffset:0; } }

/* RESPONSIVE */
@media (max-width:768px){
    .tdv-d-card{ padding:24px 20px; border-radius:18px; }
    .tdv-d-services{ grid-template-columns:repeat(2,1fr); gap:12px; }
    .tdv-d-row{ grid-template-columns:1fr; }
    .tdv-d-title{ font-size:1.3rem; }
    .tdv-d-step-title{ font-size:1.1rem; }
    .tdv-d-progress-steps span{ font-size:.72rem; }
    .tdv-d-nav{ flex-wrap:wrap; }
    .tdv-d-prev, .tdv-d-next, .tdv-d-submit{ flex:1; padding:14px 18px; }
    .tdv-d-popup-head{ padding:34px 24px 48px; }
    .tdv-d-popup-body{ padding:26px 22px 28px; }
    .tdv-d-popup-phones{ flex-direction:column; }
}
@media (max-width:430px){
    .tdv-d-services{ grid-template-columns:1fr 1fr; }
    .tdv-d-svc{ padding:18px 10px; }
    .tdv-d-svc-icon{ font-size:26px; }
    .tdv-d-svc-label{ font-size:.82rem; }
}
@media (prefers-reduced-motion:reduce){
    .tdv-d-step, .tdv-d-popup-overlay, .tdv-d-popup-box,
    .tdv-d-popup-icon circle, .tdv-d-popup-icon path{ animation:none !important; }
    .tdv-d-popup-icon circle{ stroke-dashoffset:0; }
    .tdv-d-popup-icon path{ stroke-dashoffset:0; }
    .tdv-d-spinner{ animation-duration:1.4s; }
}
