/**
 * LexSlot — Espace avocat
 */

.rdv-portail-wrapper {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: clamp(16px, 3vw, 28px);
	background: rgba(255, 255, 255, 0.72);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--lex-border);
	border-radius: 24px;
	box-shadow: none;
	overflow-x: hidden;
	box-sizing: border-box;
}

.rdv-portail-wrapper h3,
.rdv-portail-wrapper h4 {
	color: var(--lex-primary);
}

.rdv-portail-desc {
	color: var(--lex-text-muted);
	margin-bottom: 20px;
}

.rdv-portail-login-form label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: var(--lex-primary);
}

.rdv-portail-login-form select,
.rdv-portail-login-form input[type="password"] {
	width: 100%;
	max-width: 360px;
	padding: 12px 14px;
	border: 1px solid var(--lex-border);
	border-radius: var(--lex-radius-sm);
	font: inherit;
	margin-bottom: 14px;
}

.rdv-portail-login-form input:focus,
.rdv-portail-login-form select:focus {
	outline: none;
	border-color: var(--lex-secondary);
	box-shadow: 0 0 0 3px var(--lex-accent-bg);
}

.rdv-portail-login-error {
	color: var(--lex-danger);
	font-size: 0.9rem;
}

.rdv-portail-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--lex-border-light);
	flex-wrap: wrap;
}

.rdv-portail-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--lex-border);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.rdv-portail-tab {
	padding: 10px 16px;
	border: none !important;
	background: transparent !important;
	background-image: none !important;
	font: inherit;
	font-weight: 500;
	color: var(--lex-text-muted) !important;
	cursor: pointer;
	border-bottom: 2px solid transparent !important;
	margin-bottom: -1px;
	transition: color 0.15s, background 0.15s;
	box-shadow: none !important;
	filter: none !important;
	white-space: nowrap;
	flex-shrink: 0;
}

.rdv-portail-tab:hover,
.rdv-portail-tab:focus {
	color: var(--lex-primary) !important;
	background: var(--lex-accent-bg) !important;
	outline: none;
}

.rdv-portail-tab.is-active {
	color: var(--lex-secondary) !important;
	border-bottom-color: var(--lex-secondary) !important;
	background: transparent !important;
}

.rdv-portail-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
	gap: 24px;
	align-items: start;
}

.rdv-portail-layout > * {
	min-width: 0;
}

@media (max-width: 900px) {
	.rdv-portail-layout {
		grid-template-columns: 1fr;
	}
}

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

.rdv-portail-month-label {
	font-size: 1.15rem;
	font-weight: 600;
	text-transform: capitalize;
	color: var(--lex-primary);
}

.rdv-portail-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	margin-bottom: 6px;
	text-align: center;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--lex-text-muted);
	text-transform: uppercase;
}

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

.rdv-portail-day {
	position: relative;
	aspect-ratio: 1;
	min-height: 44px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 6px 4px 4px;
	border: 1px solid var(--lex-border-light);
	border-radius: var(--lex-radius-sm);
	background: var(--lex-surface-alt);
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
	color: var(--lex-primary);
}

.rdv-portail-day.empty {
	background: transparent;
	border-color: transparent;
	cursor: default;
}

.rdv-portail-day:not(.empty):hover {
	background: var(--lex-accent-bg);
	border-color: var(--lex-secondary);
}

.rdv-portail-day.is-selected {
	background: var(--lex-accent-bg-hover);
	border-color: var(--lex-secondary);
	box-shadow: inset 0 0 0 1px var(--lex-secondary);
	font-weight: 600;
}

.rdv-portail-day.mode-closed {
	background: #eef2f4;
	color: var(--lex-text-light);
}

.rdv-portail-day.mode-custom {
	background: rgba(0, 51, 70, 0.06);
	border-color: rgba(0, 51, 70, 0.2);
}

.rdv-day-dots {
	display: flex;
	gap: 3px;
	margin-top: auto;
}

.rdv-day-dots i {
	display: block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
}

.dot-custom { background: var(--lex-secondary); }
.dot-closed { background: var(--lex-text-light); }
.dot-appt { background: var(--lex-warning); }

