/* -------------------------------------------------------------
   Interaction feedback: toast messages, busy forms, saved record
   highlight. Loaded after portal.css.
   ------------------------------------------------------------- */

.fhc-toasts {
	position: fixed;
	z-index: 99999;
	right: clamp(12px, 3vw, 28px);
	bottom: clamp(12px, 3vw, 28px);
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: min(380px, calc(100vw - 24px));
	pointer-events: none;
}

.fhc-toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 13px 14px;
	border-radius: var(--fhc-radius-sm, 10px);
	background: var(--fhc-white, #fff);
	color: var(--fhc-text, #101828);
	border: 1px solid var(--fhc-border, #e6e3e6);
	border-left: 4px solid var(--fhc-primary, #f2789f);
	box-shadow: var(--fhc-shadow-lg, 0 26px 70px rgba(12, 35, 64, .16));
	font-size: .95rem;
	line-height: 1.4;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .22s ease, transform .22s ease;
	pointer-events: auto;
}

.fhc-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.fhc-toast.is-leaving {
	opacity: 0;
	transform: translateY(8px);
}

.fhc-toast__text {
	flex: 1 1 auto;
}

.fhc-toast__text p {
	margin: 0;
}

.fhc-toast__icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-top: 1px;
	border-radius: 50%;
	background: var(--fhc-primary, #f2789f);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

.fhc-toast__close {
	flex: 0 0 auto;
	padding: 0 2px;
	border: 0;
	background: none;
	color: var(--fhc-muted, #5b6472);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.fhc-toast__close:hover {
	color: var(--fhc-text, #101828);
}

.fhc-toast--success {
	border-left-color: #16a34a;
}

.fhc-toast--success .fhc-toast__icon {
	background: #16a34a;
}

.fhc-toast--success .fhc-toast__icon::before {
	content: "\2713";
}

.fhc-toast--error {
	border-left-color: #dc2626;
}

.fhc-toast--error .fhc-toast__icon {
	background: #dc2626;
}

.fhc-toast--error .fhc-toast__icon::before {
	content: "!";
}

.fhc-toast--info .fhc-toast__icon::before {
	content: "i";
}

.fhc-toast--pending {
	border-left-color: var(--fhc-dark-soft, #274063);
}

.fhc-toast--pending .fhc-toast__icon {
	background: none;
	border: 2px solid var(--fhc-border, #e6e3e6);
	border-top-color: var(--fhc-primary, #f2789f);
	animation: fhc-spin .7s linear infinite;
}

@keyframes fhc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Busy forms ------------------------------------------------- */

form.is-fhc-busy {
	position: relative;
	opacity: .75;
}

form.is-fhc-busy::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--fhc-radius-sm, 10px);
	background: rgba(255, 255, 255, .25);
	cursor: progress;
}

form.is-fhc-busy button.is-loading::before {
	content: "";
	display: inline-block;
	width: 13px;
	height: 13px;
	margin-right: 8px;
	vertical-align: -2px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: fhc-spin .7s linear infinite;
}

/* Just-saved record highlight -------------------------------- */

.is-fhc-flash {
	animation: fhc-flash 1.6s ease;
}

@keyframes fhc-flash {
	0% {
		box-shadow: 0 0 0 0 rgba(var(--fhc-primary-rgb, 242, 120, 159), .55);
	}

	40% {
		box-shadow: 0 0 0 6px rgba(var(--fhc-primary-rgb, 242, 120, 159), .22);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(var(--fhc-primary-rgb, 242, 120, 159), 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fhc-toast,
	.is-fhc-flash,
	.fhc-toast--pending .fhc-toast__icon,
	form.is-fhc-busy button.is-loading::before {
		transition: none;
		animation: none;
	}
}
