/* ============================================================
   Divi Dual Button Form – Frontend Styles
   UD Comm – udcomm.fr
   ============================================================ */

.ddbf-module-wrap {
    width: 100%;
}

/* Wrapper formulaire */
.ddbf-form-wrapper {
    width: 100%;
    box-sizing: border-box;
}

/* Titre */
.ddbf-form-title {
    margin-top: 0;
    margin-bottom: 20px;
}

/* Messages retour */
.ddbf-success-msg,
.ddbf-error-msg {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}
.ddbf-success-msg {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.ddbf-error-msg {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Ligne côte à côte pour nom / email */
.ddbf-row {
    display: flex;
    gap: 16px;
}
.ddbf-row .ddbf-field-group {
    flex: 1;
}

@media (max-width: 767px) {
    .ddbf-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Groupes de champs */
.ddbf-field-group {
    margin-bottom: 16px;
    width: 100%;
}

/* Labels */
.ddbf-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Champs */
.ddbf-field {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box;
    background: #fff;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}
.ddbf-field:focus {
    outline: none;
    border-color: #0c71c3;
    box-shadow: 0 0 0 3px rgba(12, 113, 195, 0.15);
}
.ddbf-field::placeholder {
    color: #aaa;
}
textarea.ddbf-field {
    resize: vertical;
    min-height: 120px;
}

/* === Boutons === */
.ddbf-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    align-items: center;
}

/* Layout empilé */
.ddbf-buttons-wrapper.ddbf-stacked {
    flex-direction: column;
    align-items: stretch;
}

.ddbf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
    line-height: 1.4;
    box-sizing: border-box;
    white-space: nowrap;
}
.ddbf-btn:hover {
    transform: translateY(-1px);
}
.ddbf-btn:active {
    transform: translateY(0);
}
.ddbf-btn:disabled,
.ddbf-btn.ddbf-loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Bouton principal */
.ddbf-btn-primary {
    background-color: #0c71c3;
    color: #ffffff;
}
.ddbf-btn-primary:hover {
    background-color: #0a5fa8;
    color: #ffffff;
}

/* Bouton secondaire */
.ddbf-btn-secondary {
    background-color: #ffffff;
    color: #0c71c3;
    border: 2px solid #0c71c3 !important;
}
.ddbf-btn-secondary:hover {
    background-color: #f4f4f4;
}

/* Spinner */
.ddbf-spinner {
    display: none;
    font-size: 14px;
    animation: ddbf-spin 1s linear infinite;
}
@keyframes ddbf-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Icônes Divi */
.ddbf-btn-icon.et-pb-icon {
    font-size: 16px;
    line-height: 1;
}

/* === Pop-up native (exemple fourni dans le JS) === */
.ddbf-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: ddbfFadeIn 0.2s ease;
}
.ddbf-popup-box {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    max-width: 520px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: ddbfSlideUp 0.25s ease;
}
.ddbf-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 4px;
}
.ddbf-popup-close:hover { color: #111; }

@keyframes ddbfFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ddbfSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
