/* RDV-LL — Widget public de prise de RDV
   ============================================ */

.rdv-ll-widget-container,
.rdv-ll-widget-container * {
    box-sizing: border-box;
}

.rdv-ll-widget-container {
    --rdv-w-primary: #2c6484;
    --rdv-w-primary-dark: #1f4a63;
    --rdv-w-accent: #e8b04c;
    --rdv-w-bg: #ffffff;
    --rdv-w-bg-soft: #f7f8fa;
    --rdv-w-border: #e3e5e8;
    --rdv-w-text: #1f2937;
    --rdv-w-text-soft: #6b7280;
    --rdv-w-success: #16a34a;
    --rdv-w-danger: #dc2626;
    --rdv-w-radius: 12px;
    --rdv-w-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: var(--rdv-w-text);
    max-width: 920px;
    margin: 0 auto;
}

.rdv-ll-widget {
    background: var(--rdv-w-bg);
    border: 1px solid var(--rdv-w-border);
    border-radius: var(--rdv-w-radius);
    box-shadow: var(--rdv-w-shadow);
    overflow: hidden;
}

/* ---- Loader / Error ---- */
.rdv-ll-widget-loader,
.rdv-ll-widget-error {
    padding: 60px 20px;
    text-align: center;
    color: var(--rdv-w-text-soft);
}

.rdv-ll-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--rdv-w-border);
    border-top-color: var(--rdv-w-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: rdv-spin 0.8s linear infinite;
}

.rdv-ll-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--rdv-w-border);
    border-top-color: var(--rdv-w-primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: rdv-spin 0.8s linear infinite;
}

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

/* ---- Header ---- */
.rdv-ll-widget-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--rdv-w-border);
    background: linear-gradient(180deg, var(--rdv-w-bg) 0%, var(--rdv-w-bg-soft) 100%);
}

.rdv-ll-widget-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rdv-ll-widget-logo {
    max-height: 48px;
    max-width: 140px;
    flex-shrink: 0;
}

.rdv-ll-widget-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--rdv-w-primary);
    line-height: 1.2;
}

.rdv-ll-widget-subtitle {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: var(--rdv-w-text-soft);
}

.rdv-ll-widget-description {
    margin-top: 14px;
    font-size: 14px;
    color: var(--rdv-w-text-soft);
    line-height: 1.5;
}

.rdv-ll-widget-description p:last-child { margin-bottom: 0; }

/* ============================================================
   VUE CALENDRIER
   ============================================================ */
.rdv-ll-widget-calendar-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 760px) {
    .rdv-ll-widget-calendar-view {
        grid-template-columns: 1fr 300px;
    }
}

/* ---- Calendrier ---- */
.rdv-ll-widget-calendar {
    padding: 24px 28px;
}

.rdv-ll-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.rdv-ll-cal-month-label {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
}

.rdv-ll-cal-nav-btn {
    background: var(--rdv-w-bg);
    border: 1px solid var(--rdv-w-border);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 18px;
    color: var(--rdv-w-text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.rdv-ll-cal-nav-btn:hover {
    background: var(--rdv-w-primary);
    color: #fff;
    border-color: var(--rdv-w-primary);
}

.rdv-ll-cal-loading {
    height: 8px;
    text-align: center;
    margin-bottom: 4px;
}

.rdv-ll-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.rdv-ll-cal-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--rdv-w-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0;
}

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

.rdv-ll-cal-day {
    aspect-ratio: 1;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    color: var(--rdv-w-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    font-family: inherit;
}

.rdv-ll-cal-day-empty {
    visibility: hidden;
}

.rdv-ll-cal-day.is-unavailable {
    color: var(--rdv-w-text-soft);
    opacity: 0.35;
    cursor: not-allowed;
}

.rdv-ll-cal-day.is-available {
    background: var(--rdv-w-bg-soft);
    color: var(--rdv-w-primary);
    font-weight: 500;
}

.rdv-ll-cal-day.is-available:hover {
    background: var(--rdv-w-primary);
    color: #fff;
    transform: scale(1.05);
}

.rdv-ll-cal-day.is-today {
    border-color: var(--rdv-w-accent);
    font-weight: 600;
}

.rdv-ll-cal-day.is-selected {
    background: var(--rdv-w-primary) !important;
    color: #fff !important;
    transform: scale(1.05);
}

/* ---- Panneau de créneaux ---- */
.rdv-ll-widget-slots-panel {
    padding: 24px 28px;
    border-top: 1px solid var(--rdv-w-border);
    background: var(--rdv-w-bg-soft);
}

@media (min-width: 760px) {
    .rdv-ll-widget-slots-panel {
        border-top: 0;
        border-left: 1px solid var(--rdv-w-border);
    }
}

.rdv-ll-slots-heading h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--rdv-w-text);
    text-transform: capitalize;
}

