.bonfw-modal {
	--bonfw-accent: #ec8639;
	--bonfw-accent-hover: #ff9b52;
	--bonfw-surface: #171717;
	--bonfw-surface-strong: #101010;
	--bonfw-surface-muted: #242424;
	--bonfw-border: rgba( 236, 134, 57, 0.22 );
	--bonfw-text: #f5f5f5;
	--bonfw-text-muted: #c7c7c7;
	--bonfw-shadow: 0 1.75rem 3.5rem rgba( 0, 0, 0, 0.45 );
	position: fixed;
	inset: 0;
	z-index: 99999;
}

.bonfw-modal[hidden] {
	display: none !important;
}

.bonfw-modal__backdrop {
	position: absolute;
	inset: 0;
	background:
		radial-gradient( circle at top, rgba( 236, 134, 57, 0.12 ), transparent 32% ),
		rgba( 0, 0, 0, 0.72 );
	backdrop-filter: blur( 4px );
}

.bonfw-modal__dialog {
	position: relative;
	width: min( 92vw, 34rem );
	margin: 10vh auto 0;
	padding: 1.5rem;
	border-radius: 1rem;
	border: 1px solid var( --bonfw-border );
	background:
		linear-gradient( 180deg, rgba( 236, 134, 57, 0.08 ) 0%, rgba( 236, 134, 57, 0 ) 18% ),
		linear-gradient( 180deg, var( --bonfw-surface ) 0%, var( --bonfw-surface-strong ) 100% );
	box-shadow: var( --bonfw-shadow );
	color: var( --bonfw-text );
}

.bonfw-modal__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	border: 0;
	background: transparent;
	color: var( --bonfw-text-muted );
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	transition: color 0.18s ease, transform 0.18s ease;
}

.bonfw-modal__close:hover,
.bonfw-modal__close:focus-visible {
	color: var( --bonfw-accent );
	transform: scale( 1.04 );
	outline: none;
}

.bonfw-modal__title {
	margin: 0 2rem 0.75rem 0;
	font-size: 1.4rem;
	line-height: 1.2;
	color: #fff4eb;
}

.bonfw-modal__message {
	margin: 0 0 1rem;
	line-height: 1.55;
	color: var( --bonfw-text-muted );
}

.bonfw-modal__checkbox {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	padding: 0.95rem 1rem;
	margin-bottom: 1.25rem;
	border: 1px solid rgba( 255, 255, 255, 0.07 );
	border-radius: 0.85rem;
	background: var( --bonfw-surface-muted );
	line-height: 1.45;
	color: var( --bonfw-text );
}

.bonfw-modal__checkbox-input {
	margin-top: 0.2rem;
	accent-color: var( --bonfw-accent );
}

.bonfw-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: flex-end;
}

.bonfw-modal__confirm[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

.bonfw-modal .button {
	min-height: 2.9rem;
	padding: 0.78rem 1.15rem;
	border: 1px solid transparent;
	border-radius: 0.8rem;
	box-shadow: none;
	text-shadow: none;
	font-weight: 600;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.bonfw-modal__cancel.button {
	border-color: rgba( 255, 255, 255, 0.1 );
	background: transparent;
	color: var( --bonfw-text );
}

.bonfw-modal__cancel.button:hover,
.bonfw-modal__cancel.button:focus-visible {
	border-color: rgba( 236, 134, 57, 0.42 );
	background: rgba( 236, 134, 57, 0.08 );
	color: #fff4eb;
	outline: none;
}

.bonfw-modal__confirm.button,
.bonfw-modal__confirm.button.alt {
	border-color: var( --bonfw-accent );
	background: var( --bonfw-accent );
	color: #121212;
}

.bonfw-modal__confirm.button:hover,
.bonfw-modal__confirm.button:focus-visible,
.bonfw-modal__confirm.button.alt:hover,
.bonfw-modal__confirm.button.alt:focus-visible {
	border-color: var( --bonfw-accent-hover );
	background: var( --bonfw-accent-hover );
	color: #121212;
	outline: none;
}

.bonfw-modal .button:not( [disabled] ):hover {
	transform: translateY( -1px );
}

.bonfw-modal .button:focus-visible,
.bonfw-modal__checkbox-input:focus-visible {
	outline: 2px solid rgba( 236, 134, 57, 0.85 );
	outline-offset: 2px;
}

@media ( max-width: 640px ) {
	.bonfw-modal__dialog {
		margin-top: 5vh;
		padding: 1.25rem;
	}

	.bonfw-modal__actions {
		flex-direction: column-reverse;
	}

	.bonfw-modal__actions .button {
		width: 100%;
		text-align: center;
	}
}
