/**
 * Frontend styles for NGO Donation Suite.
 * Full-width compatible with page builders (Elementor, Visual Composer, etc.)
 */

/**
 * Frontend styles for NGO Donation Suite.
 * Full-width compatible with page builders (Elementor, Visual Composer, etc.)
 */

/* CSS Variables for easy theming */
:root {
	--sw-primary-color: #2563eb;
	--sw-primary-dark: #1d4ed8;
	--sw-primary-gradient: linear-gradient(135deg, #2563eb, #1d4ed8);
	--sw-hero-gradient: linear-gradient(135deg, #1d60f0, #6f9eff);
	--sw-text-color: #0f172a;
	--sw-text-muted: #475467;
	--sw-border-color: #e4e7ec;
	--sw-bg-light: #f7f9fd;
	--sw-bg-white: #ffffff;
	--sw-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.05);
	--sw-shadow-md: 0 12px 30px rgba(15, 23, 42, 0.08);
	--sw-shadow-lg: 0 25px 60px rgba(15, 23, 42, 0.12);
	--sw-border-radius: 18px;
	--sw-border-radius-sm: 14px;
	--sw-spacing: 30px;
}

/* Custom amount input visibility */
.sw-amount-input-wrapper {
	display: none;
}

.sw-amount-input-wrapper.sw-visible {
	display: block;
}

/* Reset and base styles for page builder compatibility */
.sw-donation-form {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	position: relative;
	clear: both;
}

/* Container wrapper - respects parent container width */
.sw-donation-form-wrapper {
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	padding: 30px 20px;
	box-sizing: border-box;
}

/* For page builders with their own containers */
.elementor-widget-shortcode .sw-donation-form,
.vc_column_container .sw-donation-form,
.wpb_content_element .sw-donation-form,
.elementor-element .sw-donation-form {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
}

/* Inner container with max-width for readability (can be overridden) */
.sw-donation-form-inner-container {
	max-width: 1200px;
	margin: 0 auto;
	width: 100%;
}

.sw-form-hero {
	background: var(--sw-hero-gradient, linear-gradient(135deg, #1d60f0, #6f9eff));
	color: #fff;
	padding: 32px;
	border-radius: var(--sw-border-radius, 18px);
	box-shadow: 0 18px 40px rgba(21, 79, 190, 0.25);
	display: flex;
	flex-direction: column;
	gap: 18px;
	width: 100%;
	box-sizing: border-box;
}

.sw-form-hero h3 {
	margin: 0;
	font-size: 28px;
}

.sw-form-hero p {
	margin: 4px 0 0;
	font-size: 16px;
	opacity: 0.95;
}

.sw-hero-badges {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.sw-hero-badges span {
	background: rgba(255,255,255,0.15);
	border: 1px solid rgba(255,255,255,0.35);
	padding: 6px 14px;
	border-radius: 50px;
	font-size: 13px;
	font-weight: 600;
}

.sw-donation-form-inner {
	background: var(--sw-bg-light, #f7f9fd);
	border-radius: 20px;
	padding: var(--sw-spacing, 30px);
	position: relative;
	z-index: 2;
	box-shadow: var(--sw-shadow-lg, 0 25px 60px rgba(15, 23, 42, 0.12));
	width: 100%;
	box-sizing: border-box;
}

.sw-form-layout {
	display: grid;
	grid-template-columns: minmax(0, 2fr) 340px;
	gap: 28px;
}

.sw-form-main h4 {
	margin: 0 0 15px;
}

.sw-card {
	background: var(--sw-bg-white, #fff);
	border-radius: var(--sw-border-radius, 18px);
	padding: 24px;
	margin-bottom: 24px;
	box-shadow: var(--sw-shadow-sm, 0 8px 24px rgba(15, 23, 42, 0.05));
	width: 100%;
	box-sizing: border-box;
}

.sw-form-row {
	margin-bottom: 15px;
}

.sw-form-row label {
	display: block;
	margin-bottom: 5px;
	font-weight: 400;
    font-size: 18px;
}

.sw-form-row .required {
	color: #d63638;
}

.sw-form-row input[type="text"],
.sw-form-row input[type="email"],
.sw-form-row input[type="tel"],
.sw-form-row input[type="number"],
.sw-form-row select,
.sw-form-row textarea {
	width: 100%;
	padding: 10px 14px;
	border: 2px solid var(--sw-border-color, #e4e7ec);
	border-radius: 8px;
	font-size: 14px;
	transition: all 0.2s ease;
	background: #fff;
}

.sw-form-row input[type="text"]:hover,
.sw-form-row input[type="email"]:hover,
.sw-form-row input[type="tel"]:hover,
.sw-form-row input[type="number"]:hover,
.sw-form-row select:hover,
.sw-form-row textarea:hover {
	border-color: #cbd5e1;
}

.sw-form-row select {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 36px;
}

.sw-field-help {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	color: var(--sw-text-muted, #475467);
	font-style: italic;
}

.sw-form-row-half {
	display: inline-block;
	width: 48%;
	margin-right: 2%;
}

.sw-form-row-half:last-child {
	margin-right: 0;
}

.sw-campaign-progress-card {
	background: #101828;
	color: #fff;
	border-radius: 18px;
	padding: 20px;
	margin-bottom: 24px;
}

.sw-progress-bar {
	width: 100%;
	height: 14px;
	background: rgba(255,255,255,0.15);
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 16px;
}

.sw-progress-fill {
	height: 100%;
	background: linear-gradient(135deg, #a855f7, #ec4899);
	transition: width 0.3s ease;
}

.sw-progress-meta {
	display: flex;
	justify-content: space-between;
	text-align: center;
	gap: 12px;
}

.sw-progress-meta span {
	display: block;
	font-size: 12px;
	text-transform: uppercase;
	opacity: 0.8;
	letter-spacing: 0.6px;
	margin-top: 2px;
}

.sw-pricing-levels {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 10px;
	margin-bottom: 20px;
}

.sw-pricing-button {
	padding: 14px 16px;
	border: 2px solid #e4e7ec;
	border-radius: 14px;
	background: #fff;
	color: #0f172a;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.25s ease;
	text-align: center;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.sw-pricing-button:hover {
	border-color: #2563eb;
	box-shadow: 0 6px 18px rgba(37, 99, 235, 0.15);
	transform: translateY(-1px);
}

.sw-pricing-button.sw-selected {
	border-color: var(--sw-primary-color, #2563eb);
	background: var(--sw-primary-color, #2563eb);
	color: #fff;
	box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.sw-pricing-button.sw-custom-button {
	background: #eef2ff;
	border-color: #c7d2fe;
}

.sw-amount-input-wrapper {
	margin-top: 20px;
	padding: 18px;
	background: #f8fafc;
	border-radius: 14px;
	border: 1px dashed #cbd5f5;
}

.sw-amount-input-wrapper label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
}

.sw-amount-options {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sw-amount-input {
	flex: 1;
	padding: 14px 16px;
	font-size: 16px;
	font-weight: 500;
	color: #1a1a1a;
	background: #ffffff;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	transition: all 0.3s ease;
	outline: none;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sw-amount-input:hover {
	border-color: #cbd5e1;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sw-amount-input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
	background: #ffffff;
}

.sw-amount-input::placeholder {
	color: #94a3b8;
	font-weight: 400;
}

.sw-amount-input:disabled {
	background: #f1f5f9;
	border-color: #e2e8f0;
	color: #64748b;
	cursor: not-allowed;
	opacity: 0.7;
}

/* Remove spinner arrows for number input */
.sw-amount-input::-webkit-outer-spin-button,
.sw-amount-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
}

.sw-amount-input[type=number] {
	-moz-appearance: textfield;
	appearance: textfield;
}

.sw-currency {
	font-weight: 600;
}

.sw-pan-notice {
	font-size: 12px;
	color: #666;
	margin-top: 5px;
}

.sw-consents label {
	font-weight: normal;
	display: flex;
	align-items: center;
	gap: 8px;
}

.sw-form-actions {
	margin-top: 30px;
	text-align: center;
}

.sw-submit-button {
	width: 100%;
	padding: 16px 24px;
	background: var(--sw-primary-gradient, linear-gradient(135deg, #2563eb, #1d4ed8));
	color: #fff;
	border: none;
	border-radius: var(--sw-border-radius-sm, 14px);
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 15px 35px rgba(37, 99, 235, 0.35);
	box-sizing: border-box;
}

.sw-submit-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 18px 40px rgba(37, 99, 235, 0.45);
}

.sw-trust-note {
	font-size: 13px;
	color: #475467;
	margin-top: 10px;
}

/* Validation Error Styles */
.sw-field-error {
	border-color: #ef4444 !important;
	background-color: #fef2f2 !important;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.sw-has-error {
	position: relative;
}

.sw-field-error-message {
	display: block;
	color: #dc2626;
	font-size: 13px;
	font-weight: 500;
	margin-top: 6px;
	padding: 8px 12px;
	background: #fef2f2;
	border-left: 3px solid #ef4444;
	border-radius: 4px;
	animation: slideDown 0.3s ease;
	position: relative;
	padding-left: 32px;
}

.sw-field-error-message:before {
	content: "⚠";
	position: absolute;
	left: 10px;
	top: 8px;
	font-size: 16px;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.sw-form-messages {
	margin-top: 15px;
	padding: 15px 20px;
	border-radius: 12px;
	display: none;
	font-weight: 500;
	position: relative;
	padding-left: 50px;
	animation: slideDown 0.3s ease;
}

.sw-message-icon {
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 20px;
}

.sw-form-messages.error {
	background: #fef2f2;
	border: 2px solid #fecaca;
	color: #991b1b;
	display: block;
}

.sw-form-messages.error .sw-message-icon:before {
	content: "⚠";
}

.sw-form-messages.success {
	background: #f0fdf4;
	border: 2px solid #bbf7d0;
	color: #166534;
	display: block;
}

.sw-form-messages.success .sw-message-icon:before {
	content: "✓";
}

/* Focus states for better UX */
.sw-form-row input:focus,
.sw-form-row select:focus,
.sw-form-row textarea:focus {
	outline: none;
	border-color: var(--sw-primary-color, #2563eb);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
	transition: all 0.2s ease;
}

.sw-form-row input.sw-field-error:focus,
.sw-form-row select.sw-field-error:focus {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.sw-form-sidebar {
	position: sticky;
	top: 30px;
	height: fit-content;
}

.sw-sidebar-card {
	background: #fff;
	border-radius: 18px;
	padding: 24px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
	border: 1px solid #eaecf0;
}

.sw-sidebar-card h4 {
	margin-top: 0;
}

.sw-sidebar-list {
	list-style: none;
	padding: 0;
	margin: 20px 0;
}

.sw-sidebar-list li {
	padding-left: 22px;
	position: relative;
	margin-bottom: 12px;
	font-size: 14px;
	color: #475467;
}

.sw-sidebar-list li:before {
	content: '✓';
	position: absolute;
	left: 0;
	top: 0;
	color: #16a34a;
	font-weight: 700;
}

.sw-sidebar-highlight {
	background: #f1f5ff;
	border-radius: 12px;
	padding: 14px;
	text-align: center;
}

.sw-sidebar-highlight strong {
	display: block;
	font-size: 26px;
	color: #1d4ed8;
}
.sw-sidebar-highlight span {
	font-size: 13px;
	color: #475467;
}

/* Responsive design for mobile and tablets */
@media (max-width: 1024px) {
	.sw-form-layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.sw-form-sidebar {
		position: static;
	}
}

@media (max-width: 768px) {
	.sw-donation-form-wrapper {
		padding: 20px 15px;
	}

	.sw-donation-form-inner {
		padding: 24px 20px;
		margin-top: -30px;
		border-radius: 16px;
	}

	.sw-form-hero {
		padding: 24px 20px;
		border-radius: 16px;
	}

	.sw-form-hero h3 {
		font-size: 24px;
	}

	.sw-form-hero p {
		font-size: 14px;
	}

	.sw-form-layout {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.sw-form-sidebar {
		position: static;
	}

	.sw-form-row-half {
		width: 100%;
		margin-right: 0;
		margin-bottom: 15px;
	}

	.sw-pricing-levels {
		grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
		gap: 8px;
	}

	.sw-pricing-button {
		padding: 12px 14px;
		font-size: 14px;
	}

	.sw-card {
		padding: 20px;
		margin-bottom: 20px;
	}

	.sw-submit-button {
		padding: 14px 20px;
		font-size: 16px;
	}
}

@media (max-width: 480px) {
	.sw-donation-form-wrapper {
		padding: 15px 10px;
	}

	.sw-donation-form-inner {
		padding: 20px 15px;
	}

	.sw-form-hero {
		padding: 20px 15px;
	}

	.sw-form-hero h3 {
		font-size: 20px;
	}

	.sw-hero-badges {
		flex-direction: column;
		gap: 8px;
	}

	.sw-hero-badges span {
		width: 100%;
		text-align: center;
	}

	.sw-pricing-levels {
		grid-template-columns: repeat(2, 1fr);
	}

	.sw-card {
		padding: 16px;
	}

	.sw-field-error-message {
		font-size: 12px;
		padding: 6px 10px;
		padding-left: 28px;
	}

	.sw-field-error-message:before {
		left: 8px;
		font-size: 14px;
	}

	.sw-form-messages {
		padding: 12px 16px;
		padding-left: 44px;
		font-size: 14px;
	}

	.sw-message-icon {
		left: 14px;
		font-size: 18px;
	}
}

/* Page builder specific overrides */
.elementor-container .sw-donation-form,
.elementor-section .sw-donation-form {
	width: 100%;
}

.vc_row .sw-donation-form,
.vc_column .sw-donation-form {
	width: 100%;
}

/* Prevent theme conflicts */
.sw-donation-form * {
	box-sizing: border-box;
}

.sw-donation-form input,
.sw-donation-form select,
.sw-donation-form textarea,
.sw-donation-form button {
	font-family: inherit;
}

/* Ensure form doesn't break in narrow containers */
.sw-donation-form {
	min-width: 0;
	overflow-x: hidden;
}

/* Container wrapper styles */
.sw-donation-form-wrapper {
	clear: both;
}

.sw-donation-form-inner-container {
	position: relative;
}

/* Fix for page builders that add extra padding */
.elementor-section-full_width .sw-donation-form-wrapper,
.vc_row-full-width .sw-donation-form-wrapper {
	padding-left: 0;
	padding-right: 0;
}

/* Ensure proper display in flex containers */
.elementor-column .sw-donation-form,
.vc_column .sw-donation-form {
	display: block;
}

/* Prevent float issues */
.sw-donation-form::before,
.sw-donation-form::after {
	content: "";
	display: table;
	clear: both;
}

/* Grid layout improvements for better responsiveness */
.sw-form-layout {
	display: grid;
	grid-template-columns: minmax(0, 2fr) 340px;
	gap: 28px;
	width: 100%;
}

/* Ensure inputs don't overflow */
.sw-form-row input[type="text"],
.sw-form-row input[type="email"],
.sw-form-row input[type="tel"],
.sw-form-row input[type="number"],
.sw-form-row select,
.sw-form-row textarea {
	max-width: 100%;
	box-sizing: border-box;
}

/* Pricing levels responsive grid */
.sw-pricing-levels {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 10px;
	margin-bottom: 20px;
	width: 100%;
}

/* Progress bar responsive */
.sw-progress-meta {
	display: flex;
	justify-content: space-between;
	text-align: center;
	gap: 12px;
	flex-wrap: wrap;
}

/* Sidebar sticky positioning improvements */
.sw-form-sidebar {
	position: sticky;
	top: 30px;
	height: fit-content;
	align-self: start;
}

/* Print styles */
@media print {
	.sw-donation-form {
		max-width: 100%;
		margin: 0;
		padding: 0;
	}
	
	.sw-form-hero,
	.sw-form-sidebar {
		display: none;
	}
}

