/* RDV Manager — Public CSS */
:root {
    --rdv-primary: #4A90D9;
    --rdv-primary-dark: #2c6fad;
    --rdv-success: #27AE60;
    --rdv-error: #E74C3C;
    --rdv-border: #e0e0e0;
    --rdv-bg: #f9f9f9;
    --rdv-radius: 10px;
    --rdv-shadow: 0 2px 12px rgba(0,0,0,.08);
    --rdv-text: #333;
    --rdv-muted: #777;
}

/* Widget wrapper */
.rdv-booking-widget {
    max-width: 720px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--rdv-text);
    background: #fff;
    border-radius: var(--rdv-radius);
    box-shadow: var(--rdv-shadow);
    padding: 32px;
    box-sizing: border-box;
}
.rdv-form-title { margin: 0 0 24px; font-size: 22px; font-weight: 700; color: var(--rdv-primary); }

/* Steps */
.rdv-steps {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--rdv-border);
    padding-bottom: 16px;
}
.rdv-step {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 13px;
    color: var(--rdv-muted);
    border-radius: 6px;
    transition: all .2s;
}
.rdv-step span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--rdv-border); color: #fff; font-weight: 700;
    font-size: 12px; margin-right: 6px;
    transition: background .2s;
}
.rdv-step.rdv-step-active { color: var(--rdv-primary); font-weight: 600; }
.rdv-step.rdv-step-active span { background: var(--rdv-primary); }
.rdv-step.rdv-step-done span { background: var(--rdv-success); }

/* Services grid */
.rdv-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.rdv-service-card {
    border: 2px solid var(--rdv-border);
    border-top-width: 4px;
    border-radius: var(--rdv-radius);
    padding: 16px;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}
.rdv-service-card:hover { border-color: var(--rdv-primary); box-shadow: 0 4px 16px rgba(74,144,217,.2); }
.rdv-service-card.rdv-service-selected { border-color: var(--rdv-primary); background: rgba(74,144,217,.05); }
.rdv-service-card h3 { margin: 8px 0 6px; font-size: 15px; }
.rdv-service-card p { margin: 0 0 8px; font-size: 13px; color: var(--rdv-muted); }
.rdv-service-duration { font-size: 12px; color: var(--rdv-muted); display: flex; align-items: center; gap: 4px; }
.rdv-service-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Agent selector */
.rdv-agent-selector { margin: 16px 0; }
.rdv-agent-selector label { display: block; font-weight: 600; margin-bottom: 6px; }
.rdv-agent-selector select { width: 100%; padding: 10px; border: 1.5px solid var(--rdv-border); border-radius: 6px; font-size: 14px; }

