/**
 * JH Easy Payments Frontend Styles
 *
 * @package JH_Easy_Payments
 * @since   1.0.0
 */

/* Reset and Base Styles */
.jhep-payment-container * {
	box-sizing: border-box;
}

.jhep-payment-container {
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 16px;
	line-height: 1.5;
}

/* Form Styles */
.jhep-payment-form {
	background: #fff;
	padding: 24px;
	border: 1px solid #e1e5e9;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form Layout */
.jhep-form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 20px;
}

.jhep-form-group {
	flex: 1;
	min-width: 0;
}

.jhep-form-group.jhep-half {
	flex: 1;
	min-width: 200px;
}

.jhep-form-group.jhep-third {
	flex: 1;
	min-width: 150px;
}

/* Form Elements */
.jhep-form-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: #004b87;
}

.jhep-form-group label .required {
	color: #ef4444;
}

.jhep-form-group input,
.jhep-form-group select {
	width: 100%;
	padding: 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 16px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	background: #fff;
}

.jhep-form-group input:focus,
.jhep-form-group select:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Error Messages */
.jhep-error {
	color: #ef4444;
	font-size: 14px;
	margin-top: 4px;
	min-height: 20px;
}

/* Price Summary */
.jhep-price-summary {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 20px;
	margin: 24px 0;
}

.jhep-price-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
}

.jhep-price-row:last-child {
	margin-top: 8px;
	padding-top: 12px;
}

.jhep-price-label {
	color: #475569;
	font-size: 15px;
}

.jhep-price-value {
	color: #1e293b;
	font-size: 16px;
	font-weight: 500;
}

.jhep-total-row .jhep-price-label,
.jhep-total-row .jhep-price-value {
	font-size: 18px;
	font-weight: 600;
	color: #0f172a;
}

.jhep-vat-row {
	color: #059669;
	border-top: 1px solid #e2e8f0;
}
.jhep-total-row {
	border-top: 2px solid #e2e8f0;
}

/* Submit Button */
.jhep-submit-container {
	position: relative;
	text-align: center;
	margin-top: 24px;
}

.jhep-submit-btn {
	background: #004b87;
	color: #fff;
	border: none;
	padding: 14px 32px;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
	min-width: 140px;
}

.jhep-submit-btn:hover {
	background: #71c5e8;
	transform: translateY(-1px);
}

.jhep-submit-btn:active {
	transform: translateY(0);
}

.jhep-submit-btn:disabled {
	background: #9ca3af;
	cursor: not-allowed;
	transform: none;
}

.jhep-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: #6b7280;
	font-size: 14px;
}

.jhep-loading::before {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid #e5e7eb;
	border-top: 2px solid #3b82f6;
	border-radius: 50%;
	animation: jhep-spin 1s linear infinite;
}

@keyframes jhep-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Form Messages */
.jhep-form-messages {
	margin-top: 20px;
}

.jhep-message {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 12px;
}

.jhep-message.success {
	background: #dcfce7;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.jhep-message.error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* Payment Modal */
.jhep-modal {
	position: fixed;
	z-index: 99999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	align-items: center;
	justify-content: center;
}

.jhep-modal-content {
	position: relative;
	width: 90%;
	max-width: 900px;
	height: 80%;
	max-height: 600px;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.jhep-modal-close {
	position: absolute;
	right: 12px;
	top: 12px;
	z-index: 100000;
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	font-size: 18px;
	font-weight: bold;
	cursor: pointer;
	line-height: 1;
	color: #6b7280;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.jhep-modal-close:hover {
	background: #f3f4f6;
	border-color: #d1d5db;
	color: #374151;
}

.jhep-modal-close:focus {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
}

#jhep-payment-iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
	.jhep-payment-container {
		margin: 0 16px;
	}

	.jhep-payment-form {
		padding: 20px;
	}

	.jhep-form-row {
		flex-direction: column;
		gap: 0;
	}

	.jhep-form-group.jhep-half,
	.jhep-form-group.jhep-third {
		min-width: 100%;
	}

	.jhep-form-row:not(:last-child) .jhep-form-group {
		margin-bottom: 20px;
	}

	.jhep-modal-content {
		width: 95%;
		height: 85%;
		border-radius: 8px;
	}

	.jhep-modal-close {
		width: 32px;
		height: 32px;
		font-size: 16px;
		right: 8px;
		top: 8px;
	}

	.jhep-price-summary {
		padding: 16px;
		margin: 20px 0;
	}

	.jhep-price-row {
		font-size: 14px;
	}

	.jhep-total-row .jhep-price-label,
	.jhep-total-row .jhep-price-value {
		font-size: 16px;
	}
}

@media (max-width: 480px) {
	.jhep-payment-form {
		padding: 16px;
	}

	.jhep-form-group input,
	.jhep-form-group select {
		padding: 10px;
		font-size: 16px; /* Prevents zoom on iOS */
	}

	.jhep-submit-btn {
		width: 100%;
		padding: 12px 24px;
	}

	.jhep-modal-content {
		width: 98%;
		height: 90%;
		border-radius: 6px;
	}
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
	.jhep-payment-form {
		border: 2px solid #000;
	}

	.jhep-form-group input,
	.jhep-form-group select {
		border: 2px solid #000;
	}

	.jhep-form-group input:focus,
	.jhep-form-group select:focus {
		outline: 3px solid #000;
		outline-offset: 1px;
	}

	.jhep-submit-btn {
		border: 2px solid #000;
	}

	.jhep-modal-close {
		border: 2px solid #000;
		background: #fff;
		color: #000;
	}
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
	.jhep-submit-btn,
	.jhep-form-group input,
	.jhep-form-group select,
	.jhep-modal-close {
		transition: none;
	}

	.jhep-loading::before {
		animation: none;
	}

	.jhep-submit-btn:hover {
		transform: none;
	}
}

/* Print Styles */
@media print {
	.jhep-modal,
	.jhep-submit-container {
		display: none;
	}

	.jhep-payment-form {
		box-shadow: none;
		border: 1px solid #000;
	}
}