/*
 * AppForge Afspraken – frontend
 * Alle regels zijn gescoped onder .afb zodat het thema niet wordt beïnvloed.
 */
.afb {
	--afb-primary: #8534C5;
	--afb-primary-dark: #6624A6;
	--afb-navy: #222B59;
	--afb-ink: #20243D;
	--afb-ink-2: #4A4F6A;
	--afb-muted: #6B7090;
	--afb-light: #F1E6FA;
	--afb-lavender: #E7D8F7;
	--afb-line: #E6E2EF;
	--afb-line-2: #D9D3E6;
	--afb-bg: #FFFFFF;
	--afb-soft: #FAF7FD;
	--afb-green: #22C55E;
	--afb-orange: #F59E0B;
	--afb-red: #DC2626;
	--afb-radius: 14px;
	--afb-radius-sm: 8px;
	--afb-shadow: 0 1px 2px rgba(34, 43, 89, .06), 0 10px 30px -12px rgba(34, 43, 89, .18);
	--afb-focus: 0 0 0 3px color-mix(in srgb, var(--afb-primary) 30%, transparent);
	font-family: "AFB Inter", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--afb-ink);
	-webkit-font-smoothing: antialiased;
	text-align: left;
}
.afb *, .afb *::before, .afb *::after { box-sizing: border-box; }
.afb [hidden] { display: none !important; }
:where(.afb) :where(h2, h3, p, dl, dt, dd) { margin: 0; padding: 0; border: 0; }
.afb button { font-family: inherit; text-transform: none; letter-spacing: normal; }
.afb svg { flex-shrink: 0; }
.afb img { max-width: 100%; }

/* Typografie */
.afb-title {
	font-size: 26px;
	line-height: 1.2;
	font-weight: 700;
	color: #2E1F6E;
	letter-spacing: -.01em;
}
.afb-subtitle { margin-top: 4px !important; color: var(--afb-ink-2); font-size: 15px; }
.afb-muted { color: var(--afb-muted); font-size: 14px; }
.afb-help { color: var(--afb-muted); font-size: 13px; margin-top: 8px !important; }
.afb-center { text-align: center; }
.afb-optional { color: var(--afb-muted); font-weight: 400; }

/* Kaart */
.afb-card {
	background: var(--afb-bg);
	border: 1px solid var(--afb-line);
	border-radius: var(--afb-radius);
	box-shadow: var(--afb-shadow);
	padding: 28px;
}

/* ============ Scherm 1: boekingsformulier ============ */
.afb-booking {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	max-width: 1040px;
	margin: 0 auto;
	position: relative;
}
.afb-booking--with-image {
	grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
	background: linear-gradient(180deg, var(--afb-light), #fff 70%);
	border-radius: calc(var(--afb-radius) + 6px);
	padding: 14px;
	gap: 22px;
	box-shadow: var(--afb-shadow);
	border: 1px solid var(--afb-lavender);
}
.afb-booking__media {
	position: relative;
	align-self: stretch;
	min-height: 520px;
	border-radius: var(--afb-radius);
	overflow: hidden;
	background: var(--afb-lavender);
}
.afb-booking.is-done .afb-booking__media { min-height: 0; height: 100%; position: relative; top: 0; align-self: stretch; }
.afb-booking__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	object-position: center 22%;
	transition: opacity .25s ease;
}
.afb-booking__img.is-switching { opacity: .35; }
.afb-booking--with-image .afb-booking__card {
	box-shadow: none;
	border: 0;
	background: transparent;
	padding: 18px 10px 12px 0;
}
.afb-booking__head { margin-bottom: 22px; }
.afb-booking.is-done .afb-booking__media { opacity: .9; }
.afb-booking__done { align-self: center; }

