/* Franchise Booking System - Styles */

/* ==================== LAYOUT PRINCIPAL ==================== */

.fbs-booking-container {
    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    position: relative;
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-height: 520px;
}

/* ==================== SIDEBAR (étapes verticales) ==================== */

.fbs-sidebar {
    width: 210px;
    min-width: 210px;
    background: #2c3e50;
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
}

.fbs-sidebar-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    cursor: default;
    position: relative;
    transition: background 0.2s;
}

.fbs-sidebar-step.active {
    background: rgba(255, 255, 255, 0.07);
}

.fbs-sidebar-step-circle {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: #4a6274;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: 700;
    transition: background 0.3s, color 0.3s;
}

.fbs-sidebar-step.completed .fbs-sidebar-step-circle {
    background: #4cd964;
    color: #fff;
}

.fbs-sidebar-step.active .fbs-sidebar-step-circle {
    background: #4cd964;
    color: #fff;
}

/* Checkmark pour les étapes complétées */
.fbs-sidebar-step.completed .fbs-sidebar-step-circle::after {
    content: '✓';
    font-size: 1em;
}

.fbs-sidebar-step.completed .fbs-sidebar-step-number {
    display: none;
}

.fbs-sidebar-step-label {
    color: #8fabbe;
    font-size: 0.9em;
    font-weight: 500;
    transition: color 0.3s;
}

.fbs-sidebar-step.active .fbs-sidebar-step-label {
    color: #4cd964;
    font-weight: 600;
}

.fbs-sidebar-step.completed .fbs-sidebar-step-label {
    color: #8fabbe;
}

/* ==================== CONTENU PRINCIPAL ==================== */

.fbs-content-area {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fbs-booking-wrapper {
    flex: 1;
    padding: 36px 40px 0 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ==================== SYSTÈME D'ÉTAPES ==================== */

.fbs-step {
    display: none;
    animation: fadeIn 0.25s ease-in;
    flex: 1;
}

.fbs-step.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fbs-step-title {
    font-size: 1.5em;
    color: #2c3e50;
    margin: 0 0 24px 0;
    font-weight: 600;
}

/* ==================== NAVIGATION (RETOUR / SUIVANT) ==================== */

.fbs-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 30px 0;
    margin-top: auto;
}

.fbs-btn {
    padding: 12px 32px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
}

.fbs-btn-back {
    background: #e8e8e8 !important;
    color: #555 !important;
    border: none !important;
    padding: 12px 32px !important;
}

.fbs-btn-back:hover {
    background: #d8d8d8 !important;
    color: #444 !important;
}

.fbs-btn-next {
    background: #4cd964 !important;
    color: #fff !important;
    border: none !important;
}

.fbs-btn-next:hover:not(:disabled) {
    background: #3cb853 !important;
    box-shadow: 0 3px 10px rgba(76, 217, 100, 0.35) !important;
}

.fbs-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fbs-btn-submit {
    background: #4cd964;
    color: #fff;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.fbs-btn-submit:hover:not(:disabled) {
    background: #3cb853;
    box-shadow: 0 3px 8px rgba(76, 217, 100, 0.3);
}

.fbs-btn-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fbs-arrow {
    font-size: 1em;
}

/* ==================== ÉTAPE 1 : FRANCHISE ==================== */

.fbs-franchise-selector {
    margin-top: 10px;
}

.fbs-franchise-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.fbs-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}

.fbs-select:focus {
    outline: none;
    border-color: #4cd964;
}

.fbs-franchise-info {
    margin-top: 16px;
}

.fbs-info-card {
    background: #f8f9fa;
    border-left: 4px solid #4cd964;
    padding: 14px 18px;
    border-radius: 4px;
}

.fbs-info-card h4 {
    margin: 0 0 6px 0;
    color: #2c3e50;
}

.fbs-info-card p {
    margin: 4px 0;
    color: #666;
    font-size: 0.9em;
}

/* ==================== SERVICES LIST ==================== */

.fbs-services-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    max-height: 380px;
}

.fbs-services-grid::-webkit-scrollbar {
    width: 5px;
}

.fbs-services-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.fbs-services-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

/* Titre de catégorie de service */
.fbs-service-category {
    color: #4cd964;
    font-size: 0.88em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 12px 0 4px 0;
    padding-left: 2px;
}