/* Calendar picker */
.rdv-calendar-picker { max-width: 380px; }
.rdv-cal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.rdv-cal-header button {
    background: var(--rdv-bg); border: 1px solid var(--rdv-border);
    border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 16px;
}
.rdv-cal-header button:hover { background: var(--rdv-primary); color: #fff; border-color: var(--rdv-primary); }
.rdv-cal-month-label { font-size: 16px; font-weight: 600; }
.rdv-cal-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr);
    text-align: center; font-size: 12px; font-weight: 600; color: var(--rdv-muted);
    margin-bottom: 6px;
}
.rdv-cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.rdv-cal-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 500;
    transition: all .15s;
}
.rdv-cal-day.rdv-day-available { background: rgba(74,144,217,.12); color: var(--rdv-primary); }
.rdv-cal-day.rdv-day-available:hover { background: var(--rdv-primary); color: #fff; }
.rdv-cal-day.rdv-day-selected { background: var(--rdv-primary) !important; color: #fff !important; }
.rdv-cal-day.rdv-day-disabled { color: #ccc; cursor: default; }
.rdv-cal-day.rdv-day-empty { }
.rdv-cal-loading { text-align: center; padding: 20px; color: var(--rdv-muted); }

/* Time slots */
.rdv-selected-date-label { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.rdv-slots-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.rdv-slot {
    padding: 10px 18px; border: 1.5px solid var(--rdv-primary); border-radius: 8px;
    cursor: pointer; color: var(--rdv-primary); font-weight: 600; font-size: 14px;
    transition: all .15s; background: #fff;
}
.rdv-slot:hover, .rdv-slot.rdv-slot-selected { background: var(--rdv-primary); color: #fff; }
.rdv-no-slots { color: var(--rdv-muted); font-style: italic; }

/* Form fields */
.rdv-field { margin-bottom: 18px; }
.rdv-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.rdv-field input[type=text],
.rdv-field input[type=email],
.rdv-field input[type=tel],
.rdv-field input[type=number],
.rdv-field input[type=date],
.rdv-field textarea,
.rdv-field select {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--rdv-border);
    border-radius: 8px; font-size: 14px; transition: border-color .2s;
    box-sizing: border-box;
}
.rdv-field input:focus,
.rdv-field textarea:focus,
.rdv-field select:focus { outline: none; border-color: var(--rdv-primary); box-shadow: 0 0 0 3px rgba(74,144,217,.15); }
.rdv-field.rdv-field-error input,
.rdv-field.rdv-field-error textarea,
.rdv-field.rdv-field-error select { border-color: var(--rdv-error); }
.rdv-required { color: var(--rdv-error); }
.rdv-checkbox-label, .rdv-radio-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; cursor: pointer; font-size: 14px; }

/* Booking summary */
.rdv-booking-summary {
    background: rgba(74,144,217,.06); border-left: 4px solid var(--rdv-primary);
    border-radius: 0 8px 8px 0; padding: 14px 18px; margin-bottom: 22px;
}
.rdv-booking-summary p { margin: 0 0 4px; font-size: 14px; }

/* Buttons */
.rdv-btn {
    display: inline-block; padding: 12px 28px; border-radius: 8px;
    font-size: 15px; font-weight: 600; cursor: pointer; border: none; transition: all .2s;
}
.rdv-btn-primary { background: var(--rdv-primary); color: #fff; }
.rdv-btn-primary:hover { background: var(--rdv-primary-dark); }
.rdv-btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.rdv-btn-secondary { background: var(--rdv-bg); color: var(--rdv-text); border: 1.5px solid var(--rdv-border); }
.rdv-btn-back {
    background: none; border: none; color: var(--rdv-primary);
    cursor: pointer; font-size: 14px; margin-bottom: 16px; padding: 0;
    font-weight: 600;
}
.rdv-btn-back:hover { text-decoration: underline; }

/* Success */
.rdv-success { text-align: center; padding: 40px 20px; }
.rdv-success-icon {
    width: 72px; height: 72px; background: var(--rdv-success); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 36px; margin: 0 auto 20px;
}
.rdv-success h3 { font-size: 22px; color: var(--rdv-success); margin: 0 0 12px; }
.rdv-success-message { color: var(--rdv-muted); margin-bottom: 24px; }

/* Error box */
.rdv-error-box {
    background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px;
    padding: 14px 18px; color: var(--rdv-error); margin-top: 12px;
}

/* Responsive */
@media (max-width: 480px) {
    .rdv-booking-widget { padding: 20px 16px; }
    .rdv-steps { font-size: 11px; }
    .rdv-step span { display: none; }
    .rdv-services-grid { grid-template-columns: 1fr; }
}

/* ── Add to calendar ──────────────────────────────────────────────────────── */
.rdv-success-recap {
    background: var(--rdv-bg);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 20px auto;
    max-width: 360px;
    text-align: left;
}
.rdv-recap-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid var(--rdv-border);
}
.rdv-recap-row:last-child { border-bottom: none; }
.rdv-recap-icon { font-size: 16px; flex-shrink: 0; }

.rdv-add-to-calendar {
    margin: 24px 0 20px;
}
.rdv-cal-label {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 14px;
    color: var(--rdv-text);
}
.rdv-cal-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}
.rdv-cal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
    border: 2px solid transparent;
    cursor: pointer;
}
.rdv-cal-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.rdv-cal-google {
    background: #fff;
    color: #4285F4;
    border-color: #4285F4;
}
.rdv-cal-google:hover {
    background: #4285F4;
    color: #fff;
}
.rdv-cal-outlook {
    background: #fff;
    color: #0078D4;
    border-color: #0078D4;
}
.rdv-cal-outlook:hover {
    background: #0078D4;
    color: #fff;
}
.rdv-cal-ical {
    background: #fff;
    color: #555;
    border-color: #999;
}
.rdv-cal-ical:hover {
    background: #555;
    color: #fff;
    border-color: #555;
}
.rdv-email-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--rdv-muted);
    margin-top: 8px;
}
.rdv-email-notice svg { flex-shrink: 0; fill: var(--rdv-muted); }

