/* Custom Payment Gateways — Checkout & account styles */

:root {
	--cpg-accent: #6d4aff;
	--cpg-accent-soft: #f2effe;
	--cpg-border: #e3e3e8;
	--cpg-text: #1f2937;
	--cpg-text-muted: #6b7280;
	--cpg-success: #1a7f37;
	--cpg-error: #d63638;
	--cpg-radius: 12px;
	--cpg-radius-sm: 8px;
	--cpg-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

.woocommerce-checkout ul.payment_methods li img {
	max-height: 26px;
	width: auto;
	vertical-align: middle;
	border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* Checkout custom fields                                              */
/* ------------------------------------------------------------------ */

.cpg-checkout-fields {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px 16px;
	margin-top: 14px;
	padding: 18px;
	background: var(--cpg-accent-soft);
	border: 1px solid var(--cpg-border);
	border-radius: var(--cpg-radius);
}

.cpg-checkout-fields .cpg-field {
	margin: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.cpg-checkout-fields .cpg-field-textarea,
.cpg-checkout-fields .cpg-field-file,
.cpg-checkout-fields .cpg-field-proof {
	grid-column: 1 / -1;
}

.cpg-checkout-fields label {
	font-size: 13px;
	font-weight: 600;
	color: var(--cpg-text);
}

.cpg-checkout-fields .required {
	color: var(--cpg-error);
}

.cpg-checkout-fields input[type="text"],
.cpg-checkout-fields input[type="number"],
.cpg-checkout-fields input[type="email"],
.cpg-checkout-fields input[type="tel"],
.cpg-checkout-fields input[type="date"],
.cpg-checkout-fields select,
.cpg-checkout-fields textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--cpg-border);
	border-radius: var(--cpg-radius-sm);
	background: #fff;
	font-size: 14px;
	line-height: 1.4;
	transition: border-color .15s ease, box-shadow .15s ease;
	box-sizing: border-box;
}

.cpg-checkout-fields input:focus,
.cpg-checkout-fields select:focus,
.cpg-checkout-fields textarea:focus {
	outline: none;
	border-color: var(--cpg-accent);
	box-shadow: 0 0 0 3px rgba(109, 74, 255, .15);
}

.cpg-checkout-fields textarea {
	min-height: 80px;
	resize: vertical;
}

/* ------------------------------------------------------------------ */
/* Proof-of-payment dropzone (checkout)                                 */
/* ------------------------------------------------------------------ */

.cpg-dropzone {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 4px;
	border: 2px dashed var(--cpg-border);
	border-radius: var(--cpg-radius);
	background: #fff;
	padding: 22px 14px;
	text-align: center;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}

.cpg-dropzone:hover,
.cpg-dropzone.cpg-dragover {
	border-color: var(--cpg-accent);
	background: var(--cpg-accent-soft);
}

.cpg-dropzone input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
}

.cpg-dropzone-text {
	font-size: 12px;
	color: var(--cpg-text-muted);
	pointer-events: none;
}

