/* Extrait de public-registration.php (déplacement sans changement : le bloc <style> intégré à la page). */
* { box-sizing: border-box; }

.fbm-wrapper {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #13343b;
}

.fbm-card {
    background: #fffffd;
    border: 1px solid rgba(94,82,64,0.15);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.04), 0 2px 4px -2px rgba(0,0,0,0.04);
    overflow: hidden;
}

.fbm-header {
    background: #fcfcf9;
    padding: 2.5rem 2rem;
    text-align: center;
    border-bottom: 3px solid #21808d;
}

.fbm-logo {
    max-height: 80px;
    margin-bottom: 1rem;
}

.fbm-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    color: #13343b;
}

.fbm-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 1.1rem;
    color: #626c6c;
    font-weight: 500;
}

.fbm-required-notice {
    margin: 1rem 0 0 0;
    font-size: 0.875rem;
    color: #626c6c;
}

.fbm-intro-text {
    margin: 20px 2rem 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(33,128,141,0.08);
    border-left: 4px solid #21808d;
    border-radius: 8px;
    color: #13343b;
    line-height: 1.6;
}
.fbm-intro-text p:first-child { margin-top: 0; }
.fbm-intro-text p:last-child { margin-bottom: 0; }

.fbm-section-text {
    margin: -0.5rem 0 1.25rem 0;
    font-size: 0.9rem;
    color: #626c6c;
    line-height: 1.5;
}
.fbm-section-text p:first-child { margin-top: 0; }
.fbm-section-text p:last-child { margin-bottom: 0; }

.fbm-section {
    padding: 2rem;
    border-bottom: 1px solid rgba(94,82,64,0.15);
}

.fbm-section:last-of-type {
    border-bottom: none;
}

.fbm-section:first-of-type {
    margin-top: 20px;
}

.fbm-section-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #13343b;
}

.fbm-help-text {
    margin: 0 0 1.5rem 0;
    font-size: 0.875rem;
    color: #626c6c;
}

.fbm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.fbm-field label {
    display: block;
    font-weight: 500;
    color: #13343b;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.fbm-field input,
.fbm-field textarea,
.fbm-field select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(94,82,64,0.3);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #13343b;
}

.fbm-field input.fbm-champ-erreur,
.fbm-field select.fbm-champ-erreur,
.fbm-field textarea.fbm-champ-erreur { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,0.15); }
.fbm-field input:focus,
.fbm-field textarea:focus,
.fbm-field select:focus {
    outline: none;
    border-color: #21808d;
    box-shadow: 0 0 0 3px rgba(33,128,141,0.15);
}

.fbm-full {
    grid-column: 1 / -1;
}

/* Upload photo */
.fbm-upload-zone {
    position: relative;
}

.fbm-upload-zone input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.fbm-upload-zone input[type="file"]:focus-visible + .fbm-upload-label {
    outline: 3px solid #21808d;
    outline-offset: 2px;
}

.fbm-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    background: #fcfcf9;
    border: 2px dashed rgba(94,82,64,0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    max-width: 400px;
    margin: 0 auto;
}

.fbm-upload-label:hover {
    border-color: #21808d;
    background: rgba(33,128,141,0.06);
}

.upload-icon {
    font-size: 2.5rem;
}

.upload-text {
    font-weight: 500;
    color: #13343b;
}

.fbm-upload-label small {
    color: #626c6c;
    font-size: 0.875rem;
}

.fbm-photo-preview {
    margin-top: 1rem;
    text-align: center;
    position: relative;
}

.fbm-photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: cover;
}

