/* ============================================================
   RD TERMINE – FRONTEND
   ============================================================ */

#terminid.rd-termine {
	--rd-primary: #111827;
	--rd-primary-hover: #1f2937;
	--rd-accent: #2563eb;
	--rd-accent-hover: #1d4ed8;
	--rd-accent-light: #eff6ff;

	--rd-bg: #f5f7fa;
	--rd-surface: #ffffff;
	--rd-border: #e2e8f0;
	--rd-border-dark: #cbd5e1;

	--rd-text: #1e293b;
	--rd-text-light: #64748b;
	--rd-text-muted: #94a3b8;

	--rd-success: #16a34a;
	--rd-danger: #dc2626;

	--rd-radius: 12px;
	--rd-radius-small: 8px;

	--rd-shadow:
		0 10px 30px rgba(15, 23, 42, 0.08);

	--rd-transition:
		150ms ease;

	width: 100%;
	max-width: 1180px;
	margin: 40px auto;
	padding: 0 20px;

	box-sizing: border-box;

	color: var(--rd-text);
	font-family:
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Roboto,
		Helvetica,
		Arial,
		sans-serif;

	font-size: 16px;
	line-height: 1.5;
}


/* ============================================================
   BOX SIZING
   ============================================================ */

#terminid.rd-termine *,
#terminid.rd-termine *::before,
#terminid.rd-termine *::after {
	box-sizing: border-box;
}


/* ============================================================
   FORM
   ============================================================ */

.rd-termine__form {
	width: 100%;
	margin: 0;
}

.rd-termine__container {
	width: 100%;
}


/* ============================================================
   KUNDENDATEN
   ============================================================ */

.rd-termine__customer-panel {
	background: var(--rd-surface);
	border: 1px solid var(--rd-border);
	border-radius: var(--rd-radius);
	padding: 28px;

	box-shadow: var(--rd-shadow);
}

.rd-termine__customer-form {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}


/* ============================================================
   FELDER
   ============================================================ */

.rd-termine__field {
	margin: 0;
}

