/* Probleemmelder (zie bug-report.js en inc/frontend/bug-report.php).
   Alles position:fixed: geen invloed op de paginabreedte/-hoogte (geen extra
   scrollbalken). Z-index boven het zijmenu van het thema (100000000). */

.cbr-btn {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9989;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid #d1d5db;
	border-radius: 50%;
	background: #fff;
	color: #4b5563;
	font-size: 19px;
	line-height: 42px;
	text-align: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
	cursor: pointer;
}
.cbr-btn:hover {
	color: var(--civi-color-accent, #1f72f2);
	border-color: var(--civi-color-accent, #1f72f2);
}
/* Naast de ?-knop van de rondleiding (indien aanwezig). */
body:has(.cct-help) .cbr-btn {
	right: 76px;
}
body.civichild-bulk-open .cbr-btn {
	bottom: 96px;
}
/* Publieke pagina's: boven de knop "naar boven" van het thema (#back-to-top,
   40px op 30px van de hoek), mooi in één kolom. */
body:has(#back-to-top):not(.civichild-bulk-open) .cbr-btn {
	right: 28px;
	bottom: 82px;
}
/* Labeltje links van de knop: bij muis (enkel toestellen met muis, anders
   blijft het op gsm hangen na een tik) en bij toetsenbordfocus. */
.cbr-tip {
	position: absolute;
	top: 50%;
	right: calc(100% + 10px);
	padding: 6px 10px;
	border-radius: 6px;
	background: #111827;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	white-space: nowrap;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
	opacity: 0;
	visibility: hidden;
	transform: translate(4px, -50%);
	transition: opacity .15s, transform .15s, visibility .15s;
	pointer-events: none;
}
.cbr-tip::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 100%;
	margin-top: -5px;
	border: 5px solid transparent;
	border-left-color: #111827;
}
.cbr-btn:focus-visible .cbr-tip {
	opacity: 1;
	visibility: visible;
	transform: translate(0, -50%);
}
@media (hover: hover) {
	.cbr-btn:hover .cbr-tip {
		opacity: 1;
		visibility: visible;
		transform: translate(0, -50%);
	}
}
/* Tijdens de rondleiding blijft de knop zichtbaar: de tour wijst ernaar. */
body.cbr-open .cbr-btn {
	display: none;
}

.cbr-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147482000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(17, 24, 39, .55);
}
.cbr-overlay[hidden] {
	display: none;
}
.cbr-dialog {
	position: relative;
	width: 520px;
	max-width: 100%;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	box-sizing: border-box;
	padding: 22px 22px 18px;
	border-radius: 12px;
	background: #fff;
	color: #1f2937;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
	font-size: 15px;
	line-height: 1.5;
}
.cbr-title {
	margin: 0 28px 12px 0;
	font-size: 19px;
	font-weight: 700;
	color: inherit;
}
.cbr-intro {
	margin: 0 0 14px;
	color: #4b5563;
}
.cbr-close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: none;
	color: #6b7280;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}
.cbr-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
}
.cbr-desc,
.cbr-email {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font: inherit;
	resize: vertical;
}
.cbr-email {
	height: auto;
	margin-bottom: 0;
}
.cbr-desc + .cbr-label {
	margin-top: 14px;
}
.cbr-opt {
	font-weight: 400;
	color: #6b7280;
}
/* Lokveld voor bots. */
.cbr-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
}
.cbr-shot {
	margin-top: 14px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
}
.cbr-capture,
.cbr-file-label,
.cbr-remove,
.cbr-cancel {
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	color: #374151;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.cbr-capture,
.cbr-file-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-sizing: border-box;
	line-height: 1.2;
}
.cbr-file-label {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	box-sizing: border-box;
}
/* Native bestandsknop (Engelstalig) verbergen; het label is de knop. */
.cbr-file {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
}
.cbr-file-label:focus-within {
	outline: 2px solid var(--civi-color-accent, #1f72f2);
	outline-offset: 2px;
}
.cbr-hint,
.cbr-note {
	flex-basis: 100%;
	margin: 0;
	font-size: 13px;
	color: #6b7280;
}
.cbr-note {
	margin-top: 14px;
}
.cbr-preview {
	flex-basis: 100%;
	display: flex;
	align-items: flex-start;
	gap: 12px;
}
.cbr-preview[hidden] {
	display: none;
}
.cbr-preview img {
	max-width: 220px;
	max-height: 140px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
}
.cbr-msg {
	min-height: 1.5em;
	margin: 10px 0 0;
	font-size: 14px;
}
.cbr-msg.is-error {
	color: #b42318;
}
.cbr-msg.is-ok {
	color: #2e7d32;
}
.cbr-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 12px;
}
.cbr-send {
	min-height: 36px;
	padding: 6px 18px;
	border: 1px solid var(--civi-color-accent, #1f72f2);
	border-radius: 6px;
	background: var(--civi-color-accent, #1f72f2);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.cbr-send:disabled {
	opacity: .6;
	cursor: wait;
}
.cbr-btn:focus-visible,
.cbr-dialog button:focus-visible,
.cbr-desc:focus-visible,
.cbr-email:focus-visible {
	outline: 2px solid var(--civi-color-accent, #1f72f2);
	outline-offset: 2px;
}
@media (max-width: 600px) {
	.cbr-btn {
		right: 12px;
		bottom: 12px;
	}
	body:has(.cct-help) .cbr-btn {
		right: 64px;
	}
	body:has(#back-to-top):not(.civichild-bulk-open) .cbr-btn {
		right: 28px;
		bottom: 82px;
	}
	body.civichild-bulk-open .cbr-btn {
		bottom: 150px;
	}
}