.fbs-service-category:first-child {
    margin-top: 0;
}

.fbs-service-card {
    background: #fff;
    border: 1.5px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 14px;
}

.fbs-service-card:hover {
    border-color: #4cd964;
    box-shadow: 0 2px 8px rgba(76, 217, 100, 0.12);
}

.fbs-service-card.selected {
    border-color: #4cd964;
    background: #f6fff8;
    box-shadow: 0 2px 8px rgba(76, 217, 100, 0.15);
}

/* Image ronde à gauche */
.fbs-service-image {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fbs-service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Contenu central */
.fbs-service-content {
    flex: 1;
    min-width: 0;
}

.fbs-service-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.fbs-service-card h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.3;
}

/* Badge de durée vert */
.fbs-service-duration {
    display: inline-block;
    background: #4cd964;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72em;
    font-weight: 600;
    white-space: nowrap;
}

.fbs-service-description {
    color: #777;
    font-size: 0.82em;
    margin: 6px 0 0 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fbs-service-see-more {
    color: #4cd964;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    display: inline-block;
}

.fbs-service-see-more:hover {
    text-decoration: underline;
}

/* Prix à droite */
.fbs-service-price {
    color: #4cd964;
    font-size: 1.2em;
    font-weight: 700;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
    align-self: center;
}

.fbs-no-services {
    text-align: center;
    padding: 40px;
    color: #999;
    background: #f9f9f9;
    border-radius: 8px;
}

/* ==================== MODALE SERVICE ==================== */

.fbs-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fbs-modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px 24px;
    max-width: 460px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    max-height: 80vh;
    overflow-y: auto;
}