.rd-termine__field label {
	display: block;

	margin: 0 0 7px;

	color: var(--rd-text);

	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

.rd-termine__field input,
.rd-termine__field textarea {
	display: block;

	width: 100%;
	margin: 0;

	border: 1px solid var(--rd-border-dark);
	border-radius: var(--rd-radius-small);

	background: #fff;
	color: var(--rd-text);

	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;

	transition:
		border-color var(--rd-transition),
		box-shadow var(--rd-transition),
		background-color var(--rd-transition);

	outline: none;
}

.rd-termine__field input {
	height: 48px;
	padding: 0 14px;
}

.rd-termine__field textarea {
	min-height: 110px;
	padding: 12px 14px;

	resize: vertical;
}

.rd-termine__field input:hover,
.rd-termine__field textarea:hover {
	border-color: #94a3b8;
}

.rd-termine__field input:focus,
.rd-termine__field textarea:focus {
	border-color: var(--rd-accent);

	box-shadow:
		0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* ============================================================
   THEMA
   ============================================================ */

.rd-termine__topic {
	margin-top: 20px;

	background: var(--rd-surface);
	border: 1px solid var(--rd-border);
	border-radius: var(--rd-radius);

	padding: 24px;

	box-shadow: var(--rd-shadow);
}


/* ============================================================
   BUCHUNGSBEREICH
   ============================================================ */

.rd-termine__booking-grid {
	display: grid;

	grid-template-columns:
		minmax(0, 1.15fr)
		minmax(320px, 0.85fr);

	gap: 24px;

	margin-top: 24px;
}


/* ============================================================
   PANELS
   ============================================================ */

.rd-termine__calendar-panel,
.rd-termine__slots-panel {
	background: var(--rd-surface);

	border: 1px solid var(--rd-border);
	border-radius: var(--rd-radius);

	padding: 28px;

	box-shadow: var(--rd-shadow);
}


/* ============================================================
   ÜBERSCHRIFTEN
   ============================================================ */

.rd-termine__heading {
	margin: 0 0 24px;

	color: var(--rd-text);

	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
}


/* ============================================================
   KALENDER HEADER
   ============================================================ */

.rd-termine__calendar-header {
	display: grid;

	grid-template-columns: 44px 1fr 44px;
	align-items: center;

	gap: 10px;

	margin-bottom: 18px;
}

.rd-termine__month-title {
	display: block;

	color: var(--rd-text);

	text-align: center;

	font-size: 17px;
	font-weight: 700;
	text-transform: capitalize;
}


/* ============================================================
   MONATS BUTTONS
   ============================================================ */

.rd-termine__month-button {
	display: flex;

	width: 44px;
	height: 44px;

	align-items: center;
	justify-content: center;

	padding: 0;

	border: 1px solid var(--rd-border);
	border-radius: 50%;

	background: #fff;
	color: var(--rd-text);

	font-family: inherit;
	font-size: 27px;
	font-weight: 400;
	line-height: 1;

	cursor: pointer;

	transition:
		background-color var(--rd-transition),
		border-color var(--rd-transition),
		color var(--rd-transition),
		transform var(--rd-transition);
}

.rd-termine__month-button:hover {
	border-color: var(--rd-accent);

	background: var(--rd-accent-light);
	color: var(--rd-accent);
}

.rd-termine__month-button:active {
	transform: scale(0.94);
}

.rd-termine__month-button:focus-visible {
	outline: 3px solid rgba(37, 99, 235, 0.2);
	outline-offset: 2px;
}


/* ============================================================
   WOCHENTAGE
   ============================================================ */

.rd-termine__weekdays {
	display: grid;

	grid-template-columns:
		repeat(7, minmax(0, 1fr));

	gap: 6px;

	margin-bottom: 8px;
}

.rd-termine__weekdays > div {
	padding: 8px 2px;

	color: var(--rd-text-muted);

	text-align: center;

	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}


/* ============================================================
   KALENDERTAGE
   ============================================================ */

.rd-termine__days {
	display: grid;

	grid-template-columns:
		repeat(7, minmax(0, 1fr));

	gap: 6px;
}

.rd-termine__days > * {
	min-width: 0;
}


/*
 * Die folgenden Regeln decken sowohl Buttons
 * als auch mögliche div/span-Kalendertage ab.
 */

.rd-termine__days button,
.rd-termine__days .rd-termine__day,
.rd-termine__days > div,
.rd-termine__days > span {
	position: relative;

	display: flex;

	min-height: 44px;

	align-items: center;
	justify-content: center;

	padding: 4px;

	border: 1px solid transparent;
	border-radius: var(--rd-radius-small);

	background: transparent;
	color: var(--rd-text);

	font-family: inherit;
	font-size: 14px;
	font-weight: 500;

	cursor: pointer;

	transition:
		background-color var(--rd-transition),
		border-color var(--rd-transition),
		color var(--rd-transition),
		transform var(--rd-transition);
}

.rd-termine__days button:hover,
.rd-termine__days .rd-termine__day:hover {
	border-color: #bfdbfe;
	background: var(--rd-accent-light);
	color: var(--rd-accent);
}

.rd-termine__days button:active,
.rd-termine__days .rd-termine__day:active {
	transform: scale(0.94);
}


/* ============================================================
   AUSGEWÄHLTER TAG
   ============================================================ */

.rd-termine__days .selected,
.rd-termine__days .active,
.rd-termine__days button.selected,
.rd-termine__days button.active {
	border-color: var(--rd-accent);

	background: var(--rd-accent);
	color: #fff;
	font-weight: 700;
}

.rd-termine__days .selected:hover,
.rd-termine__days .active:hover {
	border-color: var(--rd-accent-hover);

	background: var(--rd-accent-hover);
	color: #fff;
}


/* ============================================================
   HEUTIGER TAG
   ============================================================ */

.rd-termine__days .today {
	font-weight: 700;
}

.rd-termine__days .today::after {
	content: "";

	position: absolute;

	bottom: 5px;
	left: 50%;

	width: 4px;
	height: 4px;

	border-radius: 50%;

	background: currentColor;

	transform: translateX(-50%);
}

.rd-termine__days .selected.today::after,
.rd-termine__days .active.today::after {
	background: #fff;
}


/* ============================================================
   NICHT VERFÜGBARE / VERGANGENE TAGE
   ============================================================ */

.rd-termine__days .disabled,
.rd-termine__days button:disabled {
	border-color: transparent;

	background: transparent;
	color: #cbd5e1;

	cursor: not-allowed;

	opacity: 1;
}

.rd-termine__days .disabled:hover,
.rd-termine__days button:disabled:hover {
	border-color: transparent;
	background: transparent;
	color: #cbd5e1;
}


/* ============================================================
   LEERE KALENDERTAGE
   ============================================================ */

.rd-termine__days .empty,
.rd-termine__days .outside-month {
	cursor: default;
	visibility: hidden;
}


/* ============================================================
   AUSGEWÄHLTES DATUM
   ============================================================ */

.rd-termine__date-value {
	display: none !important;
}


/* ============================================================
   ZEITBEREICH
   ============================================================ */

.rd-termine__selected-date {
	margin: -10px 0 20px;

	color: var(--rd-text-light);

	font-size: 14px;
	line-height: 1.5;
}


/* ============================================================
   SLOTS
   ============================================================ */

.rd-termine__slots {
	display: grid;

	grid-template-columns:
		repeat(2, minmax(0, 1fr));

	gap: 10px;

	margin-bottom: 24px;
}

.rd-termine__slot {
	display: flex;

	min-height: 46px;

	align-items: center;
	justify-content: center;

	padding: 9px 12px;

	border: 1px solid var(--rd-border-dark);
	border-radius: var(--rd-radius-small);

	background: #fff;
	color: var(--rd-text);

	font-family: inherit;
	font-size: 14px;
	font-weight: 600;

	cursor: pointer;

	transition:
		background-color var(--rd-transition),
		border-color var(--rd-transition),
		color var(--rd-transition),
		box-shadow var(--rd-transition),
		transform var(--rd-transition);
}

.rd-termine__slot:hover:not(:disabled) {
	border-color: var(--rd-accent);

	background: var(--rd-accent-light);
	color: var(--rd-accent);
}

.rd-termine__slot:active:not(:disabled) {
	transform: scale(0.97);
}


/* ============================================================
   AUSGEWÄHLTER SLOT
   ============================================================ */

.rd-termine__slot.selected,
.rd-termine__slot.active {
	border-color: var(--rd-accent);

	background: var(--rd-accent);
	color: #fff;

	box-shadow:
		0 4px 10px rgba(37, 99, 235, 0.2);
}

.rd-termine__slot.selected:hover,
.rd-termine__slot.active:hover {
	border-color: var(--rd-accent-hover);

	background: var(--rd-accent-hover);
	color: #fff;
}


/* ============================================================
   DEAKTIVIERTE SLOTS
   ============================================================ */

.rd-termine__slot:disabled {
	border-color: #e5e7eb;

	background: #f8fafc;
	color: #cbd5e1;

	cursor: not-allowed;
}

.rd-termine__slot[data-booked="true"],
.rd-termine__slot.booked {
	border-color: #e5e7eb;

	background: #f8fafc;
	color: #cbd5e1;

	text-decoration: line-through;

	cursor: not-allowed;
}


/* ============================================================
   AUSGEWÄHLTE UHRZEIT
   ============================================================ */

.rd-termine__time-value {
	display: none !important;
}


/* ============================================================
   ABSENDEN BUTTON
   ============================================================ */

.rd-termine__submit {
	display: flex;

	width: 100%;
	min-height: 52px;

	align-items: center;
	justify-content: center;

	padding: 13px 20px;

	border: 0;
	border-radius: var(--rd-radius-small);

	background: var(--rd-primary);
	color: #fff;

	font-family: inherit;
	font-size: 15px;
	font-weight: 700;

	cursor: pointer;

	transition:
		background-color var(--rd-transition),
		box-shadow var(--rd-transition),
		transform var(--rd-transition),
		opacity var(--rd-transition);
}

.rd-termine__submit:hover:not(:disabled) {
	background: var(--rd-primary-hover);

	box-shadow:
		0 6px 16px rgba(15, 23, 42, 0.18);
}

.rd-termine__submit:active:not(:disabled) {
	transform: translateY(1px);
}

.rd-termine__submit:focus-visible {
	outline: 3px solid rgba(37, 99, 235, 0.25);
	outline-offset: 3px;
}

.rd-termine__submit:disabled {
	background: #e2e8f0;
	color: #94a3b8;

	cursor: not-allowed;

	box-shadow: none;
}


/* ============================================================
   ERFOLGS-OVERLAY
   ============================================================ */

#rd-termine-success-overlay {
	position: fixed;

	z-index: 999999;

	inset: 0;

	display: flex;

	align-items: center;
	justify-content: center;

	padding: 20px;

	background: rgba(15, 23, 42, 0.62);

	backdrop-filter: blur(4px);

	animation: rd-termine-overlay-in 180ms ease-out;
}

#rd-termine-success-message {
	position: relative;

	width: min(100%, 460px);

	padding: 42px 36px 36px;

	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 16px;

	background: #fff;

	box-shadow:
		0 25px 70px rgba(15, 23, 42, 0.25);

	text-align: center;

	animation: rd-termine-message-in 220ms ease-out;
}

