.app-form-flash-wrap {
	width: var(--flash-max-width, fit-content);
	max-width: min(auto, calc(100vw - 16px));
}

.app-form-flash-wrap--fixed {
	position: fixed;
	top: var(--flash-top, 12px);
	right: var(--flash-right, 12px);
	z-index: 1060;
	pointer-events: none;
}

.app-form-flash-wrap--local {
	margin-bottom: 1rem;
}

.app-form-flash {
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 10px 14px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 18px;
	color: #f7f4ea;
	background:
		radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 34%),
		linear-gradient(160deg, rgba(14, 18, 28, 0.98), rgba(20, 28, 40, 0.94) 55%, rgba(10, 14, 22, 0.98));
	box-shadow:
		0 18px 40px rgba(0, 0, 0, 0.28),
		0 0 0 1px rgba(255, 255, 255, 0.04) inset,
		0 10px 30px var(--flash-glow, rgba(89, 168, 255, 0.14));
	overflow: hidden;
	pointer-events: auto;
	transform-origin: top right;
	animation: app-form-flash-enter 0.28s ease;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.app-form-flash::after {
	content: '';
	position: absolute;
	inset: auto -10% -45% 28%;
	height: 90px;
	background: radial-gradient(circle, var(--flash-glow-soft, rgba(89, 168, 255, 0.18)), transparent 65%);
	pointer-events: none;
}

.app-form-flash::before {
	content: '';
	position: absolute;
	inset: 0 auto 0 0;
	width: 4px;
	background: var(--flash-accent, #6ea8fe);
}

.app-form-flash--success {
	--flash-accent: #27c281;
	--flash-tint: rgba(39, 194, 129, 0.24);
	--flash-glow: rgba(39, 194, 129, 0.18);
	--flash-glow-soft: rgba(39, 194, 129, 0.22);
}

.app-form-flash--danger {
	--flash-accent: #ff6b6b;
	--flash-tint: rgba(255, 107, 107, 0.24);
	--flash-glow: rgba(255, 107, 107, 0.2);
	--flash-glow-soft: rgba(255, 107, 107, 0.24);
}

.app-form-flash--warning {
	--flash-accent: #ffbe3b;
	--flash-tint: rgba(255, 190, 59, 0.24);
	--flash-glow: rgba(255, 190, 59, 0.18);
	--flash-glow-soft: rgba(255, 190, 59, 0.22);
}

.app-form-flash--info {
	--flash-accent: #59a8ff;
	--flash-tint: rgba(89, 168, 255, 0.24);
	--flash-glow: rgba(89, 168, 255, 0.18);
	--flash-glow-soft: rgba(89, 168, 255, 0.22);
}

.app-form-flash-wrap--local .app-form-flash {
	border-radius: 16px;
	padding: 12px 14px 14px;
	box-shadow:
		0 10px 24px rgba(0, 0, 0, 0.2),
		0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.app-form-flash-wrap--local .app-form-flash::after {
	inset: auto -8% -52% 38%;
	height: 72px;
}

.app-form-flash__icon {
	position: relative;
	width: 42px;
	height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 14px;
	background:
		radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 34%),
		linear-gradient(135deg, var(--flash-tint, rgba(255, 255, 255, 0.14)), rgba(255, 255, 255, 0.08));
	color: var(--flash-accent, #6ea8fe);
	font-size: 1.1rem;
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.08),
		0 10px 24px rgba(0, 0, 0, 0.16);
}

.app-form-flash__icon::after {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: 18px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	opacity: 0.8;
}

.app-form-flash__content {
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	overflow: hidden;
}

.app-form-flash__title {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 24px;
	padding: 0 10px;
	border-radius: 999px;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 248, 235, 0.86);
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
	margin-bottom: 0;
	flex-shrink: 0;
}

.app-form-flash__message {
	font-size: 0.95rem;
	line-height: 1.4;
	color: #fff8ef;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.app-form-flash__actions {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	margin-top: 12px;
}

.app-form-flash__action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 34px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: linear-gradient(135deg, var(--flash-tint, rgba(255, 255, 255, 0.14)), rgba(255, 255, 255, 0.08));
	color: #fffdf7;
	text-decoration: none;
	font-size: 0.88rem;
	font-weight: 600;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
	transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.app-form-flash__action:hover,
.app-form-flash__action:focus {
	color: #ffffff;
	text-decoration: none;
	transform: translateY(-1px);
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
	border-color: rgba(255, 255, 255, 0.18);
	outline: none;
}

.app-form-flash__close {
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
	color: rgba(255, 248, 235, 0.75);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.app-form-flash__close:hover,
.app-form-flash__close:focus {
	background: rgba(255, 255, 255, 0.16);
	color: #ffffff;
	outline: none;
	transform: translateY(-1px);
}

.app-form-flash__progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(255, 255, 255, 0.06);
	overflow: hidden;
}

.app-form-flash__progress-bar {
	width: 100%;
	height: 100%;
	transform-origin: left center;
	background: linear-gradient(90deg, var(--flash-accent, #6ea8fe), rgba(255, 255, 255, 0.75));
	animation: app-form-flash-progress linear forwards;
	animation-duration: var(--flash-duration, 3500ms);
}

.app-form-flash-wrap--local .app-form-flash__icon {
	width: 38px;
	height: 38px;
	border-radius: 13px;
	font-size: 1rem;
}

.app-form-flash-wrap--local .app-form-flash__title {
	min-height: 22px;
	font-size: 0.71rem;
	padding: 0 9px;
}

.app-form-flash-wrap--local .app-form-flash__message {
	font-size: 0.93rem;
}

.app-form-flash.is-closing {
	opacity: 0;
	transform: translateY(-8px) scale(0.985);
	transition: opacity 0.24s ease, transform 0.24s ease;
}

@keyframes app-form-flash-enter {
	from {
		opacity: 0;
		transform: translateY(-10px) scale(0.985);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes app-form-flash-progress {
	from {
		transform: scaleX(1);
	}
	to {
		transform: scaleX(0);
	}
}

@media (max-width: 576px) {
	.app-form-flash-wrap--fixed {
		left: 14px;
		right: 14px;
		width: auto;
	}

	.app-form-flash {
		grid-template-columns: auto 1fr;
	}

	.app-form-flash__close {
		grid-column: 2;
		justify-self: end;
		margin-top: -4px;
	}
}