.fbs-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6em;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.fbs-modal-close:hover { color: #333; }

.fbs-modal-title {
    margin: 0 28px 12px 0;
    font-size: 1.1em;
    font-weight: 700;
    color: #2c3e50;
}

.fbs-modal-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.fbs-modal-price {
    color: #4cd964;
    font-size: 1.1em;
    font-weight: 700;
}

.fbs-modal-description {
    color: #555;
    font-size: 0.92em;
    line-height: 1.6;
    margin-bottom: 24px;
    white-space: pre-wrap;
}

.fbs-modal-select-btn {
    width: 100%;
    background: #4cd964;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 13px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.fbs-modal-select-btn:hover { background: #3ab84f; }

/* ==================== PRATICIENS ==================== */

.fbs-practitioners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.fbs-practitioner-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.fbs-practitioner-card:hover {
    border-color: #4cd964;
    box-shadow: 0 4px 12px rgba(76, 217, 100, 0.15);
}

.fbs-practitioner-card.selected {
    border-color: #4cd964;
    background: #f6fff8;
}

.fbs-practitioner-card h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1em;
}

.fbs-no-practitioners {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* ==================== CALENDRIER ==================== */

.fbs-calendar-wrapper {
    display: flex;
    gap: 24px;
    flex: 1;
}

#fbs-calendar-container {
    flex: 1.4;
    min-width: 0;
}

#fbs-time-slots {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.fbs-time-slots-header {
    font-size: 0.95em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.fbs-time-slots-date {
    color: #4cd964;
    font-size: 0.82em;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.fbs-slots-container {
    flex: 1;
    overflow-y: auto;
    max-height: 280px;
}

.fbs-slots-container::-webkit-scrollbar {
    width: 5px;
}

.fbs-slots-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.fbs-slots-container::-webkit-scrollbar-thumb {
    background: #4cd964;
    border-radius: 3px;
}

/* Grille de créneaux horaires (2 colonnes) */
.fbs-slots-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
}

.fbs-slots-loading {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 30px 10px !important;
    gap: 10px !important;
    color: #666 !important;
    font-size: 13px !important;
}

.fbs-slots-spinner {
    width: 28px !important;
    height: 28px !important;
    border: 3px solid #e0e0e0 !important;
    border-top-color: #4cd964 !important;
    border-radius: 50% !important;
    animation: fbs-spin 0.7s linear infinite !important;
}

@keyframes fbs-spin {
    to { transform: rotate(360deg); }
}

.fbs-time-slot {
    padding: 12px 8px !important;
    background-color: #4cd964 !important;
    border: 2px solid #4cd964 !important;
    border-radius: 8px !important;
    color: #000 !important;
    cursor: pointer;
    font-size: 0.9em !important;
    font-weight: 600 !important;
    transition: all 0.2s;
    text-align: center !important;
    display: block !important;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.fbs-time-slot small {
    display: block !important;
    font-size: 0.82em !important;
    margin-top: 3px !important;
    font-weight: normal !important;
    color: #000 !important;
    opacity: 0.8 !important;
}

.fbs-time-slot:hover {
    background-color: #3db854 !important;
    border-color: #3db854 !important;
    box-shadow: 0 2px 8px rgba(76, 217, 100, 0.3) !important;
}

.fbs-time-slot.selected {
    background-color: #2fa047 !important;
    color: #fff !important;
    border-color: #2fa047 !important;
}

.fbs-time-slot.selected small {
    color: rgba(255, 255, 255, 0.95) !important;
}

.fbs-no-slots {
    padding: 20px 10px;
    text-align: center;
    color: #999;
    font-size: 0.9em;
    grid-column: 1 / -1;
}

/* Calendrier mensuel */
.fbs-calendar {
    background: #fff;
    border-radius: 8px;
    padding: 18px;
}

.fbs-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.fbs-calendar-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

.fbs-calendar-prev,
.fbs-calendar-next {
    background: none !important;
    border: none !important;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #000 !important;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.fbs-calendar-prev:hover,
.fbs-calendar-next:hover {
    color: #333 !important;
}

.fbs-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 6px;
}

.fbs-calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: #999;
    padding: 8px 0;
    font-size: 0.8em;
    text-transform: uppercase;
}

.fbs-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.fbs-calendar-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.fbs-calendar-day-empty {
    background: transparent;
    cursor: default;
}

.fbs-calendar-day-number {
    font-size: 0.9em;
    font-weight: 500;
    color: #444;
}

/* Barre de progression des créneaux sous le jour */
.fbs-calendar-day-badge {
    position: absolute;
    bottom: 4px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #e8e8e8;
    border-radius: 2px;
    overflow: hidden;
}

.fbs-calendar-day-badge-fill {
    height: 100%;
    background: #4cd964;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* États des jours */
.fbs-calendar-day-past {
    background: transparent;
    cursor: not-allowed;
}

.fbs-calendar-day-past .fbs-calendar-day-number {
    color: #ccc;
}

.fbs-calendar-day-today .fbs-calendar-day-number {
    font-weight: 700;
    color: #2c3e50;
}

.fbs-calendar-day-available {
    background: #fafafa;
}

.fbs-calendar-day-available:hover {
    background: #f0fdf4;
}

.fbs-calendar-day-full {
    cursor: not-allowed;
}

.fbs-calendar-day-full .fbs-calendar-day-number {
    color: #ccc;
}

.fbs-calendar-day-selected {
    background: #4cd964 !important;
    border-radius: 6px;
}

.fbs-calendar-day-selected .fbs-calendar-day-number {
    color: #fff;
    font-weight: 700;
}

.fbs-calendar-day-selected .fbs-calendar-day-badge {
    background: rgba(255, 255, 255, 0.3);
}

.fbs-calendar-day-selected .fbs-calendar-day-badge-fill {
    background: rgba(255, 255, 255, 0.8);
}

/* ==================== FORMULAIRE CLIENT ==================== */

.fbs-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fbs-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
}

.fbs-form-group {
    display: flex;
    flex-direction: column;
}

.fbs-form-group.full-width {
    grid-column: 1 / -1;
}

.fbs-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #444;
    font-size: 0.88em;
}

.fbs-form-group label .required {
    color: #e74c3c;
}

.fbs-input {
    padding: 11px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.fbs-input:focus {
    outline: none;
    border-color: #4cd964;
}

.fbs-input::placeholder {
    color: #bbb;
}

.fbs-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Groupe téléphone avec sélecteur de pays */
.fbs-phone-group {
    display: flex;
    gap: 0;
}

.fbs-phone-flag {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: #f5f5f5;
    border: 1.5px solid #e0e0e0;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 1.1em;
    min-width: 48px;
    justify-content: center;
}

.fbs-phone-group .fbs-input {
    border-radius: 0 6px 6px 0;
    flex: 1;
}

/* Section titre (ex: "Adresse pour la facture") */
.fbs-form-section-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 8px;
    margin-bottom: 2px;
    grid-column: 1 / -1;
}