.rdv-ll-tz {
    margin: 4px 0 16px 0;
    font-size: 11px;
    color: var(--rdv-w-text-soft);
}

.rdv-ll-slots-empty {
    color: var(--rdv-w-text-soft);
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

.rdv-ll-slots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.rdv-ll-slot-btn {
    background: var(--rdv-w-bg);
    border: 1.5px solid var(--rdv-w-border);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--rdv-w-text);
    cursor: pointer;
    transition: all 0.12s ease;
    font-family: inherit;
    text-align: center;
}

.rdv-ll-slot-btn:hover {
    border-color: var(--rdv-w-primary);
    background: var(--rdv-w-primary);
    color: #fff;
    transform: translateY(-1px);
}

/* ============================================================
   VUE FORMULAIRE
   ============================================================ */
.rdv-ll-widget-form-view {
    padding: 24px 28px;
}

.rdv-ll-form-recap {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--rdv-w-bg-soft);
    border-radius: 10px;
    margin-bottom: 24px;
}

.rdv-ll-back-btn {
    background: var(--rdv-w-bg);
    border: 1px solid var(--rdv-w-border);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--rdv-w-text);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    flex-shrink: 0;
}

.rdv-ll-back-btn:hover {
    background: var(--rdv-w-primary);
    color: #fff;
    border-color: var(--rdv-w-primary);
}

.rdv-ll-recap-content {
    font-size: 14px;
    color: var(--rdv-w-text);
}

.rdv-ll-recap-content strong {
    display: block;
    font-size: 15px;
    color: var(--rdv-w-primary);
    text-transform: capitalize;
}

.rdv-ll-recap-content span {
    color: var(--rdv-w-text-soft);
    font-size: 13px;
}

.rdv-ll-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 480px;
}

.rdv-ll-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rdv-ll-form-field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--rdv-w-text);
}

.rdv-ll-required {
    color: var(--rdv-w-danger);
}

.rdv-ll-form-field input[type="text"],
.rdv-ll-form-field input[type="email"],
.rdv-ll-form-field input[type="tel"],
.rdv-ll-form-field textarea,
.rdv-ll-form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--rdv-w-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--rdv-w-text);
    background: var(--rdv-w-bg);
    transition: border-color 0.12s ease;
    font-family: inherit;
}

.rdv-ll-form-field input:focus,
.rdv-ll-form-field textarea:focus,
.rdv-ll-form-field select:focus {
    outline: none;
    border-color: var(--rdv-w-primary);
    box-shadow: 0 0 0 3px rgba(44, 100, 132, 0.1);
}

.rdv-ll-form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.rdv-ll-form-error {
    font-size: 12px;
    color: var(--rdv-w-danger);
}

.rdv-ll-form-error-global {
    padding: 12px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 13px;
}

.rdv-ll-submit-btn {
    background: var(--rdv-w-primary);
    color: #fff;
    border: 0;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    margin-top: 8px;
}

.rdv-ll-submit-btn:hover:not(:disabled) {
    background: var(--rdv-w-primary-dark);
    transform: translateY(-1px);
}

.rdv-ll-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================
   VUE SUCCÈS
   ============================================================ */
.rdv-ll-widget-success {
    padding: 60px 28px;
    text-align: center;
}

.rdv-ll-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--rdv-w-success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
    animation: rdv-pop 0.4s ease-out;
}

@keyframes rdv-pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.rdv-ll-widget-success h2 {
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--rdv-w-text);
}

.rdv-ll-success-recap {
    padding: 16px;
    background: var(--rdv-w-bg-soft);
    border-radius: 10px;
    margin: 0 auto 20px;
    max-width: 320px;
    color: var(--rdv-w-text);
    line-height: 1.6;
}

.rdv-ll-success-recap strong {
    color: var(--rdv-w-primary);
    text-transform: capitalize;
}

.rdv-ll-success-message {
    color: var(--rdv-w-text-soft);
    font-size: 14px;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
}

/* Erreur générique */
.rdv-ll-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--rdv-w-danger, #dc2626);
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
}
