/* SecuPay Modal Styles */

.secupay-modal-wrapper {
	display: inline-block;
}

/* Modal Button */
.secupay-modal-button {
	display: inline-block;
	padding: 12px 24px;
	background-color: #0073aa;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease, transform 0.1s ease;
	text-decoration: none;
}

.secupay-modal-button:hover {
	background-color: #005a87;
	transform: translateY(-1px);
}

.secupay-modal-button:active {
	transform: translateY(0);
}

.secupay-modal-button:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* Modal Overlay */
.secupay-modal-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.6);
	z-index: 999999;
	opacity: 0;
	transition: opacity 0.3s ease;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.secupay-modal-overlay.active {
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
}

/* Modal Container */
.secupay-modal-container {
	position: relative;
	background-color: #ffffff;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	margin: 20px;
	max-width: 90%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	transform: scale(0.9);
	transition: transform 0.3s ease;
	overflow: hidden;
}

.secupay-modal-overlay.active .secupay-modal-container {
	transform: scale(1);
}

/* Modal Sizes */
.secupay-modal-small {
	width: 100%;
	max-width: 400px;
}

.secupay-modal-medium {
	width: 100%;
	max-width: 600px;
}

.secupay-modal-large {
	width: 100%;
	max-width: 900px;
}

/* Modal Header */
.secupay-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #e0e0e0;
	background-color: #f8f9fa;
}

.secupay-modal-title {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
	color: #333333;
	line-height: 1.4;
}

/* Modal Close Button */
.secupay-modal-close {
	background: none;
	border: none;
	font-size: 32px;
	line-height: 1;
	color: #666666;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.secupay-modal-close:hover {
	background-color: #e0e0e0;
	color: #333333;
}

.secupay-modal-close:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.secupay-modal-close span {
	display: block;
	line-height: 1;
}

/* Modal Body */
.secupay-modal-body {
	padding: 24px;
	overflow-y: auto;
	flex: 1;
	color: #333333;
	line-height: 1.6;
}

.secupay-modal-body p {
	margin-top: 0;
	margin-bottom: 16px;
}

.secupay-modal-body p:last-child {
	margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
	.secupay-modal-container {
		margin: 10px;
		max-width: calc(100% - 20px);
		max-height: calc(100vh - 20px);
	}

	.secupay-modal-header {
		padding: 16px 20px;
	}

	.secupay-modal-title {
		font-size: 20px;
	}

	.secupay-modal-body {
		padding: 20px;
	}

	.secupay-modal-small,
	.secupay-modal-medium,
	.secupay-modal-large {
		max-width: 100%;
	}
}

/* Accessibility */
.secupay-modal-overlay[aria-hidden="true"] {
	display: none;
}

.secupay-modal-overlay[aria-hidden="false"] {
	display: flex;
}

/* Animation for smooth opening */
@keyframes secupay-modal-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes secupay-modal-scale-in {
	from {
		transform: scale(0.9);
	}
	to {
		transform: scale(1);
	}
}

/* Prevent body scroll when modal is open */
body.secupay-modal-open {
	overflow: hidden;
}

/* ============================================
   Form Styles
   ============================================ */

/* Form Container */
.secupay-payment-form {
	margin: 0;
}

/* Form Sections */
.secupay-form-section {
	margin-bottom: 32px;
}

.secupay-form-section:last-of-type {
	margin-bottom: 0;
}

.secupay-form-section-title {
	margin: 0 0 20px 0;
	font-size: 18px;
	font-weight: 600;
	color: #333333;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 8px;
}

/* Form Rows */
.secupay-form-row {
	display: flex;
	gap: 16px;
	margin-bottom: 20px;
}

.secupay-form-row:last-child {
	margin-bottom: 0;
}

/* Form Groups */
.secupay-form-group {
	flex: 1;
}

.secupay-form-group-full {
	flex: 1 1 100%;
}

/* Form Labels */
.secupay-form-label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	color: #333333;
	font-size: 14px;
}

.secupay-required {
	color: #d63638;
	margin-left: 4px;
}

