/* ============================================================
 * Page Devis en ligne
 * ============================================================ */

/* Masque le titre WP de la page (déjà présent dans la section) */
body.page-devis .wp-block-post-title,
body.page-devis main > .wp-block-group > .wp-block-post-title { display: none; }
body.page-devis main { margin-top: 0 !important; }
body.page-devis main > .wp-block-group { padding-top: 0 !important; }

.cpvc-devis {
    background: #F4F5FF;
    padding: 80px clamp(24px, 5vw, 80px) 120px;
    font-family: 'Poppins', sans-serif;
    color: var(--cpvc-bleu, #263477);
    box-sizing: border-box;
}
/* Fallback breakout si TT5 n'applique pas alignfull (ex: rendu shortcode) */
.cpvc-devis.alignfull {
    max-width: none !important;
}
.cpvc-devis__inner {
    max-width: 1120px;
    margin: 0 auto;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 64px clamp(32px, 6vw, 96px);
    box-shadow: 0 24px 60px -32px rgba(38, 52, 119, 0.25);
}

/* ---------- Head ---------- */
.cpvc-devis__head { text-align: center; margin-bottom: 40px; }
.cpvc-devis__title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.1;
    color: var(--cpvc-bleu, #263477);
    margin: 0 0 16px;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}
.cpvc-devis__title mark {
    background: linear-gradient(180deg, transparent 55%, var(--cpvc-jaune, #F9B334) 55%);
    color: inherit;
    padding: 0 .15em;
}
.cpvc-devis__intro {
    font-size: 15px;
    line-height: 1.6;
    color: #4A5277;
    max-width: 560px;
    margin: 0 auto;
}

/* ---------- Notices ---------- */
.cpvc-devis__notice {
    margin: 0 0 24px;
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
}
.cpvc-devis__notice--ok { background: #E6F6EC; color: #1F6B36; border: 1px solid #B7E2C3; }
.cpvc-devis__notice--ko { background: #FDECEC; color: #8A1A1A; border: 1px solid #F4B7B7; }

/* ---------- Form ---------- */
.cpvc-devis__form { display: flex; flex-direction: column; gap: 16px; }
.cpvc-devis__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.cpvc-devis__row { display: grid; gap: 16px; }
.cpvc-devis__row--2 { grid-template-columns: 1fr 1fr; }
.cpvc-devis__row--3 { grid-template-columns: 1fr 1fr 1fr; }
.cpvc-devis__row--adresse { grid-template-columns: 2fr 1fr 1.4fr; }
@media (max-width: 640px) {
    .cpvc-devis__row--2,
    .cpvc-devis__row--3,
    .cpvc-devis__row--adresse { grid-template-columns: 1fr; }
}

.cpvc-devis__field { display: flex; flex-direction: column; gap: 6px; }
.cpvc-devis__field input[type=text],
.cpvc-devis__field input[type=email],
.cpvc-devis__field input[type=tel],
.cpvc-devis__field textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #D7DAE8;
    border-radius: 10px;
    padding: 14px 18px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--cpvc-bleu, #263477);
    background: #FFFFFF;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cpvc-devis__field input::placeholder,
.cpvc-devis__field textarea::placeholder {
    color: #9AA0BA;
    font-weight: 400;
}
.cpvc-devis__field input:focus,
.cpvc-devis__field textarea:focus {
    outline: none;
    border-color: var(--cpvc-bleu, #263477);
    box-shadow: 0 0 0 3px rgba(38, 52, 119, 0.12);
}
.cpvc-devis__field textarea { min-height: 140px; resize: vertical; }

.cpvc-devis__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--cpvc-bleu, #263477);
}
.cpvc-devis__label--blue { color: #1F4FBE; font-weight: 600; }

/* ---------- Cases à cocher (projets) ---------- */
.cpvc-devis__projets {
    border: 0;
    padding: 8px 0;
    margin: 8px 0 0;
}
.cpvc-devis__projets legend {
    font-size: 14px;
    font-weight: 500;
    color: var(--cpvc-bleu, #263477);
    margin-bottom: 14px;
    padding: 0;
}
.cpvc-devis__projets legend span {
    font-weight: 400;
    color: #6E7497;
}
.cpvc-devis__projets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 24px;
}
@media (max-width: 720px) { .cpvc-devis__projets-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .cpvc-devis__projets-grid { grid-template-columns: 1fr; } }

.cpvc-devis__check {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.45;
    color: var(--cpvc-bleu, #263477);
}
.cpvc-devis__check input { position: absolute; opacity: 0; width: 0; height: 0; }
.cpvc-devis__check-box {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 1.5px solid var(--cpvc-bleu, #263477);
    background: #FFFFFF;
    margin-top: 1px;
    position: relative;
    transition: background .15s ease, border-color .15s ease;
}
.cpvc-devis__check input:checked + .cpvc-devis__check-box {
    background: var(--cpvc-jaune, #F9B334);
    border-color: var(--cpvc-jaune, #F9B334);
}
.cpvc-devis__check input:checked + .cpvc-devis__check-box::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 6px; height: 11px;
    border: solid var(--cpvc-bleu, #263477);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.cpvc-devis__check input:focus-visible + .cpvc-devis__check-box {
    box-shadow: 0 0 0 3px rgba(38, 52, 119, 0.18);
}
.cpvc-devis__check-label { font-weight: 600; }
.cpvc-devis__check-label strong { font-weight: 700; }

/* ---------- Uploads (dropzone + liste) ---------- */
.cpvc-devis__uploads { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

.cpvc-devis__dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 24px;
    border: 2px dashed #C8CDE3;
    border-radius: 14px;
    background: #F4F5FF;
    color: var(--cpvc-bleu, #263477);
    cursor: pointer;
    text-align: center;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.cpvc-devis__dropzone:hover,
.cpvc-devis__dropzone:focus-visible,
.cpvc-devis__dropzone.is-drag {
    background: #FFFFFF;
    border-color: var(--cpvc-bleu, #263477);
    outline: none;
}
.cpvc-devis__dropzone.is-drag { transform: scale(1.005); }
.cpvc-devis__dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.cpvc-devis__dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--cpvc-jaune, #F9B334);
    color: var(--cpvc-bleu, #263477);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cpvc-devis__dropzone-icon svg { width: 22px; height: 22px; }
.cpvc-devis__dropzone-main {
    font-size: 15px;
    font-weight: 500;
    color: var(--cpvc-bleu, #263477);
}
.cpvc-devis__dropzone-main strong {
    color: var(--cpvc-bleu, #263477);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--cpvc-jaune, #F9B334);
    text-decoration-thickness: 2px;
}
.cpvc-devis__dropzone-sub {
    font-size: 12px;
    color: #6E7497;
}

.cpvc-devis__files {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
@media (max-width: 960px) { .cpvc-devis__files { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cpvc-devis__files { grid-template-columns: 1fr; } }

.cpvc-devis__files-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #FFFFFF;
    border: 1.5px solid #E2E5F1;
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cpvc-devis__files-item:hover {
    border-color: var(--cpvc-bleu, #263477);
    box-shadow: 0 4px 12px -8px rgba(38, 52, 119, 0.25);
}
.cpvc-devis__files-thumb {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #F4F5FF;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--cpvc-bleu, #263477);
    letter-spacing: 0.5px;
}
.cpvc-devis__files-thumb.is-doc {
    background: var(--cpvc-jaune, #F9B334);
}
.cpvc-devis__files-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.cpvc-devis__files-meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cpvc-devis__files-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--cpvc-bleu, #263477);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cpvc-devis__files-size {
    font-size: 11px;
    color: #6E7497;
}
.cpvc-devis__files-remove {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    background: #F4F5FF;
    color: var(--cpvc-bleu, #263477);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}
.cpvc-devis__files-remove:hover {
    background: var(--cpvc-bleu, #263477);
    color: #FFFFFF;
}

/* ---------- Conseillé par ---------- */
.cpvc-devis__field--conseil { gap: 8px; margin-top: 8px; }

/* ---------- RGPD ---------- */
.cpvc-devis__check--rgpd {
    margin-top: 16px;
    background: #F4F5FF;
    border-radius: 12px;
    padding: 16px 18px;
    align-items: flex-start;
}
.cpvc-devis__check--rgpd .cpvc-devis__check-label { font-weight: 500; line-height: 1.5; }
.cpvc-devis__check--rgpd a { color: var(--cpvc-bleu, #263477); text-decoration: underline; }

.cpvc-devis__rgpd-info {
    font-size: 12px;
    color: #6E7497;
    line-height: 1.5;
    margin: 4px 0 8px;
}

/* ---------- Captcha (ALTCHA 3.x) ---------- */
.cpvc-devis__captcha { margin-top: 8px; }
.cpvc-devis__captcha altcha-widget {
    --altcha-color-base: #ffffff;
    --altcha-border-color: #d7dbe8;
    --altcha-color-base-content: #263477;
    --altcha-color-success: #263477;
    --altcha-border-radius: 12px;
    --altcha-max-width: 100%;            /* la boîte peut s'étendre → texte sur 1 ligne */
    font-family: 'Poppins', sans-serif;
    display: block;
}
/* Texte « Je ne suis pas un robot » : 50% plus petit + sur une seule ligne */
.cpvc-devis__captcha .altcha-checkbox-wrap label {
    font-size: 0.5em !important;
    white-space: nowrap;
    line-height: 1.2;
}

/* ---------- Bouton submit ---------- */
.cpvc-devis__submit {
    align-self: flex-start;
    margin-top: 16px;
    background: var(--cpvc-bleu, #263477);
    color: #FFFFFF;
    border: 0;
    border-radius: 10px;
    padding: 16px 40px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease;
}
.cpvc-devis__submit:hover { background: #1B2860; }
.cpvc-devis__submit:active { transform: translateY(1px); }
