/**
 * Styles du formulaire de réservation
 * Design élégant rose/beige - Compatible Elementor Modal
 */

/* Variables */
:root {
    --rel-primary: #d4a5a5;
    --rel-primary-light: #f5e6e6;
    --rel-primary-dark: #c28b8b;
    --rel-accent: #3eb489;
    --rel-text: #5a5a5a;
    --rel-text-light: #888888;
    --rel-border: #e8d4d4;
    --rel-bg: #ffffff;
    --rel-error: #e74c3c;
    --rel-success: #27ae60;
    --rel-shadow: 0 2px 10px rgba(212, 165, 165, 0.15);
    --rel-radius: 8px;
    --rel-transition: all 0.3s ease;
}

/* Wrapper principal */
.reservation-online-wrapper {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

/* Formulaire */
.reservation-online-form {
    background: var(--rel-bg);
    padding: 25px;
    border-radius: var(--rel-radius);
    border: 2px solid var(--rel-border);
}

/* Lignes du formulaire */
.reservation-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.reservation-form-row:last-child {
    margin-bottom: 0;
}

/* Espace pour les erreurs */
.reservation-form-row.has-error-space {
    margin-bottom: 28px;
}

/* Groupes de champs */
.reservation-form-group {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Messages d'erreur en position absolue */
.reservation-form-group .field-error,
.input-with-icon .field-error {
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    font-size: 11px;
    color: var(--rel-error);
    white-space: nowrap;
    z-index: 10;
    background: white;
    padding: 3px 8px;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    line-height: 1.3;
}

/* Inputs avec icône */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    padding-bottom: 0;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 15px;
    padding-right: 45px;
    border: 1.5px solid var(--rel-border);
    border-radius: var(--rel-radius);
    font-size: 14px;
    color: var(--rel-text);
    background: var(--rel-bg);
    transition: var(--rel-transition);
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--rel-primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 165, 0.2);
}

.input-with-icon input::placeholder {
    color: var(--rel-text-light);
}

.input-icon {
    position: absolute;
    right: 12px;
    width: 22px;
    height: 22px;
    color: var(--rel-accent);
    pointer-events: none;
}

.input-icon svg {
    width: 100%;
    height: 100%;
}

/* Inputs standards */
.reservation-form-group > input[type="text"],
.reservation-form-group > input[type="email"],
.reservation-form-group > input[type="tel"],
.reservation-form-group > input[type="number"],
.reservation-form-group > input[type="date"] {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid var(--rel-border);
    border-radius: var(--rel-radius);
    font-size: 14px;
    color: var(--rel-text);
    background: var(--rel-bg);
    transition: var(--rel-transition);
    box-sizing: border-box;
}

.reservation-form-group > input:focus {
    outline: none;
    border-color: var(--rel-primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 165, 0.2);
}

.reservation-form-group > input::placeholder {
    color: var(--rel-text-light);
}

/* Select wrapper */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1.5px solid var(--rel-border);
    border-radius: var(--rel-radius);
    font-size: 14px;
    color: var(--rel-text);
    background: var(--rel-bg);
    appearance: none;
    cursor: pointer;
    transition: var(--rel-transition);
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--rel-primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 165, 0.2);
}

.select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--rel-text-light);
    pointer-events: none;
}

/* Input date */
input[type="date"] {
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

/* Input number */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* Section Menu */
.reservation-menu-section {
    background: var(--rel-primary-light);
    padding: 20px;
    border-radius: var(--rel-radius);
    margin-bottom: 15px;
    margin-top: 10px;
}

.reservation-section-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--rel-text);
    margin-bottom: 12px;
    text-align: center;
}

.reservation-menu-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.reservation-menu-item {
    flex: 1;
    min-width: 100px;
    max-width: 140px;
    text-align: center;
}

.reservation-menu-item label {
    display: block;
    font-size: 12px;
    color: var(--rel-text);
    margin-bottom: 6px;
    font-weight: 500;
}

.reservation-menu-item input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1.5px solid var(--rel-border);
    border-radius: var(--rel-radius);
    font-size: 16px;
    text-align: center;
    color: var(--rel-text);
    background: var(--rel-bg);
    transition: var(--rel-transition);
    box-sizing: border-box;
}

.reservation-menu-item input[type="number"]:focus {
    outline: none;
    border-color: var(--rel-primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 165, 0.2);
}

.reservation-form-group-full {
    width: 100%;
    flex: none;
}

.reservation-form-group-full .reservation-section-title {
    margin-bottom: 8px;
}

/* Texte informatif menu */
.reservation-menu-info {
    margin: 15px 0 0 0;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    font-size: 13px;
    color: var(--rel-text);
    text-align: center;
    border-left: 3px solid var(--rel-primary);
}