/* Stappen */
.afb-step { margin-bottom: 22px; }
.afb-step__title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 15px !important;
	font-weight: 700;
	color: var(--afb-ink);
	margin: 0 0 10px !important;
	line-height: 1.3;
}
.afb-step__title label { cursor: pointer; }
.afb-step__num {
	display: inline-grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--afb-primary-dark);
	color: #fff;
	font-size: 12.5px;
	font-weight: 700;
	flex: 0 0 24px;
}
.afb-step--details { animation: afb-in .3s ease both; }
@keyframes afb-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Velden */
.afb-field { margin: 14px 0 0; border: 0; padding: 0; min-width: 0; }
.afb-label {
	display: block;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--afb-ink);
	margin-bottom: 6px;
	padding: 0;
}
.afb-input,
.afb-select select {
	width: 100%;
	font: inherit;
	font-size: 15px;
	color: var(--afb-ink);
	background: #fff;
	border: 1px solid var(--afb-line-2);
	border-radius: var(--afb-radius-sm);
	padding: 11px 13px;
	min-height: 46px;
	box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
	margin: 0;
}
textarea.afb-input { min-height: 84px; resize: vertical; }
.afb-input:hover, .afb-select select:hover { border-color: #BDB3D3; }
.afb-input:focus, .afb-select select:focus {
	outline: 0;
	border-color: var(--afb-primary);
	box-shadow: var(--afb-focus);
}
.afb-select { position: relative; }
.afb-select select {
	appearance: none;
	-webkit-appearance: none;
	padding-left: 42px;
	padding-right: 40px;
	cursor: pointer;
	text-overflow: ellipsis;
	background-image: none;
}
.afb-select__icon, .afb-select__chev {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	display: flex;
	color: var(--afb-primary);
}
.afb-select__icon { left: 14px; }
.afb-select__chev { right: 13px; color: var(--afb-ink); }
.afb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.afb-grid .afb-field { margin-top: 12px; }
.afb-field--full { grid-column: 1 / -1; }

/* Keuzechips (medewerker) */
.afb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.afb-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding: 6px 14px 6px 8px;
	border-radius: 999px;
	border: 1px solid var(--afb-line-2);
	background: #fff;
	color: var(--afb-ink);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all .15s;
}
.afb-chip[data-employee="0"] { padding-left: 14px; }
.afb-chip:hover { border-color: var(--afb-primary); }
.afb-chip.is-selected { border-color: var(--afb-primary); background: var(--afb-light); color: var(--afb-primary-dark); font-weight: 600; }
.afb-chip__avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	overflow: hidden;
	display: grid;
	place-items: center;
	background: var(--afb-lavender);
	color: var(--afb-primary-dark);
	font-size: 11px;
	font-weight: 700;
}
.afb-chip__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Kalender */
.afb-cal {
	border: 1px solid var(--afb-line);
	border-radius: 12px;
	padding: 12px 12px 10px;
	background: #fff;
}
.afb-cal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}
.afb-cal__month { font-weight: 700; font-size: 14.5px; color: var(--afb-ink); text-transform: capitalize; }
.afb-cal__nav {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--afb-ink);
	cursor: pointer;
}
.afb-cal__nav:hover:not(:disabled) { background: var(--afb-light); color: var(--afb-primary-dark); }
.afb-cal__nav:disabled { opacity: .3; cursor: default; }
.afb-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 3px;
	text-align: center;
	transition: opacity .2s;
}
.afb-cal__grid.is-loading { opacity: .45; }
.afb-cal__dow { font-size: 12px; font-weight: 500; color: var(--afb-muted); padding: 4px 0; }
.afb-cal__day {
	height: 36px;
	min-width: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	font-size: 14px;
	font-weight: 500;
	color: #B5B3C4;
	cursor: default;
	font-variant-numeric: tabular-nums;
	position: relative;
}
.afb-cal__day.is-available { color: var(--afb-ink); cursor: pointer; font-weight: 600; }
.afb-cal__day.is-available::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 4px;
	width: 4px;
	height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background: var(--afb-primary);
	opacity: .55;
}
.afb-cal__day.is-available:hover { background: var(--afb-light); color: var(--afb-primary-dark); }
.afb-cal__day.is-today { box-shadow: inset 0 0 0 1px var(--afb-line-2); }
.afb-cal__day.is-selected,
.afb-cal__day.is-selected:hover {
	background: var(--afb-primary);
	color: #fff;
	box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--afb-primary) 60%, transparent);
}
.afb-cal__day.is-selected::after { background: #fff; }
.afb-cal__day.is-past { text-decoration: none; opacity: .6; }

/* Tijdsloten */
.afb-slots {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
}
.afb-slots > p { grid-column: 1 / -1; }
.afb-slot {
	min-height: 40px;
	padding: 0 6px;
	border: 1px solid var(--afb-line-2);
	border-radius: 8px;
	background: #fff;
	color: var(--afb-ink);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	font-variant-numeric: tabular-nums;
	transition: all .15s;
}
.afb-slot:hover { border-color: var(--afb-primary); color: var(--afb-primary-dark); background: var(--afb-soft); }
.afb-slot.is-selected {
	background: var(--afb-primary);
	border-color: var(--afb-primary);
	color: #fff;
	font-weight: 600;
	box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--afb-primary) 60%, transparent);
}
.afb-loading::before {
	content: "";
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-right: 8px;
	border: 2px solid var(--afb-lavender);
	border-top-color: var(--afb-primary);
	border-radius: 50%;
	vertical-align: -1px;
	animation: afb-spin .7s linear infinite;
}
@keyframes afb-spin { to { transform: rotate(360deg); } }