/* Form Inputs */
.secupay-form-input {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	box-sizing: border-box;
}

.secupay-form-input:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.secupay-form-input:invalid:not(:placeholder-shown) {
	border-color: #d63638;
}

.secupay-form-input:valid:not(:placeholder-shown) {
	border-color: #00a32a;
}

/* Amount Input with Currency Symbol */
.secupay-input-wrapper {
	position: relative;
}

.secupay-currency-symbol {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 16px;
	font-weight: 600;
	color: #666;
	pointer-events: none;
}

.secupay-amount-input {
	padding-left: 40px;
}

/* Payment Methods */
.secupay-payment-methods {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.secupay-payment-method {
	position: relative;
}

.secupay-radio-input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.secupay-radio-label {
	display: flex;
	align-items: center;
	padding: 16px;
	border: 2px solid #ddd;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	background-color: #ffffff;
}

.secupay-radio-label:hover {
	border-color: #0073aa;
	background-color: #f0f8ff;
}

.secupay-radio-input:checked + .secupay-radio-label {
	border-color: #0073aa;
	background-color: #e6f4ff;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.secupay-radio-input:focus + .secupay-radio-label {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.secupay-payment-icon {
	font-size: 24px;
	margin-right: 12px;
}

.secupay-payment-name {
	font-size: 16px;
	font-weight: 500;
	color: #333333;
}

/* Checkbox */
.secupay-checkbox-label {
	display: flex;
	align-items: flex-start;
	cursor: pointer;
}

.secupay-checkbox-input {
	margin-right: 10px;
	margin-top: 4px;
	width: 18px;
	height: 18px;
	cursor: pointer;
	flex-shrink: 0;
}

.secupay-checkbox-text {
	font-size: 14px;
	line-height: 1.5;
	color: #333333;
}

/* Form Footer */
.secupay-form-footer {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid #e0e0e0;
}

.secupay-form-actions {
	display: flex;
	gap: 12px;
	justify-content: flex-end;
}

/* Buttons */
.secupay-button {
	padding: 12px 24px;
	border: none;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	display: inline-block;
}

.secupay-button-primary {
	background-color: #0073aa;
	color: #ffffff;
}

.secupay-button-primary:hover {
	background-color: #005a87;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.secupay-button-primary:active {
	transform: translateY(0);
}

.secupay-button-secondary {
	background-color: #f0f0f0;
	color: #333333;
}

.secupay-button-secondary:hover {
	background-color: #e0e0e0;
}

.secupay-button:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.secupay-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Error Message */
.secupay-error {
	color: #d63638;
	background-color: #fcf0f1;
	padding: 12px 16px;
	border-radius: 4px;
	border-left: 4px solid #d63638;
	margin: 16px 0;
}

/* Form Messages */
.secupay-form-message {
	padding: 12px 16px;
	border-radius: 4px;
	margin: 16px 0;
	font-weight: 500;
	animation: secupay-message-fade-in 0.3s ease-in;
}

.secupay-form-message-success {
	color: #0f5132;
	background-color: #d1e7dd;
	border-left: 4px solid #0f5132;
}

.secupay-form-message-error {
	color: #d63638;
	background-color: #fcf0f1;
	border-left: 4px solid #d63638;
}

/* Country Datalist Styling */
.secupay-country-wrapper {
	position: relative;
}

.secupay-country-input-container {
	position: relative;
	width: 100%;
}

.secupay-country-input {
	width: 100%;
	box-sizing: border-box;
}

/* Note: Native datalist dropdown positioning is controlled by the browser
   and will automatically appear below the input field with matching width.
   The browser handles the positioning and styling of the dropdown. */

/* Field Error Messages */
.secupay-field-error {
	display: block;
	color: #d63638;
	font-size: 0.875rem;
	margin-top: 4px;
	font-weight: 500;
}

@keyframes secupay-message-fade-in {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Responsive Form */
@media (max-width: 768px) {
	.secupay-form-row {
		flex-direction: column;
		gap: 0;
	}

	.secupay-form-group {
		margin-bottom: 20px;
	}

	.secupay-form-group:last-child {
		margin-bottom: 0;
	}

	.secupay-form-actions {
		flex-direction: column-reverse;
	}

	.secupay-button {
		width: 100%;
		text-align: center;
	}

	.secupay-payment-methods {
		gap: 8px;
	}

	.secupay-radio-label {
		padding: 12px;
	}
}

/* ============================================
   Modal Views (Two Views: Form and Payment Methods)
   ============================================ */

/* View Container */
.secupay-form-view,
.secupay-payment-methods-view {
	display: none;
	width: 100%;
}

.secupay-form-view.active,
.secupay-payment-methods-view.active {
	display: block;
}

/* Payment Methods View */
.secupay-payment-methods-view {
	animation: secupay-view-fade-in 0.3s ease-in;
}

.secupay-payment-methods-title {
	margin: 0 0 24px 0;
	font-size: 20px;
	font-weight: 600;
	color: #333333;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 8px;
}

.secupay-payment-methods-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 24px;
}

/* Payment Method Button */
.secupay-payment-method-button {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 20px 24px;
	border: 2px solid #ddd;
	border-radius: 8px;
	background-color: #ffffff;
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: left;
	font-size: 16px;
	font-weight: 500;
	color: #333333;
}

.secupay-payment-method-button:hover {
	border-color: #0073aa;
	background-color: #f0f8ff;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 115, 170, 0.2);
}

.secupay-payment-method-button:active {
	transform: translateY(0);
}

.secupay-payment-method-button:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.secupay-payment-method-button .secupay-payment-icon {
	font-size: 28px;
	margin-right: 16px;
	flex-shrink: 0;
}

.secupay-payment-method-button .secupay-payment-name {
	flex: 1;
}

/* Back Button */
.secupay-back-button {
	margin-top: 24px;
}

/* No Methods Message */
.secupay-no-methods {
	padding: 20px;
	text-align: center;
	color: #666666;
	background-color: #f8f9fa;
	border-radius: 8px;
	margin-bottom: 24px;
}

/* View Transition Animation */
@keyframes secupay-view-fade-in {
	from {
		opacity: 0;
		transform: translateX(20px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Responsive Payment Methods View */
@media (max-width: 768px) {
	.secupay-payment-methods-list {
		gap: 12px;
	}

	.secupay-payment-method-button {
		padding: 16px 20px;
	}

	.secupay-payment-method-button .secupay-payment-icon {
		font-size: 24px;
		margin-right: 12px;
	}
}

/* ============================================
   Service Message Styles
   ============================================ */

.secupay-service-message {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 20px 0;
}

.secupay-service-message-content {
	width: 100%;
	margin-bottom: 32px;
}

.secupay-service-message-icon {
	display: flex;
	justify-content: center;
	margin-bottom: 24px;
	color: #0073aa;
}

.secupay-service-message-icon svg {
	width: 64px;
	height: 64px;
}

.secupay-service-message-title {
	margin: 0 0 16px 0;
	font-size: 24px;
	font-weight: 600;
	color: #333333;
	line-height: 1.4;
}

.secupay-service-message-text {
	margin: 0;
	font-size: 16px;
	color: #666666;
	line-height: 1.6;
	max-width: 500px;
	margin-left: auto;
	margin-right: auto;
}

.secupay-service-message-footer {
	width: 100%;
	display: flex;
	justify-content: center;
	padding-top: 24px;
	border-top: 1px solid #e0e0e0;
}

/* Responsive Service Message */
@media (max-width: 768px) {
	.secupay-service-message {
		padding: 16px 0;
	}

	.secupay-service-message-icon svg {
		width: 48px;
		height: 48px;
	}

	.secupay-service-message-title {
		font-size: 20px;
	}

	.secupay-service-message-text {
		font-size: 14px;
	}

	.secupay-service-message-footer {
		padding-top: 20px;
	}

	.secupay-service-message-footer .secupay-button {
		width: 100%;
	}
}