/* ==================== RÉCAPITULATIF ==================== */

.fbs-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
}

.fbs-summary h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 0.95em;
}

.fbs-summary-content p {
    margin: 6px 0;
    font-size: 0.9em;
    color: #555;
}

.fbs-summary-content strong {
    color: #2c3e50;
}

/* ==================== CONFIRMATION ==================== */

.fbs-confirmation {
    text-align: center;
    padding: 60px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fbs-success-icon {
    width: 72px;
    height: 72px;
    background: #4cd964;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    margin-bottom: 24px;
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

.fbs-confirmation h3 {
    color: #4cd964;
    font-size: 1.7em;
    margin: 0 0 12px 0;
}

.fbs-confirmation p {
    color: #666;
    font-size: 1em;
    margin: 0 0 28px 0;
}

.fbs-btn-new-booking {
    background: #4cd964;
    color: #fff;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.fbs-btn-new-booking:hover {
    background: #3cb853;
}

/* ==================== LOADER ==================== */

.fbs-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.82);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;
    pointer-events: all;
    gap: 14px;
}

.fbs-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8e8e8;
    border-top: 3px solid #4cd964;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.fbs-loader-text {
    font-size: 0.95em;
    color: #555;
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== MESSAGES D'ERREUR ==================== */

.fbs-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9em;
}

/* ==================== DIVERS ==================== */

#fbs-message {
    display: none;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9em;
}

#fbs-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#fbs-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ==================== RESPONSIVE ==================== */

/* Titre d'étape mobile (masqué sur desktop) */
.fbs-mobile-step-title {
    display: none;
}

/* ---- Grands écrans : légère respiration ---- */
@media (min-width: 1200px) {
    .fbs-booking-container {
        max-width: 1060px;
    }
}

/* ---- Tablette large (1024px) : sidebar réduite ---- */
@media (max-width: 1024px) {
    .fbs-booking-container {
        max-width: 100%;
        border-radius: 8px;
    }

    .fbs-sidebar {
        width: 170px;
        min-width: 170px;
        padding: 28px 0;
    }

    .fbs-sidebar-step-label {
        font-size: 0.78em;
    }

    .fbs-booking-wrapper {
        padding: 28px 28px 0 28px;
    }

    .fbs-calendar-wrapper {
        gap: 16px;
    }

    .fbs-slots-container {
        max-height: 260px;
    }
}

/* ---- Tablette portrait (900px) : sidebar encore plus réduite + layout ajusté ---- */
@media (max-width: 900px) {
    .fbs-sidebar {
        width: 140px;
        min-width: 140px;
        padding: 24px 0;
    }

    .fbs-sidebar-step-label {
        font-size: 0.72em;
    }

    .fbs-sidebar-step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.8em;
    }

    .fbs-booking-wrapper {
        padding: 24px 20px 0 20px;
    }

    .fbs-step-title {
        font-size: 1.25em;
        margin-bottom: 18px;
    }

    /* Calendrier + créneaux : le calendrier prend plus de place */
    .fbs-calendar-wrapper {
        gap: 12px;
    }

    .fbs-slots-container {
        max-height: 240px;
    }

    /* Services : 2 colonnes si assez large */
    .fbs-services-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }

    /* Praticiens : 2 colonnes min */
    .fbs-practitioners-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    /* Formulaire : passe à 1 colonne */
    .fbs-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .fbs-form-group.full-width {
        grid-column: 1;
    }

    /* Boutons légèrement plus petits */
    .fbs-btn {
        padding: 10px 22px;
        font-size: 14px;
    }

    /* Popup semaines : plus compact */
    .fbs-popup-box {
        padding: 24px 20px 20px;
    }

    /* RDV supplémentaires */
    .fbs-additional-confirmed-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .fbs-additional-confirmed-card-remove {
        align-self: flex-end;
    }
}

