/* QR Ph Gateway — proof of payment uploader */

.qrph-fields {
	--qrph-primary: #c8102e;
	--qrph-primary-dark: #a00d25;
	--qrph-primary-soft: rgba(200, 16, 46, 0.07);
	--qrph-secondary: #000000;
	--qrph-border: #dcdcdc;
	--qrph-border-hover: var(--qrph-primary);
	--qrph-bg: #ffffff;
	--qrph-bg-hover: var(--qrph-primary-soft);
	--qrph-muted: #6b6b6b;
	--qrph-ok: #1a7f37;
	--qrph-err: var(--qrph-primary);
	--qrph-radius: 10px;
}

.qrph-upload-row {
	margin-top: 16px;
}

.qrph-fields .qrph-upload-label,
.qrph-followup .qrph-upload-label {
	display: block !important;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 0.95em;
}

.qrph-upload-label .optional {
	font-weight: 400;
	color: var(--qrph-muted, #6b6b6b);
	font-size: 0.9em;
}

.qrph-upload-label abbr.required {
	color: var(--qrph-primary, #c8102e);
	border: 0;
	text-decoration: none;
}

/* ---------------------------------------------------------------- dropzone */

.qrph-fields .qrph-dropzone,
.qrph-followup .qrph-dropzone {
	position: relative !important;
	display: block !important;
	width: 100% !important;
	box-sizing: border-box !important;
	padding: 0 !important;
	border: 1.5px dashed var(--qrph-border, #dcdcdc);
	border-radius: var(--qrph-radius, 10px);
	background: var(--qrph-bg, #ffffff);
	transition: border-color 0.18s ease, background-color 0.18s ease;
	overflow: hidden;
}

.qrph-fields .qrph-dropzone:hover,
.qrph-fields .qrph-dropzone.is-dragover,
.qrph-followup .qrph-dropzone:hover,
.qrph-followup .qrph-dropzone.is-dragover {
	border-style: dashed;
	border-color: var(--qrph-border-hover, #c8102e);
	background: var(--qrph-bg-hover, rgba(200, 16, 46, 0.07));
}

.qrph-fields .qrph-dropzone.has-file,
.qrph-followup .qrph-dropzone.has-file {
	border-color: rgba(26, 127, 55, 0.55);
	background: rgba(26, 127, 55, 0.04);
}

.qrph-fields .qrph-dropzone.has-file:hover,
.qrph-followup .qrph-dropzone.has-file:hover {
	border-color: var(--qrph-border-hover, #c8102e);
	background: var(--qrph-bg-hover, rgba(200, 16, 46, 0.07));
}

.qrph-fields .qrph-dropzone.has-error,
.qrph-followup .qrph-dropzone.has-error {
	border-color: var(--qrph-err, #c8102e);
	background: rgba(200, 16, 46, 0.05);
}

/* Input is visually hidden; the idle label covers the zone instead,
   which avoids the browser's native "No file chosen" tooltip. */
.qrph-file-input {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.qrph-file-input:focus-visible + .qrph-dz-idle {
	outline: 2px solid var(--qrph-primary, #c8102e);
	outline-offset: -2px;
	border-radius: var(--qrph-radius, 10px);
}

.qrph-fields .qrph-dropzone .qrph-dz-idle,
.qrph-followup .qrph-dropzone .qrph-dz-idle {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	text-align: center !important;
	gap: 4px !important;
	width: 100% !important;
	float: none !important;
	padding: 26px 16px !important;
	margin: 0 !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	cursor: pointer !important;
}

.qrph-fields .qrph-dz-icon,
.qrph-followup .qrph-dz-icon {
	display: block !important;
	width: 28px !important;
	height: 28px !important;
	color: var(--qrph-primary, #c8102e);
	margin: 0 0 4px !important;
	flex: 0 0 auto !important;
}

.qrph-fields .qrph-dz-title,
.qrph-followup .qrph-dz-title {
	display: block !important;
	color: var(--qrph-secondary, #000) !important;
	font-weight: 600 !important;
	font-size: 15px !important;
	line-height: 1.3 !important;
	margin: 2px 0 0 !important;
}

.qrph-fields .qrph-dz-hint,
.qrph-followup .qrph-dz-hint {
	display: block !important;
	font-size: 12px !important;
	font-weight: 400 !important;
	text-decoration: none !important;
	color: var(--qrph-muted, #6b6b6b) !important;
	line-height: 1.4 !important;
	margin: 0 !important;
}


/* State visibility — class driven so it wins over theme + inline styles */

.qrph-fields .qrph-dropzone.has-file .qrph-dz-idle,
.qrph-followup .qrph-dropzone.has-file .qrph-dz-idle {
	display: none !important;
}

.qrph-fields .qrph-dropzone:not(.has-file) .qrph-dz-preview,
.qrph-followup .qrph-dropzone:not(.has-file) .qrph-dz-preview {
	display: none !important;
}

/* ---------------------------------------------------------- preview state */

.qrph-fields .qrph-dz-preview,
.qrph-followup .qrph-dz-preview {
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	gap: 12px !important;
	padding: 12px !important;
	margin: 0 !important;
	position: relative !important;
}

.qrph-dz-preview[hidden] {
	display: none;
}

.qrph-fields .qrph-dz-thumb,
.qrph-followup .qrph-dz-thumb {
	display: block !important;
	width: 52px !important;
	height: 52px !important;
	max-width: 52px !important;
	flex: 0 0 52px !important;
	object-fit: cover;
	border-radius: 6px !important;
	background: #f2f2f2;
	border: 1px solid rgba(0, 0, 0, 0.1) !important;
	margin: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
}

.qrph-dz-thumb.is-doc {
	object-fit: contain;
	padding: 10px;
	background: #f4f5f7;
}

.qrph-fields .qrph-dz-meta,
.qrph-followup .qrph-dz-meta {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 2px !important;
	margin: 0 !important;
	padding: 0 !important;
	text-align: left !important;
}

.qrph-fields .qrph-dz-name,
.qrph-followup .qrph-dz-name {
	display: block !important;
	color: var(--qrph-secondary, #000) !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	margin: 0 !important;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.qrph-fields .qrph-dz-size,
.qrph-followup .qrph-dz-size {
	display: block !important;
	font-size: 11px !important;
	font-weight: 400 !important;
	color: var(--qrph-muted, #6b6b6b) !important;
	margin: 0 !important;
	line-height: 1.3 !important;
}

.qrph-fields .qrph-dz-preview .qrph-dz-remove,
.qrph-followup .qrph-dz-preview .qrph-dz-remove {
	flex: 0 0 auto !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 5px !important;
	width: auto !important;
	height: 32px !important;
	min-height: 0 !important;
	padding: 0 12px !important;
	margin: 0 !important;
	border: 1px solid var(--qrph-primary, #c8102e) !important;
	border-radius: 6px !important;
	background: #fff !important;
	background-image: none !important;
	color: var(--qrph-primary, #c8102e) !important;
	font-size: 12px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	text-decoration: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	cursor: pointer !important;
	z-index: 3;
	transition: background-color 0.15s ease, color 0.15s ease !important;
}

.qrph-fields .qrph-dz-preview .qrph-dz-remove::before,
.qrph-followup .qrph-dz-preview .qrph-dz-remove::before {
	content: '\00d7';
	font-size: 16px;
	line-height: 1;
	color: inherit;
}

.qrph-fields .qrph-dz-preview .qrph-dz-remove:hover,
.qrph-fields .qrph-dz-preview .qrph-dz-remove:focus-visible,
.qrph-followup .qrph-dz-preview .qrph-dz-remove:hover,
.qrph-followup .qrph-dz-preview .qrph-dz-remove:focus-visible {
	background: var(--qrph-primary, #c8102e) !important;
	border-color: var(--qrph-primary, #c8102e) !important;
	color: #fff !important;
}

/* progress bar */

.qrph-dz-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(0, 0, 0, 0.07);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.qrph-fields .qrph-dropzone.is-uploading .qrph-dz-bar,
.qrph-followup .qrph-dropzone.is-uploading .qrph-dz-bar {
	opacity: 1;
}

.qrph-dz-bar span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--qrph-primary, #c8102e);
	transition: width 0.2s ease;
}

/* --------------------------------------------------------- amount to pay */

.qrph-fields .qrph-amount,
.qrph-followup .qrph-amount {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 4px;
	padding: 12px 14px;
	border: 1px solid var(--qrph-primary, #c8102e);
	border-left: 4px solid var(--qrph-primary, #c8102e);
	border-radius: 0;
	background: var(--qrph-primary-soft, rgba(200, 16, 46, 0.07));
}

.qrph-fields .qrph-amount-label,
.qrph-followup .qrph-amount-label {
	font-size: 0.85em;
	font-weight: 500;
	color: var(--qrph-secondary, #000);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.qrph-fields .qrph-amount-value,
.qrph-followup .qrph-amount-value {
	font-size: 1.3em !important;
	font-weight: 700;
	color: var(--qrph-primary, #c8102e);
	line-height: 1.2;
	white-space: nowrap;
}

.qrph-amount-value .woocommerce-Price-currencySymbol {
	font-size: 0.75em;
	vertical-align: baseline;
	margin-right: 1px;
}

/* ------------------------------------------------------------ status line */

.qrph-fields .qrph-status,
.qrph-followup .qrph-status {
	display: block !important;
	font-size: 0.82em;
	margin-top: 6px;
	line-height: 1.4;
	color: var(--qrph-muted, #6b6b6b);
	min-height: 1.2em;
}

.qrph-status.is-ok {
	color: var(--qrph-ok, #1a7f37);
	font-weight: 500;
}

.qrph-status.is-error {
	color: var(--qrph-err, #c8102e);
	font-weight: 500;
}

/* ------------------------------------------------------- reference number */

.qrph-fields .form-row input[type='text'] {
	border-radius: 8px;
}

/* --------------------------------------------------------------- mobile */

@media (max-width: 480px) {
	.qrph-dz-idle {
		padding: 20px 12px;
	}

	.qrph-dz-thumb {
		width: 44px;
		height: 44px;
		flex-basis: 44px;
	}
}

/* Dark themes */
@media (prefers-color-scheme: dark) {
	.qrph-dropzone {
		background: rgba(255, 255, 255, 0.04);
		border-color: rgba(255, 255, 255, 0.22);
	}

	.qrph-dz-thumb {
		background: rgba(255, 255, 255, 0.08);
	}

	.qrph-dz-remove {
		background: transparent;
		border-color: rgba(255, 255, 255, 0.28);
		color: #eee;
	}
}

/* ------------------------------------------------- branded field focus */

.qrph-fields input[type='text']:focus,
.qrph-fields .qrph-dropzone:focus-within {
	outline: none;
	border-color: var(--qrph-primary, #c8102e);
	box-shadow: 0 0 0 3px var(--qrph-primary-soft, rgba(200, 16, 46, 0.07));
}

.qrph-upload-label abbr.required {
	color: var(--qrph-primary, #c8102e);
	border: 0;
	text-decoration: none;
}
