/* ============================================================
   Wizard Prise de Rendez-Vous — Feuille de style dédiée
   ============================================================ */

:root {
    --step-inactive : #dee2e6;
    --step-active   : #0d6efd;
    --step-done     : #0d6efd;
    --step-size     : 40px;
    --step-font     : .85rem;
    --card-radius   : 1rem;
    --transition    : .3s ease;
}

/* -------- STEPPER -------- */
.rdv-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: 2.5rem;
    position: relative;
}

.rdv-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Ligne entre steps */
.rdv-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: calc(var(--step-size) / 2);
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--step-inactive);
    z-index: 0;
    transition: background var(--transition);
}
.rdv-step.done:not(:last-child)::after {
    background: var(--step-done);
}
.rdv-step.active:not(:last-child)::after {
    background: linear-gradient(to right, var(--step-active) 0%, var(--step-inactive) 100%);
}

/* Cercle numéroté */
.rdv-step-circle {
    width: var(--step-size);
    height: var(--step-size);
    border-radius: 50%;
    background: var(--step-inactive);
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--step-font);
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    position: relative;
    z-index: 2;
}
.rdv-step.active .rdv-step-circle {
    background: var(--step-active);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(13,110,253,.2);
}
.rdv-step.done .rdv-step-circle {
    background: var(--step-done);
    color: #fff;
}
.rdv-step.done .rdv-step-circle::before {
    content: '✓';
    font-size: 1rem;
}
.rdv-step.done .rdv-step-circle .step-num { display: none; }

/* Label sous le cercle */
.rdv-step-label {
    font-size: .75rem;
    font-weight: 600;
    margin-top: .5rem;
    color: #adb5bd;
    text-align: center;
    transition: color var(--transition);
    white-space: nowrap;
}
.rdv-step.active .rdv-step-label { color: var(--step-active); }
.rdv-step.done  .rdv-step-label { color: var(--step-done); }

/* -------- SECTIONS D'ÉTAPES -------- */
.rdv-section {
    display: none;
    animation: fadeSlideIn var(--transition) forwards;
}
.rdv-section.active { display: block; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -------- CARTES PRATICIENS -------- */
.praticien-card {
    border: 2px solid #dee2e6;
    border-radius: var(--card-radius);
    padding: 1.2rem 1rem;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), transform .15s;
    background: #fff;
    text-align: center;
    position: relative;
}
.praticien-card:hover {
    border-color: var(--step-active);
    box-shadow: 0 4px 20px rgba(13,110,253,.12);
    transform: translateY(-3px);
}
.praticien-card.selected {
    border-color: var(--step-active);
    background: rgba(13,110,253,.04);
    box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}
.praticien-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--step-active);
    color: #fff;
    font-size: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 22px;
}

.praticien-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 auto .8rem;
}

/* -------- GRILLE CRÉNEAUX -------- */
.creneaux-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 2px;
    scrollbar-width: thin;
}

.creneau-btn {
    padding: 10px 6px;
    border: 2px solid var(--step-active);
    background: #fff;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--step-active);
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    line-height: 1.2;
}
.creneau-btn small { display: block; font-weight: 400; font-size: .7rem; color: #6c757d; }
.creneau-btn:hover  { background: var(--step-active); color: #fff; }
.creneau-btn:hover small { color: #cce; }
.creneau-btn.selected {
    background: var(--step-active);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(13,110,253,.3);
}
.creneau-btn.selected small { color: #dde; }
.creneau-btn:disabled,
.creneau-btn.occupé {
    border-color: #dee2e6;
    color: #adb5bd;
    background: #f8f9fa;
    cursor: not-allowed;
    transform: none;
    text-decoration: line-through;
}

/* -------- RÉCAP -------- */
.recap-card {
    border-left: 4px solid var(--step-active);
    border-radius: 0 var(--card-radius) var(--card-radius) 0;
    background: #f8faff;
}
.recap-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: .6rem 0;
    border-bottom: 1px solid #e9ecef;
}
.recap-row:last-child { border-bottom: none; }
.recap-icon { color: var(--step-active); width: 20px; flex-shrink: 0; margin-top: 2px; }
.recap-label { font-size: .78rem; color: #6c757d; }
.recap-value { font-weight: 600; }

/* -------- VALIDATION -------- */
.field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 .2rem rgba(220,53,69,.15) !important;
}
.field-ok {
    border-color: #0d6efd !important;
}
.error-msg {
    color: #dc3545;
    font-size: .78rem;
    margin-top: .25rem;
    display: block;
}

/* -------- BOUTONS NAVIGATION -------- */
.rdv-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* -------- FILTRE SPÉCIALITÉ -------- */
.spec-filter { cursor: pointer; transition: all .15s; }
.spec-filter.active { background: var(--step-active) !important; color: #fff !important; border-color: var(--step-active) !important; }

/* -------- CALENDRIER -------- */
.calendar-hint {
    font-size: .8rem;
    color: #6c757d;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}
.calendar-hint span { display: flex; align-items: center; gap: 4px; }

/* -------- RESPONSIVE -------- */
@media (max-width: 576px) {
    .rdv-step-label { font-size: .65rem; }
    .creneaux-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
    .praticien-card { padding: .8rem .6rem; }
}
