/* Alyatim donation modal — scoped to .alyatim-donation to avoid bleed. */

.alyatim-donation {
	position: relative;
	font-family: inherit;
	color: #1f2937;
}

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

.alyatim-donation__header {
	text-align: center;
	margin-bottom: 1rem;
}

.alyatim-donation__title {
	font-size: 1.35rem;
	font-weight: 700;
	color: #111827;
	margin: 0 0 0.25rem;
}

.alyatim-donation__subtitle {
	font-size: 0.9rem;
	color: #6b7280;
	margin: 0;
}

.alyatim-donation__section {
	border: 1px solid #eef2f7;
	border-radius: 12px;
	padding: 1rem;
	margin-bottom: 1rem;
	background: #fafbfc;
}

.alyatim-donation__legend {
	font-size: 0.85rem;
	font-weight: 700;
	color: #34C759;
	padding: 0 0.5rem;
	margin: 0;
}

.alyatim-donation__row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem;
	margin-top: 0.75rem;
}

@media (min-width: 576px) {
	.alyatim-donation__row--2 {
		grid-template-columns: 1fr 1fr;
	}
}

.alyatim-donation__field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.alyatim-donation__field label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #374151;
	margin: 0;
}

.alyatim-donation .ad-req {
	color: #ef4444;
	font-weight: 700;
}

.alyatim-donation__field input,
.alyatim-donation__field select,
.alyatim-donation__field textarea {
	width: 100%;
	font-size: 0.95rem;
	font-family: inherit;
	color: #111827;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 0.55rem 0.75rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	outline: none;
}

.alyatim-donation__field input:focus,
.alyatim-donation__field select:focus,
.alyatim-donation__field textarea:focus {
	border-color: #34C759;
	box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.15);
}

.alyatim-donation__field input.is-invalid,
.alyatim-donation__field select.is-invalid,
.alyatim-donation__field textarea.is-invalid {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.alyatim-donation__field textarea {
	resize: vertical;
	min-height: 80px;
}

.alyatim-donation__phone {
	display: flex;
	align-items: stretch;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}

.alyatim-donation__phone:focus-within {
	border-color: #34C759;
	box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.15);
}

.alyatim-donation__phone-code {
	padding: 0.55rem 0.75rem;
	background: #f3f4f6;
	color: #374151;
	font-weight: 600;
	font-size: 0.9rem;
	min-width: 64px;
	text-align: center;
	border-inline-end: 1px solid #e5e7eb;
}

.alyatim-donation__phone input {
	border: none;
	border-radius: 0;
	flex: 1;
}

.alyatim-donation__phone input:focus {
	box-shadow: none;
}

.alyatim-donation__amount {
	display: flex;
	align-items: stretch;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}

.alyatim-donation__amount:focus-within {
	border-color: #34C759;
	box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.15);
}

.alyatim-donation__amount input {
	border: none;
	border-radius: 0;
	flex: 1;
}

.alyatim-donation__amount input:focus {
	box-shadow: none;
}

.alyatim-donation__currency {
	padding: 0.55rem 0.85rem;
	background: #f3f4f6;
	color: #374151;
	font-weight: 700;
	font-size: 0.9rem;
	display: flex;
	align-items: center;
	border-inline-start: 1px solid #e5e7eb;
}

.alyatim-donation__hint {
	font-size: 0.78rem;
	color: #6b7280;
}

.alyatim-donation__target-hint {
	margin: 0.75rem 0 0;
	font-size: 0.82rem;
	color: #6b7280;
	background: #f3f4f6;
	border-radius: 8px;
	padding: 0.5rem 0.75rem;
}

.alyatim-donation__field select:disabled {
	background: #f3f4f6;
	cursor: not-allowed;
	opacity: 0.85;
}

.alyatim-donation__error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 0.65rem 0.85rem;
	font-size: 0.88rem;
	margin: 0.5rem 0 0.75rem;
}

