/**
 * Catalogue Formation Pro — Inscription Form CSS
 *
 * Structure HTML :
 *   .cfp-inscription-container
 *     .cfp-inscription-form
 *       .cfp-inscription-title
 *       .cfp-inscription-subtitle
 *       .cfp-inscription-messages → .cfp-msg-success / .cfp-msg-error
 *       .cfp-jauge-wrapper → .cfp-jauge-bar > .cfp-jauge-fill
 *       .cfp-fieldset > .cfp-fieldset-legend
 *       .cfp-fields-row > .cfp-field-group.cfp-field-half
 *       .cfp-field-label + .cfp-field-input / .cfp-field-select / .cfp-field-textarea
 *       .cfp-checkbox-group > .cfp-checkbox-label
 *       .cfp-inscription-submit
 *
 * Fallback colors (Elementor overrides via {{WRAPPER}}) :
 *   Purple #5D2A61 / Orange #E36B24
 */

/* ═══════════════════════════════════════════
   CONTENEUR
   ═══════════════════════════════════════════ */
.cfp-inscription-container {
    font-family: inherit;
}

.cfp-inscription-form {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    max-width: 680px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════
   TITRE
   ═══════════════════════════════════════════ */
.cfp-inscription-title {
    font-size: 22px;
    font-weight: 700;
    color: #5D2A61;
    margin: 0 0 8px;
}

.cfp-inscription-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════
   MESSAGES
   ═══════════════════════════════════════════ */
.cfp-inscription-msg {
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.5;
    animation: cfpFadeIn 0.3s ease;
}

.cfp-msg-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.cfp-msg-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

@keyframes cfpFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   JAUGE PLACES RESTANTES
   ═══════════════════════════════════════════ */
.cfp-jauge-wrapper {
    display: none;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 24px;
    border: 1px solid #eee;
}

.cfp-jauge-text {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}

.cfp-jauge-places {
    font-weight: 700;
    font-size: 16px;
    color: #5D2A61;
}

.cfp-jauge-bar {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.cfp-jauge-fill {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.3s ease;
}

/* ═══════════════════════════════════════════
   FIELDSETS
   ═══════════════════════════════════════════ */
.cfp-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 20px;
}

.cfp-fieldset-legend {
    font-size: 14px;
    font-weight: 700;
    color: #5D2A61;
    padding-bottom: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid #f0ecf1;
    display: block;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════
   LIGNES DE CHAMPS
   ═══════════════════════════════════════════ */
.cfp-fields-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

.cfp-field-group {
    margin-bottom: 16px;
    flex: 1;
}

.cfp-field-half {
    flex: 1;
    min-width: 0;
}

/* ═══════════════════════════════════════════
   LABELS
   ═══════════════════════════════════════════ */
.cfp-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cfp-required {
    color: #e74c3c;
    font-weight: 700;
}

/* ═══════════════════════════════════════════
   INPUTS / SELECTS / TEXTAREAS
   ═══════════════════════════════════════════ */
.cfp-field-input,
.cfp-field-select,
.cfp-field-textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.cfp-field-input:focus,
.cfp-field-select:focus,
.cfp-field-textarea:focus {
    border-color: #5D2A61;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(93, 42, 97, 0.1);
    outline: none;
}

.cfp-field-input.has-error,
.cfp-field-select.has-error,
.cfp-field-textarea.has-error {
    border-color: #e74c3c;
    background-color: #fff5f5;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.08);
}

.cfp-field-select {
    appearance: auto;
    cursor: pointer;
}

.cfp-field-textarea {
    resize: vertical;
    min-height: 60px;
}

/* ═══════════════════════════════════════════
   ERREUR CHAMP
   ═══════════════════════════════════════════ */
.cfp-field-error {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 4px;
    min-height: 16px;
    font-weight: 500;
}

/* ═══════════════════════════════════════════
   CHECKBOXES (RGPD / CGV)
   ═══════════════════════════════════════════ */
.cfp-fieldset-legal {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.cfp-checkbox-group {
    margin-bottom: 12px;
}

.cfp-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: #444;
}

.cfp-checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #5D2A61;
    cursor: pointer;
}

.cfp-checkbox-text {
    flex: 1;
}

.cfp-checkbox-text a {
    color: #5D2A61;
    font-weight: 600;
    text-decoration: underline;
}

.cfp-checkbox-text a:hover {
    color: #E36B24;
}

/* ═══════════════════════════════════════════
   HONEYPOT (caché)
   ═══════════════════════════════════════════ */
.cfp-hp-field {
    position: absolute;
    left: -9999px;
    height: 0;
    overflow: hidden;
    opacity: 0;
}

/* ═══════════════════════════════════════════
   BOUTON SUBMIT
   ═══════════════════════════════════════════ */
.cfp-inscription-actions {
    margin-top: 24px;
}

.cfp-inscription-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #E36B24;
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.cfp-inscription-submit:hover {
    background-color: #c85a1d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 107, 36, 0.3);
}

.cfp-inscription-submit:active {
    transform: translateY(0);
}

.cfp-inscription-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cfp-submit-spinner {
    display: none;
    animation: cfpSpin 0.8s linear infinite;
}

@keyframes cfpSpin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 600px) {
    .cfp-inscription-form {
        padding: 20px 16px;
    }

    .cfp-fields-row {
        flex-direction: column;
        gap: 0;
    }

    .cfp-field-half {
        width: 100%;
    }

    .cfp-inscription-title {
        font-size: 19px;
    }

    .cfp-inscription-submit {
        width: 100%;
    }
}


.cfp-field-input:focus-visible,
.cfp-field-select:focus-visible,
.cfp-field-textarea:focus-visible,
.cfp-inscription-submit:focus-visible,
.cfp-checkbox-label input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(93, 42, 97, 0.28);
    outline-offset: 2px;
}

.cfp-inscription-submit[aria-disabled="true"],
.cfp-inscription-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cfp-jauge-bar[role="progressbar"] {
    position: relative;
}

@media (prefers-reduced-motion: reduce) {
    .cfp-inscription-msg,
    .cfp-jauge-fill,
    .cfp-inscription-submit {
        animation: none;
        transition: none;
    }
}