@media (max-width: 480px) {
    .rdv-cal-buttons { flex-direction: column; align-items: stretch; }
    .rdv-cal-btn { justify-content: center; }
}

/* ── Calendar nav disabled state & beyond-horizon days ────────────────────── */
.rdv-cal-header button.rdv-cal-nav-disabled,
.rdv-cal-header button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}
.rdv-cal-day.rdv-day-beyond {
    color: #ddd;
    cursor: not-allowed;
    background: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 3px,
        rgba(0,0,0,.04) 3px,
        rgba(0,0,0,.04) 6px
    );
}

/* ── Annulation rendez-vous ──────────────────────────────────────────────── */
.rdv-cancel-box {
    padding: 16px 20px;
    border-radius: 6px;
    margin: 16px 0;
    background: #f0f6ff;
    border: 1px solid #c3d9f7;
}
.rdv-cancel-success { background:#e8f5e9; border-color:#a5d6a7; color:#2e7d32; font-weight:600; }
.rdv-cancel-error   { background:#fdecea; border-color:#ef9a9a; color:#c62828; }
.rdv-cancel-info    { background:#fff8e1; border-color:#ffe082; color:#f57f17; }
.rdv-btn-cancel-confirm {
    background: #c62828;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}
.rdv-btn-cancel-confirm:hover { background: #b71c1c; }

/* ── Validation e-mail ───────────────────────────────────────────────────── */
.rdv-field-msg {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #c62828;
}

/* ── Authentification CAS ─────────────────────────────────────────────────── */
.rdv-cas-block {
    margin-bottom: 18px;
    border-radius: 8px;
    overflow: hidden;
}

.rdv-cas-login-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f0f4ff;
    border: 1px solid #c3d9f7;
    border-radius: 8px;
    flex-wrap: wrap;
}

.rdv-cas-hint {
    font-size: 13px;
    color: #555;
    flex: 1;
    min-width: 160px;
}

.rdv-btn-cas {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: #1a56db;
    color: #fff !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}
.rdv-btn-cas:hover { background: #1145b0; }

.rdv-cas-connected-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
}

.rdv-cas-connected-icon {
    font-size: 16px;
    color: #2e7d32;
    font-weight: 700;
}

.rdv-cas-connected-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #1b5e20;
}

.rdv-cas-disconnect-btn {
    background: none;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    color: #555;
    font-size: 11px;
    padding: 3px 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.rdv-cas-disconnect-btn:hover { background: #ffebee; border-color: #ef9a9a; color: #c62828; }

/* ── Anti-spam ────────────────────────────────────────────────────────────── */
.rdv-antispam-block {
    margin: 16px 0 8px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}
.rdv-antispam-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}
.rdv-antispam-icon { font-size: 18px; flex-shrink: 0; }
.rdv-antispam-input-wrap { display: flex; gap: 10px; align-items: center; }
.rdv-challenge-answer {
    width: 90px !important;
    text-align: center;
    font-size: 18px !important;
    font-weight: 700;
    padding: 8px 12px !important;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    transition: border-color .2s;
}
.rdv-challenge-answer:focus { border-color: var(--rdv-primary, #4A90D9); outline: none; }
.rdv-challenge-answer.rdv-antispam-error { border-color: #dc3545; }
.rdv-antispam-hint {
    font-size: 12px;
    color: #888;
    margin: 6px 0 0;
}

/* ── Mention RGPD ─────────────────────────────────────────────────────────── */
.rdv-rgpd-mention {
    font-size: 12px;
    font-style: italic;
    color: #777;
    margin: 8px 0 16px;
    line-height: 1.5;
}
.rdv-rgpd-mention a {
    color: inherit;
    text-decoration: underline;
}