.rdv-portail-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 14px;
	font-size: 0.78rem;
	color: var(--lex-text-muted);
}

.rdv-legend-item::before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 5px;
	vertical-align: middle;
}

.rdv-legend-default::before { background: var(--lex-accent-bg-hover); border: 1px solid var(--lex-secondary); }
.rdv-legend-custom::before { background: var(--lex-secondary); }
.rdv-legend-closed::before { background: var(--lex-text-light); }
.rdv-legend-appt::before { background: var(--lex-warning); }

.rdv-portail-day-panel {
	background: rgba(255, 255, 255, 0.65);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid var(--lex-border);
	border-radius: 24px;
	padding: 18px;
	min-height: 320px;
	max-width: 100%;
	overflow: hidden;
}

.rdv-portail-day-placeholder {
	color: var(--lex-text-light);
	text-align: center;
	padding: 40px 12px;
}

.rdv-portail-selected-date {
	text-transform: capitalize;
	font-size: 1rem;
}

.rdv-timeline-track {
	position: relative;
	height: 48px;
	background: var(--lex-border-light);
	border-radius: var(--lex-radius-sm);
	overflow: hidden;
	margin-bottom: 16px;
}

.rdv-timeline-block {
	position: absolute;
	top: 6px;
	height: 36px;
	border-radius: 4px;
}

.rdv-timeline-available {
	background: rgba(0, 51, 70, 0.45);
	border: 1px solid var(--lex-secondary);
}

.rdv-timeline-appt {
	background: rgba(180, 83, 9, 0.65);
	border: 1px solid var(--lex-warning);
	z-index: 2;
}

.rdv-timeline-labels {
	position: absolute;
	bottom: 2px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	padding: 0 4px;
	font-size: 0.65rem;
	color: var(--lex-text-light);
	pointer-events: none;
}

.rdv-portail-mode-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}

.rdv-mode-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: rgba(255, 255, 255, 0.8);
	border: 1px solid var(--lex-border);
	border-radius: 14px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	position: relative;
}

.rdv-mode-card:hover {
	border-color: var(--lex-secondary);
	background: var(--lex-accent-bg);
}

.rdv-mode-card input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 20px;
	height: 20px;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	margin: 0;
	cursor: pointer;
	z-index: 2;
}

.rdv-mode-card-box {
	width: 20px;
	height: 20px;
	border: 2px solid var(--lex-secondary);
	border-radius: 5px;
	flex-shrink: 0;
	background: #fff;
	transition: background 0.15s, box-shadow 0.15s;
}

.rdv-mode-card input:checked + .rdv-mode-card-box {
	background: var(--lex-secondary);
	box-shadow: inset 0 0 0 3px #fff;
}

.rdv-mode-card-text {
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--lex-primary);
}

.rdv-range-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.rdv-range-row input[type="time"] {
	padding: 6px 8px;
	border: 1px solid var(--lex-border);
	border-radius: 4px;
	font: inherit;
}

.rdv-range-remove {
	min-width: 32px;
	padding: 4px 8px;
	color: var(--lex-danger);
}

.rdv-portail-slots-preview {
	max-width: 100%;
	overflow: hidden;
	margin-bottom: 12px;
}

.rdv-slots-label {
	font-weight: 600;
	font-size: 0.85rem;
	margin-bottom: 6px;
}

.rdv-slots-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	max-width: 100%;
	max-height: 100px;
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 4px;
}

.rdv-slot-chip {
	font-size: 0.75rem;
	padding: 3px 8px;
	background: var(--lex-accent-bg);
	border-radius: 4px;
	color: var(--lex-secondary);
	flex-shrink: 0;
}

/* Onglet Rendez-vous */
.rdv-portail-appt-filters {
	display: flex;
	gap: 8px;
	margin-bottom: 20px;
}

.rdv-portail-appt-filters {
	flex-wrap: wrap;
}

.rdv-appt-filter {
	padding: 8px 16px;
	border: 1px solid var(--lex-border) !important;
	border-radius: 20px;
	background: var(--lex-surface) !important;
	background-image: none !important;
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	color: var(--lex-text-muted) !important;
	transition: all 0.15s;
	box-shadow: none !important;
}