@media (max-width: 768px) {
    .fbs-booking-container {
        flex-direction: column;
        min-height: auto;
    }

    /* Masquer la sidebar horizontale scrollable sur mobile */
    .fbs-sidebar {
        display: none;
    }

    /* Afficher le titre d'étape mobile à la place */
    .fbs-mobile-step-title {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #2c3e50;
        padding: 14px 20px;
        color: #fff;
    }

    .fbs-mobile-step-title-circle {
        width: 28px;
        height: 28px;
        min-width: 28px;
        border-radius: 50%;
        background: #4cd964;
        color: #fff;
        font-size: 0.8em;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .fbs-mobile-step-title-label {
        font-size: 0.95em;
        font-weight: 600;
        color: #fff;
    }

    .fbs-booking-wrapper {
        padding: 24px 20px 0 20px;
    }

    .fbs-step-title {
        font-size: 1.2em;
    }

    .fbs-calendar-wrapper {
        flex-direction: column;
        gap: 16px;
    }

    .fbs-form-grid {
        grid-template-columns: 1fr;
    }

    .fbs-form-group.full-width {
        grid-column: 1;
    }

    /* Créneaux sur 1 colonne sur mobile */
    .fbs-slots-grid {
        grid-template-columns: 1fr !important;
    }

    .fbs-navigation {
        padding: 20px 0 24px 0;
    }

    .fbs-btn {
        padding: 9px 20px !important;
        font-size: 13px !important;
    }

    .fbs-success-icon {
        width: 56px;
        height: 56px;
        font-size: 2em;
    }

    .fbs-confirmation h3 {
        font-size: 1.4em;
    }

    /* Modal : évite le débordement sur très petits écrans */
    .fbs-modal-box {
        max-width: calc(100vw - 32px);
        padding: 24px 16px;
    }

    /* Groupe téléphone : empile indicatif + input */
    .fbs-phone-group {
        flex-direction: column;
        align-items: stretch;
    }

    .fbs-phone-flag-select {
        width: 100%;
    }

    /* Services en colonne unique sur mobile */
    .fbs-services-grid {
        grid-template-columns: 1fr !important;
    }

    /* Popup semaines : plein écran quasi */
    .fbs-popup-box {
        max-width: calc(100vw - 32px);
        padding: 24px 16px 20px;
    }

    /* Calendrier : prend toute la largeur */
    .fbs-calendar {
        width: 100%;
    }

    /* Créneaux : hauteur max réduite */
    .fbs-slots-container {
        max-height: 220px;
    }

    /* Confirmation recap : texte plus petit */
    .fbs-recap-table td {
        font-size: 0.85em;
        padding: 6px 8px;
    }
}

/* ==========================================================
   RDV SUPPLÉMENTAIRES / DE SUIVI — ÉTAPE 4.5
   ========================================================== */

.fbs-additional-desc {
    font-size: 0.95em;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Note d'info RDV de suivi */
.fbs-info-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff8e1;
    border: 2px solid #f59e0b;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.fbs-info-note-icon {
    font-size: 1.3em;
    flex-shrink: 0;
    line-height: 1.4;
}

.fbs-info-note p {
    margin: 0;
    font-size: 0.95em;
    color: #78350f;
    line-height: 1.6;
    font-weight: 500;
}

#fbs-additional-appointments-page {
    padding: 20px;
    border-radius: 12px;
    min-height: 200px;
}

/* Pack → vert */
#fbs-additional-appointments-page.fbs-additional-suivi {
    border: 2px solid #22c55e;
    background: #f0fdf4;
}

/* Autre service → bleu */
#fbs-additional-appointments-page.fbs-additional-extra {
    border: 2px solid #3b82f6;
    background: #eff6ff;
}

.fbs-additional-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.fbs-additional-header h4 {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
}

.fbs-additional-suivi .fbs-additional-header h4 {
    color: #15803d;
}

.fbs-additional-extra .fbs-additional-header h4 {
    color: #1d4ed8;
}

.fbs-btn-add-appt {
    background: #15803d;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.fbs-additional-extra .fbs-btn-add-appt {
    background: #1d4ed8;
}

.fbs-btn-add-appt:hover {
    opacity: 0.85;
}

.fbs-limit-msg {
    padding: 8px 16px;
    font-size: 0.8em;
    color: #15803d;
    margin: 0;
}

.fbs-additional-extra .fbs-limit-msg {
    color: #1d4ed8;
}

