/* ============================================================
   MF Forms – Styles front-end
   ============================================================ */

.mff-form-wrap {
    max-width: 720px;
    margin: 0 auto;
    font-family: inherit;
}

/* Barre de progression */
.mff-progress-bar-wrap {
    background: #e9ecef;
    border-radius: 50px;
    height: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.mff-progress-bar {
    height: 100%;
    background: #2271b1;
    border-radius: 50px;
    transition: width 0.4s ease;
}

.mff-step-indicator {
    text-align: right;
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
}

/* Messages globaux */
.mff-global-message {
    padding: 14px 18px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 15px;
}

.mff-global-message.mff-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mff-global-message.mff-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Titres de section */
.mff-section-title {
    font-size: 1.4em;
    font-weight: 700;
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #2271b1;
    color: #1d2327;
}

.mff-section-desc {
    color: #555;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

/* Sous-sections */
.mff-subsection {
    margin: 24px 0;
    padding: 16px 20px;
    background: #f9f9f9;
    border-left: 4px solid #2271b1;
    border-radius: 0 4px 4px 0;
}

.mff-subsection-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 14px;
    color: #2271b1;
}

/* Blocs de contenu */
.mff-content-block {
    margin: 16px 0;
    padding: 14px 18px;
    background: #fff8e1;
    border-left: 4px solid #f0b849;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
    line-height: 1.7;
}

.mff-content-block p:last-child { margin-bottom: 0; }

/* Champs généraux */
.mff-field-wrap {
    margin-bottom: 20px;
}

.mff-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #1d2327;
}

.mff-required {
    color: #d63638;
    margin-left: 2px;
}

.mff-input,
.mff-textarea,
.mff-select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
    color: #1d2327;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.mff-input:focus,
.mff-textarea:focus,
.mff-select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
    outline: none;
}

.mff-input.mff-invalid,
.mff-textarea.mff-invalid,
.mff-select.mff-invalid {
    border-color: #d63638;
    box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.15);
}

.mff-textarea {
    resize: vertical;
    min-height: 100px;
}

.mff-input-sm {
    width: 120px;
}

/* Radio & Checkbox */
.mff-radio-group,
.mff-checkbox-group {
    border: none;
    padding: 0;
    margin: 0;
}

.mff-radio-group legend,
.mff-checkbox-group legend {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #1d2327;
}

.mff-radio-label,
.mff-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    cursor: pointer;
}

.mff-radio-label input,
.mff-checkbox-label input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #2271b1;
}

/* Toggle */
.mff-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
}

.mff-toggle-input {
    display: none;
}

.mff-toggle-slider {
    display: inline-block;
    width: 44px;
    height: 24px;
    background: #c3c4c7;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.mff-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.mff-toggle-input:checked + .mff-toggle-slider {
    background: #2271b1;
}

.mff-toggle-input:checked + .mff-toggle-slider::after {
    transform: translateX(20px);
}

/* Plage de dates */
.mff-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mff-date-range-sep {
    color: #666;
    font-size: 18px;
}

/* Notation étoiles */
.mff-rating {
    display: flex;
    gap: 4px;
    align-items: center;
}

.mff-star {
    background: none;
    border: none;
    font-size: 28px;
    color: #c3c4c7;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s, transform 0.1s;
}

.mff-star:hover,
.mff-star.active {
    color: #f0b849;
}

.mff-star:hover {
    transform: scale(1.15);
}

/* Curseur (slider) */
.mff-slider-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mff-slider {
    flex: 1;
    accent-color: #2271b1;
    height: 6px;
    cursor: pointer;
}

.mff-slider-output {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
    color: #2271b1;
    font-size: 16px;
}

/* Échelle */
.mff-scale {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mff-scale-item {
    cursor: pointer;
}

.mff-scale-item input {
    display: none;
}

.mff-scale-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 2px solid #8c8f94;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mff-scale-item input:checked + span {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.mff-scale-item:hover span {
    border-color: #2271b1;
    color: #2271b1;
}

/* Upload fichier */
.mff-file-input {
    display: block;
    width: 100%;
    padding: 8px;
    border: 2px dashed #8c8f94;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
    font-size: 13px;
    transition: border-color 0.2s;
}

.mff-file-input:hover {
    border-color: #2271b1;
}

.mff-file-hint {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Signature */
.mff-signature-wrap {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.mff-signature-canvas {
    display: block;
    background: #fff;
    cursor: crosshair;
    width: 100%;
    touch-action: none;
}

.mff-signature-actions {
    padding: 6px 10px;
    background: #f6f7f7;
    border-top: 1px solid #ddd;
}

/* Adresse */
.mff-address-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mff-address-row {
    display: flex;
    gap: 10px;
}

.mff-address-row .mff-input-sm {
    flex-shrink: 0;
}

/* Acceptation */
.mff-acceptance-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.5;
}

.mff-acceptance-label input {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #2271b1;
}

/* Texte d'aide et erreurs */
.mff-help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.mff-field-error {
    display: block;
    color: #d63638;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 600;
}

/* Navigation multi-étapes */
.mff-step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.mff-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.mff-btn:active {
    transform: scale(0.98);
}

.mff-btn-next,
.mff-btn-submit {
    background: #2271b1;
    color: #fff;
    margin-left: auto;
}

.mff-btn-next:hover,
.mff-btn-submit:hover {
    background: #135e96;
}

.mff-btn-prev {
    background: #f6f7f7;
    color: #1d2327;
    border: 1px solid #c3c4c7;
}

.mff-btn-prev:hover {
    background: #e9ecef;
}

.mff-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mff-btn-clear-sig {
    background: #f6f7f7;
    color: #d63638;
    border: 1px solid #ddd;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 600px) {
    .mff-date-range { flex-direction: column; }
    .mff-address-row { flex-direction: column; }
    .mff-scale { gap: 5px; }
    .mff-scale-item span { width: 32px; height: 32px; font-size: 12px; }
}