.rdv-appt-filter:hover {
	background: var(--lex-accent-bg) !important;
	color: var(--lex-primary) !important;
}

.rdv-appt-filter.is-active {
	background: var(--lex-secondary) !important;
	border-color: var(--lex-secondary) !important;
	color: #fff !important;
}

.rdv-portail-appt-card {
	background: var(--lex-surface);
	border: 1px solid var(--lex-border);
	border-radius: var(--lex-radius);
	padding: 18px;
	margin-bottom: 12px;
	transition: box-shadow 0.15s;
}

.rdv-portail-appt-card:hover {
	box-shadow: var(--lex-shadow);
}

.rdv-appt-card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.rdv-appt-card-date {
	font-weight: 600;
	color: var(--lex-primary);
	font-size: 1.05rem;
}

.rdv-appt-status {
	font-size: 0.75rem;
	padding: 4px 10px;
	border-radius: 20px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.rdv-appt-status.pending {
	background: rgba(180, 83, 9, 0.12);
	color: var(--lex-warning);
}

.rdv-appt-status.confirme {
	background: rgba(13, 122, 94, 0.12);
	color: var(--lex-success);
}

.rdv-appt-status.refuse {
	background: rgba(197, 48, 48, 0.1);
	color: var(--lex-danger);
}

.rdv-appt-card-meta {
	font-size: 0.9rem;
	color: var(--lex-text-muted);
	margin-bottom: 6px;
}

.rdv-appt-card-meta strong {
	color: var(--lex-primary);
}

.rdv-appt-card-motif {
	font-size: 0.85rem;
	color: var(--lex-text-muted);
	margin-bottom: 14px;
	padding: 10px;
	background: var(--lex-surface-alt);
	border-radius: var(--lex-radius-sm);
}

.rdv-appt-card-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.rdv-btn-confirm {
	background: var(--lex-secondary);
	border-color: var(--lex-secondary);
	color: #fff;
}

.rdv-btn-confirm:hover {
	background: var(--lex-secondary-hover);
}

.rdv-btn-refuse {
	color: var(--lex-danger);
	border-color: var(--lex-danger);
}

.rdv-btn-refuse:hover {
	background: rgba(197, 48, 48, 0.06);
}

.rdv-appt-empty {
	text-align: center;
	padding: 48px 20px;
	color: var(--lex-text-muted);
}

.rdv-template-intro {
	color: var(--lex-text-muted);
	margin-bottom: 20px;
	font-size: 0.92rem;
	line-height: 1.5;
}

.rdv-template-days {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.rdv-template-day-row {
	display: grid;
	grid-template-columns: minmax(140px, 1fr) auto minmax(180px, 1.2fr);
	gap: 12px;
	align-items: center;
	padding: 14px 16px;
	background: rgba(255, 255, 255, 0.85);
	border: 1px solid var(--lex-border);
	border-radius: 16px;
}

.rdv-template-day-row.is-disabled {
	opacity: 0.65;
	background: #f0f3f5;
}

.rdv-day-check-card {
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	position: relative;
}

.rdv-day-check-card input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 20px;
	height: 20px;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	margin: 0;
	cursor: pointer;
	z-index: 2;
}

.rdv-day-check-box {
	width: 20px;
	height: 20px;
	border: 2px solid var(--lex-secondary);
	border-radius: 5px;
	flex-shrink: 0;
	background: #fff;
	transition: background 0.15s, box-shadow 0.15s;
}

.rdv-day-check-card input:checked + .rdv-day-check-box {
	background: var(--lex-secondary);
	box-shadow: inset 0 0 0 3px #fff;
}

.rdv-day-check-label {
	font-weight: 600;
	color: var(--lex-primary);
	font-size: 0.95rem;
}

.rdv-template-day-status {
	font-size: 0.78rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--lex-text-muted);
}

.rdv-template-day-row:not(.is-disabled) .rdv-template-day-status {
	color: var(--lex-success);
}

.rdv-template-day-times {
	display: flex;
	align-items: center;
	gap: 8px;
	justify-content: flex-end;
	flex-wrap: wrap;
}

