/* =============================================
   RDV Booking – Styles Frontend
   ============================================= */

:root {
    --rdv-color:        #2563eb;
    --rdv-color-dark:   #1d4ed8;
    --rdv-color-btn:    #2563eb;
    --rdv-color-fond:   #ffffff;
    --rdv-color-titre:  #1e293b;
    --rdv-color-champ:  #2563eb;
    --rdv-radius: 12px;
    --rdv-shadow: 0 4px 24px rgba(0,0,0,.10);
}

.rdv-wrapper {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1e293b;
}

.rdv-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--rdv-color-titre);
    text-align: center;
}

/* ---- Alertes ---- */
.rdv-alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--rdv-radius);
    margin-bottom: 22px;
    font-size: 0.95rem;
}
.rdv-alert span:first-child { font-size: 1.4rem; flex-shrink: 0; }
.rdv-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.rdv-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

/* ---- Progression ---- */
.rdv-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 28px 0 0;
}
.rdv-progress-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background .3s, color .3s;
}
.rdv-progress-step.active {
    background: var(--rdv-color);
    color: #fff;
}
.rdv-progress-step.done {
    background: #22c55e;
    color: #fff;
}
.rdv-progress-line {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    max-width: 80px;
}

/* ---- Étapes ---- */
.rdv-step {
    background: var(--rdv-color-fond);
    border: 1px solid #e2e8f0;
    border-radius: var(--rdv-radius);
    padding: 28px;
    box-shadow: var(--rdv-shadow);
    animation: rdvFadeIn .3s ease;
}
@keyframes rdvFadeIn {
    from { opacity:0; transform: translateY(8px); }
    to   { opacity:1; transform: translateY(0); }
}

.rdv-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 22px;
    color: #1e293b;
}
.rdv-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--rdv-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ---- Champs ---- */
.rdv-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 520px) {
    .rdv-grid-2 { grid-template-columns: 1fr; }
}

.rdv-field {
    margin-bottom: 18px;
}
.rdv-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #374151;
}
.rdv-req { color: #ef4444; }
.rdv-hint { color: #94a3b8; font-size: 0.88rem; margin: 0; }

.rdv-field input,
.rdv-field select,
.rdv-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    font-family: inherit;
}
.rdv-field input:focus,
.rdv-field select:focus,
.rdv-field textarea:focus {
    outline: none;
    border-color: var(--rdv-color-champ);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rdv-color-champ) 15%, transparent);
    background: #fff;
}
.rdv-field input.rdv-invalid,
.rdv-field select.rdv-invalid {
    border-color: #ef4444;
}

/* ---- Créneaux ---- */
#rdv-slots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.rdv-slot {
    padding: 7px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    background: #fff;
    transition: all .15s;
    color: #374151;
}
.rdv-slot:hover:not(.rdv-slot-disabled) {
    border-color: var(--rdv-color);
    background: color-mix(in srgb, var(--rdv-color) 8%, #fff);
    color: var(--rdv-color);
}
.rdv-slot.rdv-slot-selected {
    background: var(--rdv-color);
    border-color: var(--rdv-color);
    color: #fff;
}
.rdv-slot-disabled {
    opacity: .4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ---- Récapitulatif ---- */
.rdv-recap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 22px;
}
.rdv-recap-row {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.93rem;
}
.rdv-recap-row:last-child { border-bottom: none; }
.rdv-recap-label { font-weight: 600; min-width: 120px; color: #64748b; }

/* ---- Boutons ---- */
.rdv-btn-row {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 4px;
}
.rdv-btn-next, .rdv-btn-submit {
    background: var(--rdv-color-btn);
    color: #fff;
    border: none;
    padding: 11px 26px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .1s;
}
.rdv-btn-next:hover, .rdv-btn-submit:hover { background: var(--rdv-color-dark); filter: brightness(.92); }
.rdv-btn-next:active, .rdv-btn-submit:active { transform: scale(.97); }
.rdv-btn-prev {
    background: none;
    border: 1.5px solid #cbd5e1;
    color: #64748b;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s;
}
.rdv-btn-prev:hover { border-color: #94a3b8; }
.rdv-btn-submit:disabled { opacity: .6; cursor: not-allowed; }

/* =============================================
   Calendrier mensuel synchronisé
   ============================================= */

.rdv-calendar {
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    user-select: none;
}

/* En-tête navigation */
.rdv-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--rdv-color);
    color: #fff;
}

.rdv-cal-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .3px;
}

.rdv-cal-nav {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    padding: 0;
}
.rdv-cal-nav:hover:not(.rdv-cal-nav-disabled) { background: rgba(255,255,255,.35); }
.rdv-cal-nav-disabled,
.rdv-cal-nav:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* Jours de la semaine */
.rdv-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}
.rdv-cal-weekdays span {
    text-align: center;
    padding: 8px 2px;
    font-size: .72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* Grille des jours */
.rdv-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 8px;
    background: #f8fafc;
    min-height: 180px;
}

.rdv-cal-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: #94a3b8;
    font-size: .9rem;
    align-self: center;
}

/* Cellules */
.rdv-cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    position: relative;
    transition: background .15s, transform .1s;
    min-width: 0;
}

.rdv-cal-empty { background: transparent; }

/* Passé */
.rdv-cal-past {
    color: #cbd5e1;
    background: transparent;
    cursor: default;
}

/* Fermé */
.rdv-cal-closed {
    color: #94a3b8;
    background: #f1f5f9;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: .6;
}

/* Disponible ✅ */
.rdv-cal-available {
    color: #166534;
    background: #dcfce7;
    border: 1.5px solid #86efac;
    cursor: pointer;
}
.rdv-cal-available:hover {
    background: #bbf7d0;
    border-color: #4ade80;
    transform: scale(1.08);
    z-index: 1;
}
.rdv-cal-available:focus {
    outline: 2px solid var(--rdv-color);
    outline-offset: 2px;
}

/* Sélectionné */
.rdv-cal-selected {
    background: var(--rdv-color) !important;
    color: #fff !important;
    border-color: var(--rdv-color) !important;
    transform: scale(1.1);
    z-index: 2;
    box-shadow: 0 3px 10px rgba(0,0,0,.18);
}

/* Complet 🔴 */
.rdv-cal-full {
    color: #9ca3af;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    cursor: not-allowed;
}

/* Point indicateur complet */
.rdv-cal-dot {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
}
.rdv-dot-full { background: #f87171; }

/* Légende */
.rdv-cal-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    font-size: .78rem;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-wrap: wrap;
}
.rdv-leg {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1.5px solid transparent;
    vertical-align: middle;
    margin-right: 3px;
}
.rdv-leg-available { background: #dcfce7; border-color: #86efac; }
.rdv-leg-full      { background: #f3f4f6; border-color: #e5e7eb; }
.rdv-leg-closed    { background: #f1f5f9; border-color: #cbd5e1; }

/* Zone créneaux (apparaît sous le calendrier) */
#rdv-slots-wrap {
    margin-top: 18px;
}
#rdv-slots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.rdv-hint-error { color: #ef4444 !important; }


/* ---- Info horaires agence sous le calendrier ---- */
.rdv-horaires-info {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    min-height: 18px;
    font-style: italic;
}
