.sapi-widget {
	direction: rtl;
	text-align: right;
	font-family: inherit;
	max-width: 460px;
}

.sapi-widget .sapi-card {
	background: #ffffff;
	border-radius: 20px;
	padding: 32px;
	box-shadow: 0 12px 32px rgba(79, 70, 229, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
	position: relative;
	overflow: hidden;
}

.sapi-widget .sapi-card::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 5px;
	background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
}

.sapi-widget .sapi-field {
	margin-bottom: 18px;
}

.sapi-widget .sapi-field label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #374151;
}

.sapi-widget .sapi-field input {
	width: 100%;
	padding: 13px 16px;
	border: 1.5px solid #e5e7eb;
	border-radius: 12px;
	font-size: 14px;
	box-sizing: border-box;
	background: #f9fafb;
	transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
	outline: none;
}

.sapi-widget .sapi-field input::placeholder {
	color: #9ca3af;
}

.sapi-widget .sapi-field input:focus {
	border-color: #6366f1;
	background: #ffffff;
	box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.sapi-widget .sapi-submit {
	position: relative;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 60%, #ec4899 120%);
	color: #fff;
	border: none;
	padding: 14px 22px;
	border-radius: 12px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 700;
	box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.sapi-widget .sapi-submit:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(99, 102, 241, 0.45);
	filter: brightness(1.05);
}

.sapi-widget .sapi-submit:active {
	transform: translateY(0);
}

.sapi-widget .sapi-submit:disabled {
	opacity: 0.75;
	cursor: not-allowed;
	transform: none;
}

.sapi-widget .sapi-btn-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: sapi-spin 0.7s linear infinite;
}

.sapi-widget.is-loading .sapi-btn-spinner {
	display: inline-block;
}

.sapi-widget.is-loading .sapi-btn-text {
	opacity: 0.85;
}

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

.sapi-widget .sapi-result {
	display: none;
	margin-top: 18px;
	padding: 16px 18px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.9;
	animation: sapi-fade-in 0.35s ease;
}

.sapi-widget .sapi-result.is-visible {
	display: block;
}

@keyframes sapi-fade-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.sapi-widget .sapi-result-success {
	background: #ecfdf5;
	border: 1.5px solid #10b981;
	color: #065f46;
}

.sapi-widget .sapi-result-success::before {
	content: '✓ ';
	font-weight: 800;
}

.sapi-widget .sapi-result-error {
	background: #fef2f2;
	border: 1.5px solid #ef4444;
	color: #991b1b;
}

.sapi-widget .sapi-result-error::before {
	content: '✕ ';
	font-weight: 800;
}

.sapi-widget .sapi-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 4px;
}

.sapi-widget .sapi-table th,
.sapi-widget .sapi-table td {
	padding: 7px 8px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	text-align: right;
	vertical-align: top;
}

.sapi-widget .sapi-table th {
	width: 38%;
	font-weight: 700;
	white-space: nowrap;
}