.rdv-template-day-times input[type="time"] {
	padding: 8px 10px;
	border: 1px solid var(--lex-border);
	border-radius: 10px;
	font: inherit;
	min-width: 0;
	width: 100%;
	max-width: 120px;
}

.rdv-template-time-sep {
	color: var(--lex-text-muted);
}

.rdv-template-save {
	margin-top: 4px;
}

/* Planning */
.rdv-planning-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	gap: 12px;
}

.rdv-planning-month-label {
	font-size: 1.15rem;
	font-weight: 600;
	text-transform: capitalize;
	color: var(--lex-primary);
}

.rdv-planning-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.rdv-planning-day {
	background: rgba(255, 255, 255, 0.8);
	border: 1px solid var(--lex-border);
	border-radius: 18px;
	padding: 16px 18px;
}

.rdv-planning-day-title {
	margin: 0 0 12px;
	font-size: 1rem;
	font-weight: 600;
	text-transform: capitalize;
	color: var(--lex-secondary);
}

.rdv-planning-appts {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rdv-planning-appt {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 12px 14px;
	background: var(--lex-surface-alt);
	border-radius: 12px;
}

.rdv-planning-time {
	flex-shrink: 0;
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--lex-secondary);
	min-width: 48px;
}

.rdv-planning-details {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.rdv-planning-details strong {
	color: var(--lex-primary);
}

.rdv-planning-meta {
	font-size: 0.85rem;
	color: var(--lex-text-muted);
}

.rdv-planning-motif {
	font-size: 0.82rem;
	color: var(--lex-text-muted);
}

.rdv-planning-empty {
	text-align: center;
	padding: 48px 20px;
	color: var(--lex-text-muted);
}

.rdv-portail-save-msg {
	color: var(--lex-success);
	font-weight: 500;
	margin-top: 12px;
}

.rdv-portail-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.9);
	border-radius: var(--lex-radius);
	z-index: 10;
}

.rdv-portail-loading[hidden],
.rdv-portail-dashboard[hidden],
.rdv-portail-login-error[hidden],
.rdv-portail-panel[hidden],
.rdv-portail-day-editor[hidden] {
	display: none !important;
}

@media (max-width: 900px) {
	.rdv-portail-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.rdv-portail-day {
		min-height: 38px;
		font-size: 0.8rem;
		padding: 4px 2px;
	}

	.rdv-portail-weekdays {
		font-size: 0.62rem;
	}

	.rdv-template-day-row {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.rdv-template-day-times {
		justify-content: flex-start;
	}

	.rdv-range-row {
		flex-wrap: wrap;
	}

	.rdv-range-row input[type="time"] {
		flex: 1;
		min-width: 100px;
	}
}

@media (max-width: 600px) {
	.rdv-portail-wrapper {
		padding: 14px;
		border-radius: 16px;
	}

	.rdv-portail-tab {
		padding: 8px 12px;
		font-size: 0.88rem;
	}

	.rdv-portail-day {
		min-height: 34px;
		font-size: 0.72rem;
		border-radius: 8px;
	}

	.rdv-portail-month-grid,
	.rdv-portail-weekdays {
		gap: 2px;
	}

	.rdv-day-dots i {
		width: 4px;
		height: 4px;
	}

	.rdv-planning-appt {
		flex-direction: column;
		gap: 6px;
	}
}

.rdv-portail-wrapper .rdv-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid var(--lex-border);
	border-top-color: var(--lex-secondary);
	border-radius: 50%;
	animation: rdv-spin 0.7s linear infinite;
}

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

.rdv-portail-wrapper .rdv-btn {
	display: inline-flex;
	padding: 10px 16px;
	border: 1px solid var(--lex-border);
	border-radius: var(--lex-radius-sm);
	background: var(--lex-surface);
	font: inherit;
	cursor: pointer;
	color: var(--lex-primary);
}

.rdv-portail-wrapper .rdv-btn-primary {
	background: var(--lex-secondary);
	border-color: var(--lex-secondary);
	color: #fff;
}

.rdv-portail-save-day {
	width: 100%;
	margin-top: 8px;
}
