/**
 * Contact Pro - Frontend Styles
 * CSS public pour l'affichage des formulaires
 */

/* === STRUCTURE PRINCIPALE === */
.cp-form-wrap { 
    font-family: inherit; 
}

.cp-form-wrap .cp-row { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
}

.cp-form-wrap .cp-grp { 
    box-sizing: border-box; 
    flex-shrink: 0; 
    margin-bottom: var(--cp-field-gap, 20px); 
}

/* === LARGEURS === */
.cp-form-wrap .w-100 { width: 100%; }
.cp-form-wrap .w-75 { width: calc(75% - 11.25px); }
.cp-form-wrap .w-50 { width: calc(50% - 7.5px); }
.cp-form-wrap .w-37-5 { width: calc(37.5% - 7.5px); }
.cp-form-wrap .w-25 { width: calc(25% - 11.25px); }
.cp-form-wrap .w-12-5 { width: calc(12.5% - 11.25px); }
.cp-form-wrap .cp-newline { flex-basis: 100%; height: 0; margin: 0; border: none; }

/* === LABELS === */
.cp-form-wrap .cp-lbl { 
    display: block; 
    margin-bottom: 5px; 
    font-size: 14px; 
    font-family: var(--cp-label-font, inherit); 
    color: var(--cp-label-color, #333333); 
    font-weight: var(--cp-label-bold, normal); 
    font-style: var(--cp-label-italic, normal); 
}

.cp-form-wrap .cp-req { 
    color: #d63638; 
    margin-left: 3px; 
}

/* === CHAMPS INPUT, TEXTAREA, SELECT === */
.cp-form-wrap .cp-inp, 
.cp-form-wrap .cp-sel { 
    width: 100%; 
    padding: 14px 20px !important; 
    box-sizing: border-box !important; 
    border: 1px solid var(--cp-input-border, #ddd); 
    background-color: var(--cp-input-bg, #ffffff); 
    border-radius: var(--cp-input-radius, 4px); 
    box-shadow: var(--cp-input-shadow, none); 
    font-size: 15px !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: 48px !important;
}

/* Textarea spécifique - hauteur augmentée */
.cp-form-wrap textarea.cp-inp,
.cp-form-wrap .cp-textarea,
.cp-form-wrap textarea.cp-message-field,
.cp-form-wrap textarea[name*="message" i],
.cp-form-wrap textarea[name*="Message" i],
textarea.cp-inp.cp-textarea {
    min-height: 220px !important;
    height: 220px !important;
    resize: vertical !important;
    line-height: 1.5 !important;
    padding: 15px 20px !important;
}

.cp-form-wrap .cp-area { 
    width: 100%; 
    padding: 20px; 
    box-sizing: border-box; 
    border: 1px solid var(--cp-input-border, #ddd); 
    background-color: var(--cp-input-bg, #ffffff); 
    border-radius: var(--cp-input-radius, 4px); 
    box-shadow: var(--cp-input-shadow, none); 
    font-size: 15px; 
    line-height: 1.5;
    min-height: 250px;
    resize: vertical;
}

.cp-form-wrap .cp-sel { 
    cursor: pointer; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); 
    background-repeat: no-repeat; 
    background-position: right 12px center; 
    background-size: 20px; 
    padding-right: 44px !important;
    -webkit-appearance: none; 
    -moz-appearance: none; 
    appearance: none;
    color: #333;
}


.cp-form-wrap .cp-sel option {
    color: #333;
}

.cp-form-wrap .cp-sel option:first-child {
    color: #666;
}

.cp-form-wrap .cp-inp:focus, 
.cp-form-wrap .cp-area:focus, 
.cp-form-wrap .cp-sel:focus { 
    border-color: var(--cp-button-color, #0071e3); 
    outline: none; 
}

/* === BOUTON SUBMIT === */
.cp-form-wrap .cp-btn { 
    display: block; 
    background: var(--cp-button-color, #0071e3); 
    color: #fff; 
    border: none; 
    padding: 12px 25px; 
    border-radius: var(--cp-button-radius, 4px); 
    cursor: pointer; 
    font-weight: 600; 
    width: var(--cp-button-width, 100%); 
    max-width: 100%; 
    margin: 0; 
    transition: 0.2s; 
    box-shadow: var(--cp-button-shadow, none); 
}

.cp-form-wrap .cp-btn:hover { 
    background: var(--cp-button-hover, #005bb5); 
}

/* === MESSAGES === */
.cp-form-wrap .cp-msg { 
    display: none; 
    margin-top: 15px; 
    padding: 15px 20px; 
    border-radius: 6px; 
    text-align: center; 
    font-size: 16px; 
    font-weight: 600; 
}

.cp-form-wrap .cp-msg.ok { 
    background: #10b981 !important; 
    color: #ffffff !important; 
    border: 2px solid #059669 !important; 
}

.cp-form-wrap .cp-msg.err { 
    background: #ef4444 !important; 
    color: #ffffff !important; 
    border: 2px solid #dc2626 !important; 
}

/* === AUTOCOMPLETE === */
.cp-form-wrap input:-webkit-autofill,
.cp-form-wrap input:-webkit-autofill:hover,
.cp-form-wrap input:-webkit-autofill:focus,
.cp-form-wrap input:-webkit-autofill:active,
.cp-form-wrap textarea:-webkit-autofill,
.cp-form-wrap textarea:-webkit-autofill:hover,
.cp-form-wrap textarea:-webkit-autofill:focus,
.cp-form-wrap textarea:-webkit-autofill:active,
.cp-form-wrap select:-webkit-autofill,
.cp-form-wrap select:-webkit-autofill:hover,
.cp-form-wrap select:-webkit-autofill:focus,
.cp-form-wrap select:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--cp-input-bg, #ffffff) inset !important;
    -webkit-text-fill-color: #000 !important;
    box-shadow: 0 0 0 1000px var(--cp-input-bg, #ffffff) inset !important;
}

/* === FILE UPLOAD === */
.cp-form-wrap .cp-file-wrap { position: relative; }

.cp-form-wrap .cp-file-btn { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    padding: 10px 20px; 
    background: #f0f0f1; 
    border: 1px solid var(--cp-input-border, #ddd); 
    border-radius: var(--cp-input-radius, 4px); 
    cursor: pointer; 
    font-weight: 600; 
    transition: 0.2s; 
}

.cp-form-wrap .cp-file-btn:hover { 
    background: #e0e0e1; 
    border-color: var(--cp-button-color, #0071e3); 
}

.cp-form-wrap .cp-file-input { 
    position: absolute; 
    opacity: 0; 
    width: 0; 
    height: 0; 
}

.cp-form-wrap .cp-file-name { 
    margin-top: 8px; 
    font-size: 13px; 
    color: #666; 
}

.cp-form-wrap .cp-file-info { 
    margin-top: 6px; 
    font-size: 12px; 
    color: #999; 
}

/* === DATE WITH ICON === */
.cp-form-wrap .cp-date-wrap { position: relative; }
.cp-form-wrap .cp-date-wrap input[type="date"] { padding-left: 40px; }
.cp-form-wrap .cp-date-icon { 
    position: absolute; 
    left: 12px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: #666; 
    font-size: 16px; 
    pointer-events: none; 
}

/* === CUSTOM TIME PICKER === */
.cp-form-wrap .cp-timepicker { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    padding: 10px; 
    border: 1px solid var(--cp-input-border, #ddd); 
    background: var(--cp-input-bg, #ffffff); 
    border-radius: var(--cp-input-radius, 4px); 
    box-sizing: border-box; 
}

.cp-form-wrap .cp-timepicker-icon { 
    color: #666; 
    font-size: 16px; 
    margin-right: 5px; 
}

.cp-form-wrap .cp-timepicker-group { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
}

.cp-form-wrap .cp-timepicker-btn { 
    width: 23px; 
    height: 23px; 
    border: 1px solid #ddd; 
    background: #f9f9f9; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: 0.2s; 
    user-select: none; 
    font-size: 12px; 
    flex-shrink: 0; 
}

.cp-form-wrap .cp-timepicker-btn:hover { 
    background: var(--cp-button-color, #0071e3); 
    color: #fff; 
    border-color: var(--cp-button-color, #0071e3); 
}

.cp-form-wrap .cp-timepicker-value { 
    font-size: 15px; 
    font-weight: bold; 
    min-width: 26px; 
    text-align: center; 
    color: #333; 
    font-family: monospace; 
}

.cp-form-wrap .cp-timepicker-sep { 
    font-size: 16px; 
    font-weight: bold; 
    color: #666; 
    margin: 0 4px; 
}

/* === SWITCH (INTERRUPTEUR) === */
.cp-form-wrap .cp-switch-wrap { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

.cp-form-wrap .cp-switch { 
    position: relative; 
    display: inline-block; 
    width: 50px; 
    height: 26px; 
}

.cp-form-wrap .cp-switch-input { 
    opacity: 0; 
    width: 0; 
    height: 0; 
}

.cp-form-wrap .cp-switch-slider { 
    position: absolute; 
    cursor: pointer; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background-color: #ccc; 
    transition: 0.3s; 
    border-radius: 26px; 
}

.cp-form-wrap .cp-switch-slider:before { 
    position: absolute; 
    content: ""; 
    height: 20px; 
    width: 20px; 
    left: 3px; 
    bottom: 3px; 
    background-color: white; 
    transition: 0.3s; 
    border-radius: 50%; 
}

.cp-form-wrap .cp-switch-input:checked + .cp-switch-slider { 
    background-color: var(--cp-button-color, #0071e3); 
}

.cp-form-wrap .cp-switch-input:checked + .cp-switch-slider:before { 
    transform: translateX(24px); 
}

.cp-form-wrap .cp-switch-label { 
    font-size: 14px; 
    color: #666; 
    font-weight: 500; 
}

/* === NPS (NOTE 0-10) === */
.cp-form-wrap .cp-nps-container { position: relative; }
.cp-form-wrap .cp-nps-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.cp-form-wrap .cp-nps-item { margin: 0; }
.cp-form-wrap .cp-nps-item input { display: none; }

.cp-form-wrap .cp-nps-btn { 
    display: block; 
    width: 38px; 
    height: 38px; 
    border: 2px solid #ddd; 
    border-radius: 8px; 
    background: #fff; 
    text-align: center; 
    line-height: 34px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.2s; 
    color: #333; 
}

.cp-form-wrap .cp-nps-btn:hover { 
    border-color: var(--cp-button-color, #0071e3); 
    background: #f0f9ff; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
}

.cp-form-wrap .cp-nps-item input:checked + .cp-nps-btn { 
    background: var(--cp-button-color, #0071e3); 
    color: #fff; 
    border-color: var(--cp-button-color, #0071e3); 
    transform: scale(1.1); 
}

.cp-form-wrap .cp-nps-labels { 
    display: flex; 
    gap: 6px; 
    margin-top: 8px; 
    font-size: 12px; 
    color: #666; 
}

.cp-form-wrap .cp-nps-label-spacer { 
    width: 38px; 
    flex-shrink: 0; 
}

.cp-form-wrap .cp-nps-label-text { 
    text-align: center; 
    white-space: nowrap; 
}

/* === RATING (ÉTOILES) === */
.cp-form-wrap .cp-rating { 
    display: flex; 
    gap: 4px; 
    font-size: 32px; 
}

.cp-form-wrap .cp-star { 
    cursor: pointer; 
    color: #e5e7eb; 
    transition: all 0.2s; 
    user-select: none; 
}

.cp-form-wrap .cp-star:hover { 
    transform: scale(1.2); 
}

.cp-form-wrap .cp-star.active { 
    transform: scale(1.15); 
}

/* === RANGE (CURSEUR) === */
.cp-form-wrap .cp-range-wrap { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.cp-form-wrap .cp-range-input { 
    flex: 1; 
    height: 6px; 
    border-radius: 3px; 
    background: #e5e7eb; 
    outline: none; 
    -webkit-appearance: none; 
}

.cp-form-wrap .cp-range-input::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    appearance: none; 
    width: 20px; 
    height: 20px; 
    border-radius: 50%; 
    background: var(--cp-button-color, #0071e3); 
    cursor: pointer; 
}

.cp-form-wrap .cp-range-input::-moz-range-thumb { 
    width: 20px; 
    height: 20px; 
    border-radius: 50%; 
    background: var(--cp-button-color, #0071e3); 
    cursor: pointer; 
    border: none; 
}

.cp-form-wrap .cp-range-value { 
    min-width: 45px; 
    text-align: center; 
    font-weight: 600; 
    color: var(--cp-button-color, #0071e3); 
    font-size: 16px; 
}

/* === SIGNATURE === */
.cp-form-wrap .cp-signature-wrap { position: relative; }

.cp-form-wrap .cp-signature-canvas { 
    width: 100%; 
    max-width: 400px; 
    height: 200px; 
    border: 2px dashed var(--cp-input-border, #ddd); 
    border-radius: var(--cp-input-radius, 4px); 
    cursor: crosshair; 
    background: #ffffff !important; 
    display: block; 
}

.cp-form-wrap .cp-signature-clear { 
    margin-top: 10px; 
    padding: 8px 16px; 
    background: #f8d7da; 
    color: #721c24; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: 0.2s; 
}

.cp-form-wrap .cp-signature-clear:hover { 
    background: #f1aeb5; 
}

/* === COULEUR === */
.cp-form-wrap .cp-color-input { 
    width: 50px; 
    height: 50px; 
    border: none; 
    border-radius: 50%; 
    cursor: pointer; 
    padding: 0; 
}

.cp-form-wrap .cp-color-input::-webkit-color-swatch-wrapper { 
    padding: 0; 
}

.cp-form-wrap .cp-color-input::-webkit-color-swatch { 
    border: none; 
    border-radius: 50%; 
}

.cp-form-wrap .cp-color-input::-moz-color-swatch { 
    border: none; 
    border-radius: 50%; 
}

/* === IBAN === */
.cp-form-wrap .cp-iban-input { 
    font-family: monospace; 
    letter-spacing: 1px; 
    text-transform: uppercase; 
}

/* === RADIO/CHECKBOX AMÉLIORÉS === */
.cp-form-wrap .cp-choice-group { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.cp-form-wrap .cp-choice-label { 
    display: flex; 
    align-items: center; 
    padding: 12px 16px; 
    border: 2px solid #e5e7eb; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s; 
    background: #fff; 
    position: relative; 
}

.cp-form-wrap .cp-choice-label:hover { 
    border-color: var(--cp-button-color, #0071e3); 
    background: #f0f9ff; 
}

.cp-form-wrap .cp-choice-input { 
    position: absolute; 
    opacity: 0; 
    width: 0; 
    height: 0; 
}

.cp-form-wrap .cp-choice-checkmark { 
    width: 20px; 
    height: 20px; 
    border: 2px solid #d1d5db; 
    border-radius: 4px; 
    margin-right: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s; 
    flex-shrink: 0; 
}

.cp-form-wrap .cp-choice-input[type="radio"] + .cp-choice-checkmark { 
    border-radius: 50%; 
}

.cp-form-wrap .cp-choice-input:checked + .cp-choice-checkmark { 
    background: var(--cp-button-color, #0071e3); 
    border-color: var(--cp-button-color, #0071e3); 
}

.cp-form-wrap .cp-choice-input:checked + .cp-choice-checkmark::after { 
    content: '✓'; 
    color: #fff; 
    font-size: 14px; 
    font-weight: bold; 
}

.cp-form-wrap .cp-choice-input:checked ~ .cp-choice-text { 
    font-weight: 600; 
    color: var(--cp-button-color, #0071e3); 
}

.cp-form-wrap .cp-choice-text { 
    flex: 1; 
    font-size: 15px; 
    color: #374151; 
}

/* === RESPONSIVE === */
@media (max-width: 600px) { 
    .cp-form-wrap .cp-grp { 
        width: 100% !important; 
    } 
}