/* Ligne individuelle de RDV supplémentaire */
.fbs-additional-row {
    background: #fff;
    border-radius: 8px;
    margin: 12px 12px 0;
    border: 1px solid rgba(0,0,0,0.08);
    overflow: hidden;
}

#fbs-additional-rows .fbs-additional-row:last-child {
    margin-bottom: 12px;
}

.fbs-additional-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.fbs-additional-row-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #374151;
}

.fbs-btn-remove-appt {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    font-weight: 700;
    transition: opacity 0.2s;
}

.fbs-btn-remove-appt:hover {
    opacity: 0.7;
}

.fbs-additional-row-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fbs-additional-row-body .fbs-form-group {
    margin: 0;
}

.fbs-additional-row-body label {
    font-size: 0.82em;
    font-weight: 600;
    color: #6b7280;
    display: block;
    margin-bottom: 4px;
}

.fbs-appt-slots,
.fbs-appt-practitioners {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.fbs-appt-slot {
    font-size: 0.82em;
    padding: 5px 10px;
    border-radius: 6px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.fbs-appt-slot:hover {
    background: #e5e7eb;
}

.fbs-appt-slot.selected {
    background: #4cd964;
    border-color: #22c55e;
    color: #fff;
}

.fbs-appt-practitioner {
    font-size: 0.82em;
    padding: 5px 10px;
    border-radius: 6px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.fbs-appt-practitioner:hover {
    background: #e5e7eb;
}

.fbs-appt-practitioner.selected {
    background: #4cd964;
    border-color: #22c55e;
    color: #fff;
}

.fbs-appt-pract-auto {
    font-size: 0.85em;
    color: #374151;
    font-style: italic;
}

.fbs-appt-slots-wrap label,
.fbs-appt-practitioners-wrap label {
    font-size: 0.82em;
    font-weight: 600;
    color: #6b7280;
    display: block;
    margin-bottom: 4px;
}

/* ========== NOUVEAU DESIGN RDV DE SUIVI ========== */

/* Liste des RDV confirmés */
#fbs-additional-confirmed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

/* Card d'un RDV confirmé */
.fbs-additional-confirmed-card {
    background: #fff;
    border: 2px solid #22c55e;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.fbs-additional-suivi .fbs-additional-confirmed-card {
    border-color: #22c55e;
    background: #f0fdf4;
}

.fbs-additional-extra .fbs-additional-confirmed-card {
    border-color: #3b82f6;
    background: #eff6ff;
}

.fbs-additional-confirmed-card-content {
    flex: 1;
}

.fbs-additional-confirmed-card-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #15803d;
    margin: 0 0 8px 0;
}

.fbs-additional-extra .fbs-additional-confirmed-card-title {
    color: #1d4ed8;
}

.fbs-additional-confirmed-card-date {
    font-size: 0.85em;
    color: #6b7280;
    margin: 0 0 4px 0;
}

.fbs-additional-confirmed-card-slot {
    font-size: 0.85em;
    color: #374151;
    font-weight: 500;
}

.fbs-additional-confirmed-card-remove {
    background: none !important;
    color: #9ca3af !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    width: 34px !important;
    height: 34px !important;
    cursor: pointer;
    transition: all 0.2s;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    flex-shrink: 0;
}

.fbs-additional-confirmed-card-remove:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border-color: #fca5a5 !important;
}

.fbs-additional-confirmed-card-remove svg {
    pointer-events: none;
}

/* Formulaire d'ajout - sans bordure, même look que l'étape calendrier principale */
#fbs-additional-form-container {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 16px;
}

.fbs-additional-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.fbs-additional-form-header h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

/* Bouton annuler - petit et discret */
.fbs-btn-cancel-additional {
    background: none !important;
    color: #999 !important;
    border: 1px solid #ddd !important;
    border-radius: 50% !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 0.9em !important;
    cursor: pointer;
    transition: all 0.2s;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    line-height: 1 !important;
}

.fbs-btn-cancel-additional:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border-color: #ef4444 !important;
}

