.brf {
	--brf-ink: #002662;
	--brf-muted: #566b92;
	--brf-brand: #00aeef;
	--brf-brand-dark: #0a3a85;
	--brf-tint: #e6f6fd;
	--brf-line: #cddbec;
	--brf-surface: #ffffff;
	--brf-error: #b42318;
	--brf-error-bg: #fdecea;

	box-sizing: border-box;
	position: relative;
	display: block;
	width: 100%;
	max-width: 640px;
	margin: 2rem auto;
	padding: 2rem;
	background: var(--brf-surface);
	border: 1px solid var(--brf-line);
	border-top: 6px solid var(--brf-brand);
	border-radius: 18px;
	box-shadow: 0 18px 40px -24px rgba(0, 38, 98, 0.35);
	color: var(--brf-ink);
	font-family: Vazirmatn, Vazir, "IRANSans", "IRANSansX", Tahoma, sans-serif;
	line-height: 1.7;
	text-align: right;
}

.brf *,
.brf *::before,
.brf *::after {
	box-sizing: border-box;
}

.brf__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.1rem 1.25rem;
}

.brf__field--wide {
	grid-column: 1 / -1;
}

.brf__field label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--brf-ink);
}

.brf__field input,
.brf__field select {
	display: block;
	width: 100%;
	height: 3rem;
	margin: 0;
	padding: 0 0.95rem;
	background-color: #f6f9fd;
	border: 1.5px solid var(--brf-line);
	border-radius: 12px;
	color: var(--brf-ink);
	font: inherit;
	font-size: 0.98rem;
	box-shadow: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.brf__field input[type="tel"] {
	text-align: right;
}

.brf__field textarea {
	display: block;
	width: 100%;
	min-height: 7.5rem;
	margin: 0;
	padding: 0.75rem 0.95rem;
	background-color: #f6f9fd;
	border: 1.5px solid var(--brf-line);
	border-radius: 12px;
	color: var(--brf-ink);
	font: inherit;
	font-size: 0.98rem;
	line-height: 1.8;
	resize: vertical;
	box-shadow: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.brf__field textarea:hover {
	border-color: #9cc3e0;
}

.brf__field textarea:focus {
	outline: none;
	background-color: #fff;
	border-color: var(--brf-brand);
	box-shadow: 0 0 0 4px rgba(0, 174, 239, 0.22);
}

.brf__field textarea::placeholder,
.brf__field input::placeholder {
	color: #8a9bb8;
}

.brf__field input:hover,
.brf__field select:hover {
	border-color: #9cc3e0;
}

.brf__field input:focus,
.brf__field select:focus {
	outline: none;
	background-color: #fff;
	border-color: var(--brf-brand);
	box-shadow: 0 0 0 4px rgba(0, 174, 239, 0.22);
}

.brf__field select {
	appearance: none;
	-webkit-appearance: none;
	padding-left: 2.5rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%2300aeef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 1rem center;
	cursor: pointer;
}

.brf__field select:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.brf__field[hidden] {
	display: none;
}

.brf__field select:invalid {
	color: #8a9bb8;
}

.brf__field select option {
	color: var(--brf-ink);
}

.brf__field.is-invalid input,
.brf__field.is-invalid select {
	border-color: var(--brf-error);
	background-color: var(--brf-error-bg);
}

.brf__field.is-invalid input:focus,
.brf__field.is-invalid select:focus {
	box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.15);
}

.brf__hp {
	position: absolute !important;
	top: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	opacity: 0;
	pointer-events: none;
}

.brf__error {
	margin: 1.1rem 0 0;
	padding: 0.75rem 1rem;
	background: var(--brf-error-bg);
	border-radius: 10px;
	color: var(--brf-error);
	font-size: 0.92rem;
}

.brf__error[hidden],
.brf__success[hidden],
.brf__form[hidden] {
	display: none;
}

.brf__submit {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 3.1rem;
	margin: 1.5rem 0 0;
	padding: 0 1.5rem;
	background: var(--brf-ink);
	border: 0;
	border-radius: 12px;
	color: #fff;
	font: inherit;
	font-size: 1.02rem;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.brf__submit:hover {
	background: var(--brf-brand-dark);
}

.brf__submit:active {
	transform: translateY(1px);
}

.brf__submit:focus-visible {
	outline: 3px solid var(--brf-brand);
	outline-offset: 3px;
}

.brf__submit[disabled] {
	cursor: wait;
	opacity: 0.85;
}

.brf__spinner {
	display: none;
	width: 1.15rem;
	height: 1.15rem;
	margin-right: 0.6rem;
	border: 2.5px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: brf-spin 0.7s linear infinite;
}

.brf.is-loading .brf__spinner {
	display: inline-block;
}

.brf__success {
	padding: 1.5rem 0.5rem;
	text-align: center;
}

.brf__check {
	width: 76px;
	height: 76px;
	margin-bottom: 0.75rem;
}

.brf__check circle {
	stroke: var(--brf-brand);
	stroke-width: 3;
	stroke-dasharray: 151;
	stroke-dashoffset: 151;
	animation: brf-draw 0.6s ease forwards;
}

.brf__check path {
	stroke: var(--brf-brand);
	stroke-width: 4;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 40;
	stroke-dashoffset: 40;
	animation: brf-draw 0.4s ease 0.5s forwards;
}

.brf__success-title {
	margin: 0 0 0.35rem;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--brf-ink);
}

.brf__success-text {
	margin: 0;
	color: var(--brf-muted);
}

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

@keyframes brf-draw {
	to { stroke-dashoffset: 0; }
}

@media (max-width: 560px) {
	.brf {
		margin: 1rem 0;
		padding: 1.4rem 1.1rem;
		border-radius: 14px;
	}

	.brf__grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.brf__check circle,
	.brf__check path {
		animation: none;
		stroke-dashoffset: 0;
	}

	.brf__spinner {
		animation-duration: 1.5s;
	}
}

.brf__captcha-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.6rem;
}

.brf__captcha-img {
	display: block;
	height: 3rem;
	width: auto;
	max-width: calc(100% - 3.6rem);
	background: #f6f9fd;
	border: 1.5px solid var(--brf-line);
	border-radius: 12px;
}

.brf__captcha-refresh {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1.5px solid var(--brf-line);
	border-radius: 12px;
	color: var(--brf-brand);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.brf__captcha-refresh:hover {
	border-color: var(--brf-brand);
	background: var(--brf-tint);
}

.brf__captcha-refresh:focus-visible {
	outline: 3px solid var(--brf-brand);
	outline-offset: 2px;
}

.brf__captcha-refresh svg {
	width: 1.35rem;
	height: 1.35rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.brf__captcha-refresh.is-loading svg {
	animation: brf-spin 0.7s linear infinite;
}