#rd-termine-success-message p {
	margin: 0;

	color: var(--rd-text);

	font-size: 18px;
	font-weight: 600;
	line-height: 1.5;
}

#rd-termine-success-close {
	position: absolute;

	top: 12px;
	right: 12px;

	display: flex;

	width: 38px;
	height: 38px;

	align-items: center;
	justify-content: center;

	padding: 0;

	border: 0;
	border-radius: 50%;

	background: transparent;
	color: var(--rd-text-light);

	font-family: inherit;
	font-size: 27px;
	font-weight: 300;
	line-height: 1;

	cursor: pointer;

	transition:
		background-color var(--rd-transition),
		color var(--rd-transition);
}

#rd-termine-success-close:hover {
	background: #f1f5f9;
	color: var(--rd-text);
}

#rd-termine-success-close:focus-visible {
	outline: 3px solid rgba(37, 99, 235, 0.2);
	outline-offset: 2px;
}


/* ============================================================
   ANIMATIONEN
   ============================================================ */

@keyframes rd-termine-overlay-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes rd-termine-message-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 900px) {

	#terminid.rd-termine {
		margin: 30px auto;
	}

	.rd-termine__customer-form {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rd-termine__booking-grid {
		grid-template-columns: 1fr;
	}

}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {

	#terminid.rd-termine {
		margin: 20px auto;
		padding: 0 12px;

		font-size: 15px;
	}

	.rd-termine__customer-panel,
	.rd-termine__calendar-panel,
	.rd-termine__slots-panel {
		padding: 20px 16px;

		border-radius: 10px;
	}

	.rd-termine__customer-form {
		grid-template-columns: 1fr;

		gap: 16px;
	}

	.rd-termine__topic {
		margin-top: 16px;
		padding: 20px 16px;
	}

	.rd-termine__booking-grid {
		gap: 16px;

		margin-top: 16px;
	}

	.rd-termine__heading {
		margin-bottom: 18px;

		font-size: 18px;
	}

	.rd-termine__calendar-header {
		grid-template-columns: 40px 1fr 40px;

		gap: 6px;
	}

	.rd-termine__month-button {
		width: 40px;
		height: 40px;

		font-size: 24px;
	}

	.rd-termine__month-title {
		font-size: 16px;
	}

	.rd-termine__weekdays {
		gap: 3px;
	}

	.rd-termine__days {
		gap: 3px;
	}

	.rd-termine__days button,
	.rd-termine__days .rd-termine__day,
	.rd-termine__days > div,
	.rd-termine__days > span {
		min-height: 40px;

		border-radius: 7px;

		font-size: 13px;
	}

	.rd-termine__slots {
		grid-template-columns: repeat(2, minmax(0, 1fr));

		gap: 8px;
	}

	.rd-termine__slot {
		min-height: 44px;

		padding: 8px;

		font-size: 13px;
	}

	.rd-termine__submit {
		min-height: 50px;
	}

	#rd-termine-success-message {
		padding: 38px 24px 28px;
	}

	#rd-termine-success-message p {
		font-size: 16px;
	}

}


/* ============================================================
   SEHR KLEINE SMARTPHONES
   ============================================================ */

@media (max-width: 380px) {

	#terminid.rd-termine {
		padding: 0 8px;
	}

	.rd-termine__customer-panel,
	.rd-termine__calendar-panel,
	.rd-termine__slots-panel {
		padding: 16px 12px;
	}

	.rd-termine__days button,
	.rd-termine__days .rd-termine__day,
	.rd-termine__days > div,
	.rd-termine__days > span {
		min-height: 36px;

		font-size: 12px;
	}

	.rd-termine__slots {
		grid-template-columns: 1fr;
	}

}


/* ============================================================
   REDUZIERTE BEWEGUNG
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

	#terminid.rd-termine *,
	#terminid.rd-termine *::before,
	#terminid.rd-termine *::after {
		scroll-behavior: auto !important;

		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}

}