/* =========================================================
   Calendrier de réservation — Front-Office
   ========================================================= */

:root {
    --rsv-green:   #22c55e;
    --rsv-green-light: #dcfce7;
    --rsv-orange:  #f97316;
    --rsv-orange-light: #ffedd5;
    --rsv-red:     #ef4444;
    --rsv-red-light: #fee2e2;
    --rsv-gray:    #94a3b8;
    --rsv-gray-light: #f1f5f9;
    --rsv-white:   #ffffff;
    --rsv-dark:    #1e293b;
    --rsv-primary: #3b82f6;
    --rsv-primary-hover: #2563eb;
    --rsv-radius:  10px;
    --rsv-shadow:  0 4px 24px rgba(0,0,0,.10);
}

/* Wrapper global */
.rsv-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    color: var(--rsv-dark);
}

/* Header */
.rsv-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.rsv-salle-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rsv-dark);
}

.rsv-salle-select-wrap label {
    font-weight: 600;
    margin-right: 8px;
}

.rsv-salle-select-wrap select {
    padding: 6px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: .95rem;
}

/* Navigation mois */
.rsv-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rsv-month-label {
    font-size: 1.15rem;
    font-weight: 700;
    min-width: 160px;
    text-align: center;
}

/* Boutons */
.rsv-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
    transition: background .2s, transform .1s;
}

.rsv-btn:active { transform: scale(.97); }

.rsv-btn-nav {
    background: var(--rsv-primary);
    color: var(--rsv-white);
}

.rsv-btn-nav:hover { background: var(--rsv-primary-hover); }

.rsv-btn-primary {
    background: var(--rsv-primary);
    color: var(--rsv-white);
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
}

.rsv-btn-primary:hover { background: var(--rsv-primary-hover); }
.rsv-btn-primary:disabled { background: var(--rsv-gray); cursor: not-allowed; }

/* Légende */
.rsv-legend {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.rsv-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .3px;
}

.rsv-libre       { background: var(--rsv-green-light);  color: #15803d; }
.rsv-sous-reserve{ background: var(--rsv-orange-light); color: #c2410c; }
.rsv-occupee     { background: var(--rsv-red-light);    color: #b91c1c; }

/* Calendrier */
.rsv-calendar { }

.rsv-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.rsv-cal-day-name {
    text-align: center;
    font-size: .78rem;
    font-weight: 700;
    color: var(--rsv-gray);
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.rsv-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.rsv-cal-cell {
    min-height: 72px;
    border-radius: var(--rsv-radius);
    padding: 8px 6px 6px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform .15s, box-shadow .15s;
    border: 2px solid transparent;
}

.rsv-cal-blank { background: transparent; border: none; }

/* Statuts des jours */
.rsv-day-libre {
    background: var(--rsv-green-light);
    border-color: var(--rsv-green);
    cursor: pointer;
}

.rsv-day-libre:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34,197,94,.25);
    border-color: var(--rsv-green);
}

.rsv-day-sous_reserve {
    background: var(--rsv-orange-light);
    border-color: var(--rsv-orange);
    cursor: not-allowed;
}

.rsv-day-occupee {
    background: var(--rsv-red-light);
    border-color: var(--rsv-red);
    cursor: not-allowed;
}

.rsv-past {
    opacity: .45;
    cursor: not-allowed !important;
}

.rsv-day-num {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
}

.rsv-day-libre .rsv-day-num     { color: #15803d; }
.rsv-day-sous_reserve .rsv-day-num { color: #c2410c; }
.rsv-day-occupee .rsv-day-num   { color: #b91c1c; }

.rsv-day-status {
    font-size: .65rem;
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* Modal */
.rsv-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rsv-modal {
    background: var(--rsv-white);
    border-radius: 14px;
    padding: 32px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--rsv-shadow);
    animation: rsvSlideIn .2s ease;
}

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

.rsv-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--rsv-gray);
    line-height: 1;
    transition: color .2s;
}

.rsv-modal-close:hover { color: var(--rsv-dark); }

.rsv-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--rsv-dark);
}

/* Formulaire */
.rsv-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}

.rsv-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rsv-form-group label {
    font-size: .87rem;
    font-weight: 600;
    color: #475569;
}

.rsv-form-group input,
.rsv-form-group textarea {
    padding: 9px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 7px;
    font-size: .95rem;
    transition: border-color .2s;
    font-family: inherit;
    resize: vertical;
}

.rsv-form-group input:focus,
.rsv-form-group textarea:focus {
    outline: none;
    border-color: var(--rsv-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.rsv-form-group .rsv-form-group:last-child {
    margin-bottom: 0;
}

.rsv-input-error { border-color: var(--rsv-red) !important; }

.rsv-field-error {
    font-size: .78rem;
    color: var(--rsv-red);
    font-weight: 500;
}

.req { color: var(--rsv-red); }

.rsv-form-actions { margin-top: 20px; }

.rsv-form-notice {
    font-size: .78rem;
    color: var(--rsv-gray);
    margin-top: 10px;
    line-height: 1.5;
}

/* Toast */
.rsv-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 22px;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    max-width: 360px;
    z-index: 999999;
    box-shadow: var(--rsv-shadow);
    animation: rsvSlideIn .25s ease;
}

.rsv-toast-success { background: var(--rsv-green); color: #fff; }
.rsv-toast-error   { background: var(--rsv-red);   color: #fff; }

/* Responsive */
@media (max-width: 640px) {
    .rsv-form-row     { grid-template-columns: 1fr; }
    .rsv-cal-day-name { font-size: .65rem; }
    .rsv-cal-cell     { min-height: 48px; padding: 4px; }
    .rsv-day-num      { font-size: .85rem; }
    .rsv-day-status   { display: none; }
    .rsv-header       { flex-direction: column; align-items: flex-start; }
    .rsv-modal        { padding: 20px; }
}