/* Flèches navigation calendrier des RDV de suivi - MÊME STYLE QUE PRINCIPAL */
.fbs-additional-calendar-prev,
.fbs-additional-calendar-next {
    background: none !important;
    border: none !important;
    width: 24px !important;
    height: 24px !important;
    cursor: pointer;
    font-size: 1em !important;
    font-weight: 600 !important;
    color: #000 !important;
    transition: color 0.2s;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.fbs-additional-calendar-prev:hover,
.fbs-additional-calendar-next:hover {
    color: #333 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Wrapper calendrier + créneaux pour RDV de suivi - MÊME STYLE QUE PRINCIPAL */
#fbs-additional-form-container .fbs-calendar-wrapper {
    display: flex;
    gap: 24px;
    flex: 1;
    margin-bottom: 16px;
}

/* Calendrier pour RDV de suivi - MÊME PROPORTION QUE PRINCIPAL */
#fbs-additional-calendar-container {
    flex: 1.4;
    min-width: 0;
}

/* Le calendrier à l'intérieur hérite des styles globaux .fbs-calendar */
#fbs-additional-calendar-container .fbs-calendar {
    /* Tous les styles sont déjà définis globalement */
}

/* Créneaux horaires pour RDV de suivi - MÊME STRUCTURE QUE PRINCIPAL */
#fbs-additional-time-slots {
    flex: 1;
    min-width: 0;
    display: flex; /* Toujours visible, comme le calendrier principal */
    flex-direction: column;
}

#fbs-additional-time-slots .fbs-time-slots-header {
    font-size: 0.95em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

#fbs-additional-time-slots .fbs-time-slots-date {
    color: #4cd964;
    font-size: 0.82em;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

#fbs-additional-slots-container {
    flex: 1;
    overflow-y: auto;
    max-height: 280px;
    /* PAS de grid ici - la grille est dans .fbs-slots-grid comme le calendrier principal */
}

/* Scrollbar personnalisée pour les créneaux de suivi */
#fbs-additional-slots-container::-webkit-scrollbar {
    width: 5px;
}

#fbs-additional-slots-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#fbs-additional-slots-container::-webkit-scrollbar-thumb {
    background: #4cd964;
    border-radius: 3px;
}

/* Les créneaux héritent du style global .fbs-time-slot ET .fbs-slots-grid */

/* Bouton valider le RDV - MÊME STYLE QUE .fbs-btn-next */
.fbs-btn-validate-additional {
    background: #4cd964 !important;
    color: #fff !important;
    border: none !important;
    width: 100%;
    margin-top: 16px;
}

.fbs-btn-validate-additional:hover {
    background: #3cb853 !important;
    box-shadow: 0 3px 10px rgba(76, 217, 100, 0.35) !important;
}

/* Bouton ajouter (sous les cards) - MÊME STYLE QUE .fbs-btn-next */
.fbs-btn-add-appt {
    background: #4cd964 !important;
    color: #fff !important;
    border: none !important;
    width: 100%;
    margin-top: 8px;
}

.fbs-btn-add-appt:hover {
    background: #3cb853 !important;
    box-shadow: 0 3px 10px rgba(76, 217, 100, 0.35) !important;
}

@media (max-width: 768px) {
    /* Calendrier + créneaux empilés sur mobile */
    #fbs-additional-form-container .fbs-calendar-wrapper {
        flex-direction: column;
        gap: 16px;
    }

    .fbs-additional-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .fbs-additional-confirmed-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .fbs-additional-confirmed-card-remove {
        align-self: flex-end;
    }
}

/* ==================== POPUP DISPONIBILITÉS SEMAINES SUIVANTES ==================== */

#fbs-weeks-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fbs-popup-box {
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px 28px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    text-align: center;
}

.fbs-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6em;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.fbs-popup-close:hover { color: #333; }

.fbs-popup-icon {
    font-size: 2.4em;
    margin-bottom: 12px;
}

.fbs-popup-title {
    font-size: 1.05em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 6px 0;
}

.fbs-popup-subtitle {
    font-size: 0.88em;
    color: #6b7280;
    margin: 0 0 20px 0;
}

.fbs-popup-weeks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.fbs-popup-week-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px 14px;
    gap: 12px;
}

.fbs-popup-week-label {
    font-size: 0.88em;
    color: #374151;
}

.fbs-popup-count {
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
}

.fbs-popup-count-available {
    background: #dcfce7;
    color: #166534;
}

.fbs-popup-count-none {
    background: #f3f4f6;
    color: #9ca3af;
}