.alyatim-donation__actions {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

@media (min-width: 768px) {
	.alyatim-donation__actions {
		grid-template-columns: repeat(3, 1fr);
	}
}

.alyatim-donation__btn {
	appearance: none;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	padding: 0.75rem 1rem;
	border-radius: 10px;
	transition: transform 0.05s ease, opacity 0.15s ease, box-shadow 0.15s ease;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	line-height: 1.2;
	text-decoration: none;
}

.alyatim-donation__btn:active {
	transform: translateY(1px);
}

.alyatim-donation__btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.alyatim-donation__btn--hyperpay {
	background: #34C759;
}

.alyatim-donation__btn--hyperpay:hover:not(:disabled) {
	background: #2eb350;
}

.alyatim-donation__btn--zaincash {
	background: #6E2B8B;
}

.alyatim-donation__btn--zaincash:hover:not(:disabled) {
	background: #5b2374;
}

.alyatim-donation__btn--representative {
	background: #F2A007;
}

.alyatim-donation__btn--representative:hover:not(:disabled) {
	background: #d68a04;
}

.alyatim-donation__btn--ghost {
	background: transparent;
	color: #374151;
	border: 1px solid #d1d5db;
	margin-top: 1rem;
}

.alyatim-donation__btn--ghost:hover {
	background: #f3f4f6;
}

/* Panels (post-submit states) */

.alyatim-donation__panel {
	padding: 1rem;
	text-align: center;
}

.alyatim-donation__panel h4 {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 0.5rem;
	color: #111827;
}

.alyatim-donation__panel p {
	color: #4b5563;
	margin: 0 0 1rem;
}

.alyatim-donation__summary {
	background: #f9fafb;
	border: 1px solid #eef2f7;
	border-radius: 10px;
	padding: 0.75rem 1rem;
	text-align: start;
	margin-bottom: 1rem;
	font-size: 0.9rem;
}

.alyatim-donation__summary p {
	margin: 0.25rem 0;
	color: #374151;
}

.alyatim-donation__qr {
	display: flex;
	justify-content: center;
	margin: 1rem 0;
}

.alyatim-donation__qr > div > img,
.alyatim-donation__qr > div > canvas {
	border-radius: 12px;
	padding: 10px;
	background: #fff;
	border: 1px solid #eef2f7;
}

.alyatim-donation__reference {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	margin: 0.5rem 0;
	font-size: 0.95rem;
}

.alyatim-donation__reference-label {
	font-weight: 600;
	color: #6b7280;
}

.alyatim-donation__reference-value {
	font-weight: 700;
	color: #111827;
	background: #f3f4f6;
	padding: 0.25rem 0.6rem;
	border-radius: 6px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.alyatim-donation__check {
	display: flex;
	justify-content: center;
	margin-bottom: 0.5rem;
}

/* Loading overlay */

.alyatim-donation__loading {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.85);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	border-radius: inherit;
	z-index: 5;
}

.alyatim-donation__loading[hidden] {
	display: none;
}

.alyatim-donation__spinner {
	width: 38px;
	height: 38px;
	border: 3px solid #e5e7eb;
	border-top-color: #34C759;
	border-radius: 50%;
	animation: alyatim-donation-spin 0.8s linear infinite;
}

.alyatim-donation__loading-text {
	font-size: 0.9rem;
	color: #374151;
	font-weight: 600;
}

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

/* Modal-specific tweaks — the modal-dialog needs to be a bit wider */

#donation-modal .modal-dialog {
	max-width: 720px;
}

#donation-modal .modal-content {
	border-radius: 16px;
	background-color: #ffffff;
}

/* Override the legacy 85px padding from style.css. Selector specificity here
   matches the legacy rule (1 ID + 2 classes) so our value wins through order. */
#donation-modal .modal-content .modal-body {
	padding: 1rem 1.25rem 1.25rem;
}

@media (max-width: 575.98px) {
	.alyatim-donation__header {
		text-align: center;
	}

	#donation-modal .modal-content .modal-body {
		padding: 0.75rem;
	}

	.alyatim-donation__section {
		padding: 0.75rem;
	}
}