/* Radio/checkbox */
.afb-radio, .afb-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid var(--afb-line);
	border-radius: var(--afb-radius-sm);
	margin-bottom: 8px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.4;
}
.afb-check { border: 0; padding: 4px 0; }
.afb-radio:has(input:checked) { border-color: var(--afb-primary); background: var(--afb-soft); }
.afb-radio input, .afb-check input {
	accent-color: var(--afb-primary);
	width: 18px;
	height: 18px;
	margin: 0;
	flex: 0 0 18px;
}
.afb-terms { margin: 14px 0 6px; font-size: 13.5px; }
.afb-terms summary { cursor: pointer; color: var(--afb-primary-dark); font-weight: 600; }
.afb-terms__body { margin-top: 8px; color: var(--afb-ink-2); max-height: 180px; overflow: auto; padding: 10px 12px; background: var(--afb-soft); border-radius: 8px; }
.afb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Samenvatting & meldingen */
.afb-summary {
	margin: 0 0 12px !important;
	padding: 10px 14px;
	border-radius: var(--afb-radius-sm);
	background: var(--afb-light);
	color: var(--afb-primary-dark);
	font-weight: 600;
	font-size: 14px;
}
.afb-summary::first-letter { text-transform: uppercase; }
.afb-alert {
	padding: 11px 14px;
	border-radius: var(--afb-radius-sm);
	font-size: 14px;
	margin: 0 0 12px !important;
	border: 1px solid transparent;
}
.afb-alert--error { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.afb-alert--success { background: #F0FDF4; color: #166534; border-color: #BBF7D0; }

/* Knoppen */
.afb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 44px;
	padding: 10px 20px;
	border-radius: 10px;
	border: 1px solid transparent;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
	white-space: nowrap;
}
.afb-btn:focus-visible, .afb-slot:focus-visible, .afb-cal__day:focus-visible, .afb-cal__nav:focus-visible, .afb-chip:focus-visible, .afb-dropdown summary:focus-visible {
	outline: 0;
	box-shadow: var(--afb-focus);
}
.afb-btn:active:not(:disabled) { transform: translateY(1px); }
.afb-btn--block { display: flex; width: 100%; }
.afb-btn--lg { min-height: 52px; font-size: 16px; border-radius: 12px; }
.afb-btn--sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
.afb-btn--primary {
	background: linear-gradient(180deg, var(--afb-primary), var(--afb-primary-dark));
	color: #fff !important;
	box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--afb-primary) 80%, transparent);
}
.afb-btn--primary:hover:not(:disabled) { background: var(--afb-primary-dark); }
.afb-btn--primary:disabled { background: #CBB7DE; box-shadow: none; cursor: not-allowed; }
.afb-btn--outline { background: #fff; color: var(--afb-primary-dark) !important; border-color: var(--afb-primary); }
.afb-btn--outline:hover { background: var(--afb-light); }
.afb-btn--ghost { background: #fff; color: var(--afb-ink) !important; border-color: var(--afb-line-2); }
.afb-btn--ghost:hover { border-color: var(--afb-ink-2); }
.afb-btn--danger { background: #fff; color: var(--afb-red) !important; border-color: #FCA5A5; }
.afb-btn--danger:hover { background: #FEF2F2; }
.afb-btn.is-busy::after {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: afb-spin .7s linear infinite;
}
.afb-btn.is-busy svg { display: none; }

/* ============ Scherm 2: bevestiging ============ */
.afb-confirm {
	max-width: 520px;
	margin: 0 auto;
	text-align: center;
	padding: 34px 28px 28px;
	outline: 0;
}
.afb-confirm__badge {
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: var(--afb-green);
	color: #fff;
	box-shadow: 0 0 0 8px #DCFCE7;
	animation: afb-pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.afb-confirm--pending .afb-confirm__badge { background: var(--afb-orange); box-shadow: 0 0 0 8px #FEF3C7; }
.afb-confirm--cancelled .afb-confirm__badge { background: #9CA3AF; box-shadow: 0 0 0 8px #F3F4F6; }
.afb-confirm__badge--soft { background: var(--afb-light); color: var(--afb-primary); box-shadow: 0 0 0 8px var(--afb-soft); }
@keyframes afb-pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.afb-confirm__title { font-size: 25px; font-weight: 700; color: var(--afb-navy); line-height: 1.25; letter-spacing: -.01em; }
.afb-confirm__text { margin: 8px auto 22px !important; color: var(--afb-ink-2); max-width: 340px; }
.afb-confirm__rows {
	list-style: none;
	margin: 0 0 18px;
	padding: 4px 16px;
	background: #F7F1FD;
	border: 1px solid var(--afb-lavender);
	border-radius: 12px;
	text-align: left;
}
.afb-confirm__row {
	display: grid;
	grid-template-columns: minmax(96px, auto) 1fr;
	align-items: start;
	gap: 10px;
	padding: 12px 0;
	border-bottom: 1px solid var(--afb-line);
	font-size: 14.5px;
	line-height: 20px;
}
.afb-confirm__row:last-child { border-bottom: 0; }
.afb-confirm__row dt { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--afb-ink); }
.afb-confirm__row dt svg { color: var(--afb-ink); }
.afb-confirm__row dd { color: var(--afb-ink); }
.afb-confirm__ref { font-size: 13px; color: var(--afb-muted); margin-bottom: 16px !important; }
.afb-confirm__actions { display: grid; gap: 10px; }
.afb-dropdown { position: relative; }
.afb-dropdown summary { list-style: none; }
.afb-dropdown summary::-webkit-details-marker { display: none; }
.afb-dropdown__menu {
	position: absolute;
	z-index: 20;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	background: #fff;
	border: 1px solid var(--afb-line);
	border-radius: 12px;
	box-shadow: var(--afb-shadow);
	padding: 6px;
	text-align: left;
	animation: afb-in .15s ease both;
}
.afb-dropdown__menu a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	color: var(--afb-ink) !important;
	text-decoration: none !important;
	font-size: 14.5px;
	font-weight: 500;
}
.afb-dropdown__menu a:hover, .afb-dropdown__menu a:focus-visible { background: var(--afb-light); color: var(--afb-primary-dark) !important; outline: 0; }

/* ============ Beheer & portaal ============ */
.afb-manage, .afb-portal { max-width: 760px; margin: 0 auto; }
.afb-manage__wrap { display: grid; gap: 16px; }
.afb-manage__actions { max-width: 520px; width: 100%; margin: 0 auto; padding: 20px; }
.afb-manage__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.afb-manage__buttons .afb-btn { flex: 1 1 180px; }
.afb-manage__reschedule { margin-top: 18px; display: grid; gap: 14px; }
.afb-manage__reschedule .afb-cal, .afb-manage__reschedule .afb-slots { max-width: none; }
.afb-portal .afb-card { margin-bottom: 16px; }
.afb-portal__head { margin-bottom: 18px; }
.afb-portal__login { max-width: 440px; margin: 0 auto; text-align: center; }
.afb-portal__login .afb-field { text-align: left; margin-bottom: 14px; }
.afb-list { list-style: none; margin: 0; padding: 0; }
.afb-list__item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid var(--afb-line);
	margin: 0;
}
.afb-list__item:last-child { border-bottom: 0; }
.afb-list__date {
	flex: 0 0 58px;
	text-align: center;
	background: var(--afb-light);
	color: var(--afb-primary-dark);
	border-radius: 10px;
	padding: 6px 4px;
	font-weight: 700;
	line-height: 1.15;
	font-size: 12px;
	text-transform: uppercase;
}
.afb-list__date strong { display: block; font-size: 20px; }
.afb-list__body { flex: 1; min-width: 0; font-size: 14px; }
.afb-list__body strong { display: block; font-size: 15px; }
.afb-list--compact .afb-list__item { padding: 10px 0; }
.afb-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: #F3F4F6;
	color: #4B5563;
	white-space: nowrap;
}
.afb-badge--confirmed, .afb-badge--completed { background: #DCFCE7; color: #15803D; }
.afb-badge--pending, .afb-badge--awaiting_payment { background: #FEF3C7; color: #B45309; }
.afb-badge--cancelled, .afb-badge--no_show { background: #FEE2E2; color: #B91C1C; }
.afb-empty { text-align: center; color: var(--afb-muted); }

/* ============ Responsief ============ */
@media (max-width: 1023px) {
	.afb-booking--with-image { grid-template-columns: minmax(0, 40fr) minmax(0, 60fr); gap: 18px; }
}
@media (max-width: 767px) {
	.afb-booking .afb-booking__media, .afb-booking.is-done .afb-booking__media { position: relative; top: 0; height: auto; min-height: 0; }
	.afb-booking--with-image {
		grid-template-columns: 1fr;
		padding: 10px;
		gap: 4px;
	}
	.afb-booking__media { min-height: 0; aspect-ratio: 16 / 7; }
	.afb-booking--with-image .afb-booking__card { padding: 16px 8px 8px; }
	.afb-cal, .afb-slots { max-width: none; }
	.afb-title { font-size: 23px; }
}
@media (max-width: 479px) {
	.afb { font-size: 14.5px; }
	.afb-card { padding: 20px 16px; }
	.afb-grid { grid-template-columns: 1fr; }
	.afb-booking__media { aspect-ratio: 16 / 8; }
	.afb-cal { padding: 8px 6px; }
	.afb-cal__day { height: 38px; font-size: 13.5px; }
	.afb-slots { gap: 6px; }
	.afb-confirm { padding: 26px 16px 18px; }
	.afb-confirm__title { font-size: 21px; }
	.afb-confirm__rows { padding: 2px 12px; }
	.afb-confirm__row { grid-template-columns: 1fr; gap: 2px; }
	.afb-confirm__row dd { padding-left: 30px; }
	.afb-btn--lg { font-size: 15px; }
}
@media (max-width: 339px) {
	.afb-select select { font-size: 14px; padding-left: 36px; }
	.afb-select__icon { left: 11px; }
	.afb-cal__grid { gap: 1px; }
	.afb-cal__day { height: 34px; }
	.afb-step__title { font-size: 14.5px !important; }
}
@media (prefers-reduced-motion: reduce) {
	.afb *, .afb *::before, .afb *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
