/* ============================================================
   VL Booking System — Formulaire de réservation frontend
   Le Vieux Logis, Aignan 32290 Gers
   ============================================================ */

/* ── Reset léger ─────────────────────────────────────────── */
.vlb-booking-wrap *,
.vlb-booking-wrap *::before,
.vlb-booking-wrap *::after {
    box-sizing: border-box;
}

.vlb-booking-wrap {
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: #333;
    max-width: 860px;
    margin: 0 auto;
}

/* ── Sélecteur de chambre ────────────────────────────────── */
.vlb-room-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 36px;
}

.vlb-room-card {
    flex: 1 1 260px;
    max-width: 340px;
    background: #fff;
    border: 2px solid #e0dbd3;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    padding: 0;
    overflow: hidden;
    position: relative;
    user-select: none;
}

.vlb-room-card:hover {
    border-color: #b99d75;
    box-shadow: 0 4px 18px rgba(52, 72, 49, 0.08);
}

.vlb-room-card.selected {
    border-color: #344831 !important;
    box-shadow: 0 4px 20px rgba(52, 72, 49, 0.15) !important;
}

.vlb-room-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 12px;
    background: #344831;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.vlb-room-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.vlb-room-card-body {
    padding: 16px 18px 18px;
}

.vlb-room-card-name {
    font-size: 15px;
    color: #344831;
    margin: 0 0 6px;
    font-weight: normal;
    letter-spacing: 0.5px;
}

.vlb-room-card-price {
    font-size: 13px;
    color: #b99d75;
    margin: 0;
    font-style: italic;
}

.vlb-room-card-desc {
    font-size: 12px;
    color: #888;
    margin: 6px 0 0;
    line-height: 1.5;
}

/* ── Formulaire de réservation ───────────────────────────── */
/* Pas de box ici : le formulaire est intégré dans le thème qui gère déjà la mise en page */
.vlb-booking-form {
    /* intentionnellement vide */
}

.vlb-form-title {
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #344831;
    margin: 0 0 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e8e4dd;
}

.vlb-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.vlb-form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.vlb-form-group label {
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888;
}

.vlb-form-group input,
.vlb-form-group select,
.vlb-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    font-family: Georgia, serif;
    font-size: 14px;
    color: #333;
    background: #fafaf9;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
}

.vlb-form-group input:focus,
.vlb-form-group select:focus,
.vlb-form-group textarea:focus {
    border-color: #344831;
    background: #fff;
}

.vlb-form-group select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23888' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.vlb-form-group textarea {
    resize: vertical;
    min-height: 90px;
}

/* ── Récapitulatif de prix ────────────────────────────────── */
.vlb-price-summary {
    background: #f9f7f4;
    border-left: 3px solid #b99d75;
    padding: 22px 24px;
    margin: 24px 0;
    display: none;
}

.vlb-price-summary.visible {
    display: block;
}

.vlb-price-summary-title {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #b99d75;
    margin: 0 0 14px;
}

.vlb-price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.vlb-price-table td {
    padding: 5px 0;
    vertical-align: top;
}

.vlb-price-table td:first-child {
    color: #888;
    width: 60%;
}

.vlb-price-table td:last-child {
    text-align: right;
    font-weight: bold;
    color: #333;
}

.vlb-price-total {
    border-top: 1px solid #e0dbd3;
    margin-top: 8px;
    padding-top: 8px;
}

.vlb-price-total td:first-child {
    color: #344831;
    font-weight: bold;
    font-size: 14px;
}

.vlb-price-total td:last-child {
    color: #344831;
    font-size: 16px;
}

.vlb-price-deposit {
    font-size: 12px;
    color: #b99d75;
    margin-top: 8px;
    font-style: italic;
}

/* ── Disponibilité ───────────────────────────────────────── */
.vlb-availability-check {
    padding: 10px 16px;
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
}

.vlb-availability-check.visible {
    display: block;
}

.vlb-available {
    background: #d4edda;
    color: #155724;
    border-left: 3px solid #27ae60;
}

.vlb-unavailable {
    background: #f8d7da;
    color: #721c24;
    border-left: 3px solid #e74c3c;
}

.vlb-checking {
    background: #fff3cd;
    color: #856404;
    border-left: 3px solid #ffc107;
}

/* ── Messages de statut ──────────────────────────────────── */
.vlb-msg {
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 14px;
    line-height: 1.6;
    display: none;
}

.vlb-msg.visible {
    display: block;
}

.vlb-msg-ok {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #27ae60;
}

.vlb-msg-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #e74c3c;
}

/* ── Bouton de soumission ────────────────────────────────── */
.vlb-submit-btn {
    width: 100%;
    background: #344831;
    color: #fff;
    border: none;
    padding: 16px 24px;
    font-family: Georgia, serif;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
    display: block;
}

.vlb-submit-btn:hover:not(:disabled) {
    background: #2a3a28;
}

.vlb-submit-btn:disabled {
    background: #bbb;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ── Loader spinner ──────────────────────────────────────── */
.vlb-loading {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    font-size: 13px;
    color: #888;
    font-style: italic;
}

.vlb-loading.visible {
    display: flex;
}

.vlb-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e0dbd3;
    border-top-color: #344831;
    border-radius: 50%;
    animation: vlb-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ── Flatpickr override ──────────────────────────────────── */

/* Z-index : le popup doit passer au-dessus de tout */
.flatpickr-calendar {
    z-index: 99999 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    border-radius: 0 !important;
    border: 1px solid #e0dbd3 !important;
    font-family: Georgia, 'Times New Roman', Times, serif;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #344831 !important;
    border-color: #344831 !important;
    color: #fff !important;
}

.flatpickr-day.inRange {
    background: rgba(52, 72, 49, 0.1) !important;
    border-color: transparent !important;
}

.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #344831 !important;
    border-color: #344831 !important;
}

.flatpickr-day.disabled,
.flatpickr-day.disabled:hover {
    color: #ddd !important;
    background: #f9f7f4 !important;
    text-decoration: line-through;
}

/* En-tête mois : fond vert foncé comme le thème */
.flatpickr-months .flatpickr-month {
    background: #344831;
    color: #fff;
    fill: #fff;
}

.flatpickr-current-month,
.flatpickr-current-month .cur-month,
.flatpickr-current-month input.cur-year {
    color: #fff;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: #fff;
    color: #fff;
}

/* Jours de semaine : fond beige clair comme le thème */
.flatpickr-weekdays {
    background: #f5f0e8;
}

span.flatpickr-weekday {
    background: #f5f0e8;
    color: #344831;
    font-weight: bold;
    font-size: 11px;
}

.flatpickr-current-month .numInputWrapper span.arrowUp::after {
    border-bottom-color: #fff;
}

.flatpickr-current-month .numInputWrapper span.arrowDown::after {
    border-top-color: #fff;
}

/* ── Étape visuelle (mode avancé) ────────────────────────── */
.vlb-steps {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
    border-bottom: 2px solid #e0dbd3;
    overflow: hidden;
}

.vlb-step {
    flex: 1;
    padding: 14px 18px;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #bbb;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-align: center;
}

.vlb-step.active {
    color: #344831;
    border-bottom-color: #344831;
}

.vlb-step.done {
    color: #b99d75;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .vlb-booking-form {
        padding: 22px 18px;
    }

    .vlb-form-row {
        flex-direction: column;
        gap: 14px;
    }

    .vlb-room-selector {
        flex-direction: column;
    }

    .vlb-room-card {
        max-width: 100%;
    }
}