.reservation-menu-info .info-icon {
    margin-right: 5px;
}

/* Checkbox RGPD */
.reservation-rgpd {
    margin-top: 20px;
    margin-bottom: 20px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: var(--rel-text);
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--rel-border);
    border-radius: 4px;
    background: var(--rel-bg);
    position: relative;
    transition: var(--rel-transition);
    margin-top: 2px;
}

.checkbox-container:hover .checkmark {
    border-color: var(--rel-primary);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--rel-primary);
    border-color: var(--rel-primary);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    flex: 1;
}

/* Bouton submit */
.reservation-submit-row {
    margin-top: 25px;
    justify-content: center;
}

.reservation-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--rel-primary) 0%, var(--rel-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--rel-transition);
    box-shadow: 0 4px 15px rgba(212, 165, 165, 0.4);
    position: relative;
    overflow: hidden;
}

.reservation-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 165, 0.5);
}

.reservation-submit-btn:active {
    transform: translateY(0);
}

.reservation-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loader du bouton */
.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

.reservation-submit-btn.loading .btn-text {
    opacity: 0.7;
}

.reservation-submit-btn.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Messages de réponse */
.reservation-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: var(--rel-radius);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.reservation-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.reservation-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Animation du message */
.reservation-message.show {
    animation: slideIn 0.3s ease;
}

/* Message de succès qui remplace le formulaire */
.reservation-success-message {
    text-align: center;
    padding: 40px 30px;
    animation: fadeInScale 0.4s ease;
}

.reservation-success-message .success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.reservation-success-message.success .success-icon {
    background: linear-gradient(135deg, var(--rel-accent) 0%, #2d9a6e 100%);
}

.reservation-success-message.error .success-icon {
    background: linear-gradient(135deg, var(--rel-error) 0%, #c0392b 100%);
}

.reservation-success-message .success-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--rel-text);
    margin-bottom: 25px;
}

.reservation-success-message .reservation-new-btn {
    display: inline-block;
    padding: 12px 30px;
    background: transparent;
    color: var(--rel-primary-dark);
    border: 2px solid var(--rel-primary);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--rel-transition);
}

.reservation-success-message .reservation-new-btn:hover {
    background: var(--rel-primary);
    color: white;
}

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

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

/* État d'erreur des champs */
.reservation-form-group.has-error input,
.reservation-form-group.has-error select,
.input-with-icon.has-error input {
    border-color: var(--rel-error);
}

.reservation-form-group.has-error input:focus,
.reservation-form-group.has-error select:focus,
.input-with-icon.has-error input:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
    .reservation-online-wrapper {
        padding: 10px;
    }

    .reservation-online-form {
        padding: 20px 15px;
    }

    .reservation-form-row {
        flex-direction: column;
        gap: 25px;
    }

    /* Plus d'espace pour les erreurs sur mobile */
    .reservation-form-group {
        margin-bottom: 5px;
    }

    .reservation-form-group .field-error,
    .input-with-icon .field-error {
        position: absolute;
        left: 0;
        top: 100%;
        white-space: normal;
        max-width: 100%;
    }

    .reservation-submit-btn {
        width: 100%;
    }

    /* Menu section responsive */
    .reservation-menu-row {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .reservation-menu-item {
        max-width: 180px;
        width: 100%;
        text-align: center;
    }

    .reservation-menu-item input[type="number"] {
        text-align: center;
    }
}

/* Compatibilité Elementor Popup */
.elementor-popup-modal .reservation-online-wrapper {
    max-width: 100%;
    padding: 0;
}

.elementor-popup-modal .reservation-online-form {
    border: none;
    box-shadow: none;
}

/* Animation d'entrée pour Elementor */
.elementor-popup-modal .reservation-online-wrapper {
    animation: fadeInUp 0.4s ease;
}

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

/* Empêcher la fermeture de la modale sur les interactions du formulaire */
.reservation-online-wrapper {
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

.reservation-online-wrapper * {
    pointer-events: auto !important;
}

.reservation-online-wrapper input,
.reservation-online-wrapper select,
.reservation-online-wrapper textarea,
.reservation-online-wrapper button,
.reservation-online-wrapper label,
.reservation-online-wrapper .checkmark {
    pointer-events: auto !important;
    position: relative;
    z-index: 20;
}

/* Fix Elementor popup interactions */
.elementor-popup-modal .reservation-online-wrapper,
.elementor-popup-modal .reservation-online-form,
.elementor-popup-modal .reservation-online-form * {
    pointer-events: auto !important;
}

.elementor-popup-modal .dialog-widget-content {
    pointer-events: auto !important;
}

/* Empêcher le clic sur l'overlay de propager au formulaire */
.elementor-popup-modal .reservation-online-wrapper {
    isolation: isolate;
}