.cpg-dropzone-filename {
	font-size: 13px;
	font-weight: 600;
	color: var(--cpg-accent);
	pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Payment Instructions card (thank you page + order details page)     */
/* ------------------------------------------------------------------ */

.cpg-instructions {
	margin: 24px 0;
	padding: 20px 24px;
	border: 1px solid var(--cpg-border);
	border-radius: var(--cpg-radius);
	background: #fff;
	box-shadow: var(--cpg-shadow);
}

.cpg-instructions h2 {
	margin: 0 0 8px;
	font-size: 18px;
	color: var(--cpg-text);
}

.cpg-instructions img {
	max-width: 100%;
	height: auto;
	border-radius: var(--cpg-radius-sm);
}

.cpg-instructions p:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ */
/* Checkout Description (rendered above the custom checkout fields)    */
/* ------------------------------------------------------------------ */

.cpg-gateway-description {
	margin-bottom: 10px;
}

.cpg-gateway-description img {
	max-width: 100%;
	height: auto;
	border-radius: var(--cpg-radius-sm);
	display: block;
	margin: 8px 0;
}

.cpg-gateway-description p:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ */
/* Combined "Submitted Payment Details" + "Uploaded the wrong file?"   */
/* card — one box, two stacked sections separated by a divider.        */
/* ------------------------------------------------------------------ */

.cpg-payment-details-box {
	margin: 24px 0;
	padding: 0;
	border: 1px solid var(--cpg-border);
	border-radius: var(--cpg-radius);
	background: #fff;
	box-shadow: var(--cpg-shadow);
	overflow: hidden;
}

.cpg-payment-details-box .cpg-customer-meta,
.cpg-payment-details-box .cpg-reupload-proof {
	margin: 0;
	padding: 20px 24px;
	border: none;
	border-radius: 0;
	background: transparent;
}

.cpg-payment-details-box .cpg-reupload-proof {
	border-top: 1px solid var(--cpg-border);
	background: #fafafa;
}

.cpg-customer-meta h2,
.cpg-reupload-proof h3 {
	margin: 0 0 12px;
	font-size: 16px;
	color: var(--cpg-text);
}

.cpg-customer-meta .responsive-table {
	overflow-x: auto;
}

.cpg-customer-meta table.shop_table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.cpg-customer-meta table.shop_table th,
.cpg-customer-meta table.shop_table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--cpg-border);
	text-align: left;
	vertical-align: top;
}

.cpg-customer-meta table.shop_table tr:last-child th,
.cpg-customer-meta table.shop_table tr:last-child td {
	border-bottom: none;
}

.cpg-customer-meta table.shop_table th {
	width: 40%;
	color: var(--cpg-text-muted);
	font-weight: 600;
}

.cpg-customer-meta table.shop_table a {
	color: var(--cpg-accent);
	font-weight: 600;
	text-decoration: none;
}

.cpg-customer-meta table.shop_table a:hover {
	text-decoration: underline;
}

.cpg-reupload-proof p {
	margin: 0 0 12px;
	font-size: 13px;
	color: var(--cpg-text-muted);
}

.cpg-reupload-proof-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.cpg-reupload-proof-form .form-row {
	margin: 0;
	flex: 1 1 220px;
	min-width: 0;
}

.cpg-reupload-proof-form input[type="file"] {
	width: 100%;
	font-size: 13px;
	padding: 8px;
	border: 1px solid var(--cpg-border);
	border-radius: var(--cpg-radius-sm);
	background: #fff;
	box-sizing: border-box;
}

.cpg-reupload-proof-form button {
	flex: 0 0 auto;
	border-radius: var(--cpg-radius-sm);
	background: var(--cpg-accent);
	color: #fff;
	border: none;
	padding: 10px 20px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, opacity .15s ease;
}

.cpg-reupload-proof-form button:hover {
	background: #5b3ce0;
}

.cpg-reupload-proof-form button:disabled {
	opacity: .6;
	cursor: default;
}

.cpg-reupload-proof-message {
	flex-basis: 100%;
	font-size: 13px;
	margin: 0;
	min-height: 1em;
}

.cpg-reupload-proof-message.cpg-success {
	color: var(--cpg-success);
}

.cpg-reupload-proof-message.cpg-error {
	color: var(--cpg-error);
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

/* Tablet */
@media (max-width: 900px) {
	.cpg-checkout-fields {
		grid-template-columns: 1fr 1fr;
	}
}

/* Mobile */
@media (max-width: 600px) {
	.cpg-checkout-fields {
		grid-template-columns: 1fr;
		padding: 14px;
	}

	.cpg-checkout-fields .cpg-field-file,
	.cpg-checkout-fields .cpg-field-textarea {
		grid-column: auto;
	}

	.cpg-instructions,
	.cpg-payment-details-box .cpg-customer-meta,
	.cpg-payment-details-box .cpg-reupload-proof {
		padding: 16px;
	}

	.cpg-customer-meta table.shop_table th,
	.cpg-customer-meta table.shop_table td {
		padding: 8px;
		font-size: 13px;
	}

	.cpg-reupload-proof-form {
		flex-direction: column;
		align-items: stretch;
	}

	.cpg-reupload-proof-form button {
		width: 100%;
	}
}
