/**
 * Styles pour le formulaire de réservation moderne
 * GFA Formations
 */

/* Règles globales pour assurer 100% width sur tous devices */
.gfa-booking-modern * {
    box-sizing: border-box;
}

.gfa-booking-modern {
    width: 100%;
    max-width: 100%;
}

/* Container principal */
.gfa-booking-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

/* Étapes */
.gfa-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.gfa-step.active {
    display: block;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* En-tête des étapes */
.gfa-step-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.gfa-step-header h2 {
    font-size: 28px;
    color: #333;
    margin: 0;
    font-weight: 500;
}

/* Formulaire de réservation principal */
#gfa-appointment-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Grille de sélection des packs */
.gfa-packs-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gfa-pack-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px 25px;
    text-align: left;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gfa-pack-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: #e74c3c;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.gfa-pack-card:hover {
    border-color: #e74c3c;
    background: #fff5f5;
}

.gfa-pack-card:hover::before {
    transform: scaleY(1);
}

.gfa-pack-info {
    flex: 1;
}

.gfa-pack-card h3 {
    font-size: 18px;
    color: #333;
    margin: 0 0 5px 0;
    font-weight: 600;
}

.gfa-pack-duration {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.gfa-pack-price {
    font-size: 16px;
    font-weight: 600;
    color: #e74c3c;
    margin: 0;
    min-width: 80px;
    text-align: right;
}

.gfa-select-pack-btn {
    display: none;
}

/* Zone rouge avec pack sélectionné et bouton retour */
.gfa-pack-selected-info {
    background: #e74c3c;
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.gfa-pack-info h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: white;
}

.gfa-selected-pack-name {
    font-size: 18px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 15px;
}


/* Sections du formulaire */
.gfa-form-section {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.gfa-form-section h3 {
    font-size: 20px;
    color: #333;
    margin: 0 0 35px 0;
    font-weight: 600;
}

/* Grille de formulaire - MODIFIÉ pour permettre labels 100% */
.gfa-form-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.gfa-form-row .gfa-form-group {
    width: 100% !important;
    flex: 1 1 100% !important;
}

.gfa-form-group {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 15px;
}

/* FORCER ABSOLUMENT tous les labels en 100% */
.gfa-form-group label,
#gfa-appointment-form label,
.gfa-form-section label,
.gfa-booking-modern label,
[id^="gfa-"] label,
.gfa-booking-container label,
.gfa-form-row .gfa-form-group label {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #555 !important;
    margin-bottom: 0px !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Règle globale pour TOUS les labels du formulaire */
.gfa-booking-modern label,
.gfa-booking-modern .gfa-form-group label,
.gfa-booking-modern #gfa-appointment-form label {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
}

.gfa-form-group input,
.gfa-form-group textarea {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.gfa-form-group input:focus,
.gfa-form-group textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.gfa-form-group input:invalid {
    border-color: #dc3545;
}

.gfa-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Calendrier et créneaux */
.gfa-calendar-wrapper {
    margin-bottom: 30px;
}

.gfa-calendar-wrapper label,
.gfa-slots-wrapper label,
label[for="gfa-datepicker"],
label[for="gfa-time-slots"],
.ui-datepicker label {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #555 !important;
    margin-bottom: 8px !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.gfa-slots-wrapper {
    margin-top: 20px;
}

/* Datepicker personnalisé */
.gfa-datepicker-inline {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

/* Styles pour jQuery UI Datepicker */
.gfa-datepicker-inline .ui-datepicker {
    width: 100%;
    border: none;
    font-family: inherit;
}

.gfa-datepicker-inline .ui-datepicker-header {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px 6px 0 0;
    padding: 10px;
}

.gfa-datepicker-inline .ui-datepicker-title {
    color: white;
    font-weight: 600;
}

.gfa-datepicker-inline .ui-datepicker-prev,
.gfa-datepicker-inline .ui-datepicker-next {
    color: white;
    cursor: pointer;
}

.gfa-datepicker-inline .ui-state-default {
    border: none;
    background: none;
    color: #333;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.gfa-datepicker-inline .ui-state-hover {
    background: #f0f0f0;
}

.gfa-datepicker-inline .ui-state-active {
    background: #e74c3c;
    color: white;
    font-weight: 600;
}

.gfa-datepicker-inline .ui-state-disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Créneaux horaires */
.gfa-time-slots {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

/* Scrollbar personnalisée */
.gfa-time-slots::-webkit-scrollbar {
    width: 8px;
}

.gfa-time-slots::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.gfa-time-slots::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.gfa-time-slots::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.gfa-slots-placeholder {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.gfa-slots-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    opacity: 0.5;
}

.gfa-time-slot {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: center;
    background: white;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Harmoniser l'UX des boutons et inputs avec les autres sections BO */
.gfa-settings-container .button,
.gfa-settings-container select,
.gfa-settings-container input[type="number"],
.gfa-settings-container input[type="time"],
.gfa-settings-container input[type="date"] {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 8px 12px;
}

.gfa-settings-actions .button-primary {
    background: #e74c3c;
    border-color: #e74c3c;
    box-shadow: none;
}

.gfa-settings-actions .button-primary:hover {
    background: #cf3f31;
    border-color: #cf3f31;
}

.gfa-time-slot:hover:not(.disabled) {
    border-color: #e74c3c;
    background: #fff5f5;
}

.gfa-time-slot.selected {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
    font-weight: 500;
}

.gfa-time-slot.disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
    border-style: dashed;
}

.gfa-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.gfa-loading i {
    font-size: 24px;
    margin-right: 10px;
}

/* Cases à cocher carrées */
.gfa-checkbox-group {
    margin-bottom: 10px;
}

.gfa-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    padding-left: 35px;
    min-height: 24px;
    gap: 8px;
}

.gfa-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.gfa-checkbox-box {
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 3px;
    background: white;
    transition: all 0.3s ease;
}

.gfa-checkbox input[type="checkbox"]:checked ~ .gfa-checkbox-box {
    background: #e74c3c;
    border-color: #e74c3c;
}

.gfa-checkbox input[type="checkbox"]:focus ~ .gfa-checkbox-box {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.gfa-checkbox-box:after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.gfa-checkbox input[type="checkbox"]:checked ~ .gfa-checkbox-box:after {
    display: block;
}

.gfa-checkbox-label {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

.gfa-checkbox-label a {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
}

.gfa-checkbox-label a:hover {
    text-decoration: underline;
}

/* Footer du formulaire */
.gfa-form-footer {
    text-align: center;
    margin-top: 30px;
}

.gfa-footer-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

/* Bouton retour avec le même style que le bouton confirmer */
.gfa-back-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.gfa-back-btn:hover {
    background: #c0392b;
}

.gfa-submit-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.gfa-submit-btn:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.gfa-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

.gfa-btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Système d'alertes */
.gfa-alerts {
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gfa-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.gfa-alert i {
    font-size: 20px;
    flex-shrink: 0;
}

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

.gfa-alert-success i {
    color: #28a745;
}

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

.gfa-alert-error i {
    color: #dc3545;
}

.gfa-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.gfa-alert-warning i {
    color: #ffc107;
}

/* Écran de confirmation */
.gfa-confirmation-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 20px;
}

.gfa-success-icon {
    font-size: 80px;
    color: #28a745;
    margin-bottom: 30px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from { 
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.gfa-confirmation-content h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.gfa-confirmation-message {
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.6;
}

.gfa-confirmation-details {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.gfa-detail-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    font-size: 16px;
    color: #555;
}

.gfa-detail-item i {
    color: #e74c3c;
    font-size: 20px;
}

.gfa-new-booking-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.gfa-new-booking-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .gfa-booking-container {
        padding: 5px;
        margin: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .gfa-form-row,
    .gfa-datetime-selector {
        grid-template-columns: 1fr;
    }
    
    .gfa-packs-grid {
        max-width: 100%;
        gap: 6px;
    }
    
    .gfa-pack-card {
        padding: 15px 20px;
    }
    
    .gfa-pack-card h3 {
        font-size: 16px;
    }
    
    .gfa-time-slot {
        flex: 0 0 100%;
    }
    
    .gfa-step-header {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .gfa-step-header h2 {
        font-size: 24px;
    }
    
    .gfa-form-section {
        padding: 15px;
        margin: 10px 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .gfa-pack-selected-info {
        text-align: center;
    }
    
    .gfa-pack-info h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .gfa-pack-selected-info {
        padding: 15px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .gfa-step-header {
        margin-bottom: 20px;
        padding: 0 5px;
    }
    
    .gfa-footer-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .gfa-back-btn,
    .gfa-submit-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
        box-sizing: border-box;
    }
    
    .gfa-form-group input,
    .gfa-form-group textarea {
        width: 100%;
        box-sizing: border-box;
        padding: 12px;
    }
    
    .gfa-form-group label {
        font-size: 14px !important;
    }
}

/* Responsive - Très petits écrans */
@media (max-width: 480px) {
    .gfa-booking-container {
        padding: 2px;
        margin: 0;
    }
    
    .gfa-form-section {
        padding: 10px;
        margin: 5px 0;
    }
    
    .gfa-pack-selected-info {
        padding: 10px;
    }
    
    .gfa-form-group input,
    .gfa-form-group textarea {
        padding: 10px;
        font-size: 16px; /* Évite le zoom sur iOS */
    }
    
    .gfa-form-group label {
        font-size: 13px !important;
    }
    
    .gfa-back-btn,
    .gfa-submit-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Responsive - Tablette */
@media (min-width: 769px) and (max-width: 1024px) {
    .gfa-booking-container {
        padding: 15px;
    }
    
    .gfa-form-section {
        padding: 25px;
    }
}

/* Responsive - Desktop */
@media (min-width: 1025px) {
    .gfa-booking-container {
        padding: 20px;
    }
    
    .gfa-form-section {
        padding: 30px;
    }
}

/* Styles pour l'impression */
@media print {
    .gfa-back-btn,
    .gfa-new-booking-btn,
    .gfa-select-pack-btn {
        display: none;
    }
    
    .gfa-confirmation-details {
        border: 2px solid #333;
    }
}