.remove-photo {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #c0152f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

/* Checkboxes */
.fbm-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.fbm-checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #fcfcf9;
    border: 1px solid rgba(94,82,64,0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.fbm-checkbox-item:hover {
    background: rgba(33,128,141,0.06);
    border-color: #21808d;
}

.fbm-checkbox-item input {
    margin-right: 0.75rem;
    width: auto;
    accent-color: #21808d;
}

.fbm-checkbox-item input:checked + span {
    font-weight: 600;
    color: #21808d;
}

/* Disponibilités */
.availability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.fbm-evenement-group {
    margin-bottom: 1.75rem;
}
.fbm-evenement-group:last-child {
    margin-bottom: 0;
}

.fbm-evenement-group-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #21808d;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid rgba(33,128,141,0.2);
}

.day-block {
    background: #fcfcf9;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(94,82,64,0.2);
}

.day-block strong {
    display: block;
    margin-bottom: 0.75rem;
    color: #13343b;
    font-size: 1rem;
    font-weight: 600;
}

.slot-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.slot-checkbox:hover {
    background: rgba(33,128,141,0.08);
}

.slot-checkbox input {
    margin: 0;
    width: auto;
    accent-color: #21808d;
}

/* Actions */
.fbm-actions {
    padding: 2rem;
    text-align: center;
    background: #fcfcf9;
}

.fbm-btn-primary {
    background: #21808d;
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.fbm-btn-primary:hover:not(:disabled) {
    background: #1d7480;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33,128,141,0.25);
}

.fbm-btn-primary:disabled {
    opacity: 0.6;
    cursor: wait;
}

.fbm-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.fbm-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fbm-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.fbm-status.loading {
    color: #004085;
    background: #cce5ff;
    border: 1px solid #b8daff;
}

.fbm-notice {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.required {
    color: #c0152f;
    font-weight: 700;
}

.fbm-consent-section {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.fbm-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: #13343b;
    line-height: 1.5;
    cursor: pointer;
}

.fbm-consent-label input[type="checkbox"] {
    margin-top: 0.2rem;
    width: auto;
    flex-shrink: 0;
    accent-color: #21808d;
}

.fbm-consent-label a {
    color: #21808d;
}

.fbm-empty {
    color: #626c6c;
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

@media (max-width: 768px) {
    .fbm-wrapper {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }
    .fbm-grid, .fbm-checkbox-grid, .availability-grid {
        grid-template-columns: 1fr;
    }
    .fbm-section {
        padding: 1.5rem 1rem;
    }
    .fbm-header {
        padding: 2rem 1rem;
    }
}
/* --- MODE ADMIN --- */
.fbm-wrapper.fbm-mode-admin {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
}

.fbm-wrapper.fbm-mode-admin .fbm-card {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
}

.fbm-wrapper.fbm-mode-admin .fbm-section {
    padding: 2rem  2rem; /* Un peu plus compact en admin */
}
/* --------------------------- */

/* --- CHOIX "DÉJÀ BÉNÉVOLE ?" --- */
.fbm-reg-choice,
.fbm-reg-existing-box {
    padding: 2rem;
    text-align: center;
    background: #fcfcf9;
    border-bottom: 1px solid rgba(94,82,64,0.15);
}

.fbm-reg-choice-question {
    margin: 0 0 1.2rem 0;
    font-size: 1.05rem;
    font-weight: 500;
    color: #13343b;
}

.fbm-reg-choice-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.fbm-btn-secondary {
    background: #fff;
    color: #21808d;
    border: 1px solid #21808d;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.fbm-btn-secondary:hover {
    background: rgba(33,128,141,0.08);
}

.fbm-reg-existing-box p {
    margin: 0 0 1rem 0;
    color: #495057;
}

.fbm-reg-existing-box .fbm-input {
    width: 100%;
    max-width: 360px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(94,82,64,0.3);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.fbm-btn-link {
    display: block;
    margin: 1rem auto 0;
    background: none;
    border: none;
    color: #767c7c;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
}
/* --------------------------- */

/* Téléphone : champs à 16 px (sinon iOS zoome à la saisie) et zones tactiles d'au moins 44 px (cases des créneaux, boutons). */
@media (max-width: 640px) {
    #fbm-registration-public input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
    #fbm-registration-public select,
    #fbm-registration-public textarea { font-size: 16px; min-height: 44px; }
    #fbm-registration-public .slot-checkbox { min-height: 44px; display: flex; align-items: center; }
    #fbm-registration-public button, #fbm-registration-public .fbm-btn { min-height: 44px; }
}
