/*
 * Payment panel styles.
 *
 * This panel renders inside the WooCommerce order-pay page, where theme,
 * WooCommerce, and POS-template CSS all apply — including high-specificity
 * rules like `.woocommerce-page #payment .button { … !important }`. Every
 * selector is therefore anchored on the container id (beating class-based
 * theme selectors) and every visual property a theme commonly stomps is set
 * explicitly with !important. Keep it that way when editing: a property left
 * to inheritance here is a property the theme decides.
 *
 * The hostile-theme toggle in tests/ui-preview/render.php exists to verify
 * this hardening — check the preview with it enabled after any change.
 */

#mtfwc-payment-interface#mtfwc-payment-interface,
#mtfwc-payment-interface#mtfwc-payment-interface * {
	box-sizing: border-box !important;
	text-shadow: none !important;
	font-style: normal !important;
	text-decoration: none !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface {
	display: block !important;
	border: 1px solid #d6d8dc !important;
	border-radius: 10px !important;
	margin: 1rem 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	background: #fff !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
	font-size: 14px !important;
	line-height: 1.45 !important;
	color: #0f172a !important;
	text-align: left !important;
	float: none !important;
	width: auto !important;
	max-width: none !important;
	box-shadow: none !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-card {
	padding: 1rem !important;
	margin: 0 !important;
	background: #f8fafc !important;
	border: 0 !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-card h4,
#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-logging-header h4 {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	color: #0f172a !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	border: 0 !important;
	background: none !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-help {
	margin: .35rem 0 0 !important;
	padding: 0 !important;
	color: #64748b !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	line-height: 1.45 !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-terminal-field {
	display: flex !important;
	flex-direction: column !important;
	gap: .3rem !important;
	margin: .875rem 0 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-terminal-label {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	font-weight: 600 !important;
	font-size: 13px !important;
	line-height: 1.3 !important;
	color: #334155 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-terminal-select {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: .5rem .6rem !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 8px !important;
	background: #fff !important;
	background-image: none !important;
	color: #0f172a !important;
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	text-transform: none !important;
	box-shadow: none !important;
	-webkit-appearance: menulist !important;
	-moz-appearance: menulist !important;
	appearance: auto !important;
	cursor: pointer !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-terminal-select:focus {
	outline: 2px solid #93c5fd !important;
	outline-offset: 1px !important;
	border-color: #2563eb !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-terminal-select[aria-busy="true"],
#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-terminal-select:disabled {
	opacity: .65 !important;
	background: #f1f5f9 !important;
	cursor: default !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-actions {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: .5rem !important;
	margin: .875rem 0 0 !important;
	padding: 0 !important;
}

/* A single primary button toggles between Start and Cancel (data-mtfwc-mode).
   Styled explicitly so no theme button rule survives. */
#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-actions .button {
	display: inline-block !important;
	float: none !important;
	width: auto !important;
	min-height: 0 !important;
	height: auto !important;
	margin: 0 !important;
	padding: .6rem .9rem !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 8px !important;
	background: #fff !important;
	background-image: none !important;
	color: #0f172a !important;
	font-family: inherit !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	text-decoration: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
	cursor: pointer !important;
	transition: background-color .15s ease, opacity .15s ease !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-actions .button:hover:not(:disabled) {
	background: #f1f5f9 !important;
	color: #0f172a !important;
	border-color: #cbd5e1 !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-actions .mtfwc-primary-action {
	flex: 1 1 auto !important;
	background: #1d4ed8 !important;
	border-color: #1d4ed8 !important;
	color: #fff !important;
	font-size: 14px !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-actions .mtfwc-primary-action:hover:not(:disabled) {
	background: #1e40af !important;
	border-color: #1e40af !important;
	color: #fff !important;
}

/* Cancel mode: the same button reskinned so it reads as a stop action, not a
   call to action, while a payment is in flight. */
#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-actions .mtfwc-primary-action[data-mtfwc-mode="cancel"] {
	background: #fff !important;
	border-color: #dc2626 !important;
	color: #b91c1c !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-actions .mtfwc-primary-action[data-mtfwc-mode="cancel"]:hover:not(:disabled) {
	background: #fef2f2 !important;
	border-color: #dc2626 !important;
	color: #b91c1c !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-actions .button:disabled {
	opacity: .55 !important;
	cursor: not-allowed !important;
}

/* The status line is the cashier's main feedback — render it as a banner. */
#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-status {
	display: block !important;
	margin: .875rem 0 0 !important;
	padding: .65rem .8rem !important;
	border: 1px solid transparent !important;
	border-radius: 8px !important;
	background: none !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	text-transform: none !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-status:empty {
	display: none !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-status-info { color: #1e40af !important; background: #eff6ff !important; border-color: #bfdbfe !important; }
#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-status-success { color: #065f46 !important; background: #ecfdf5 !important; border-color: #a7f3d0 !important; }
#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-status-error { color: #991b1b !important; background: #fef2f2 !important; border-color: #fecaca !important; }
#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-status-warning { color: #92400e !important; background: #fffbeb !important; border-color: #fde68a !important; }

/* Spinner while a payment is in flight (waiting on the terminal). */
#mtfwc-payment-interface#mtfwc-payment-interface[data-mtfwc-busy="true"] .mtfwc-payment-status::before {
	content: '' !important;
	display: inline-block !important;
	width: 13px !important;
	height: 13px !important;
	margin-right: .5rem !important;
	border: 2px solid currentcolor !important;
	border-top-color: transparent !important;
	border-radius: 50% !important;
	vertical-align: -2px !important;
	animation: mtfwc-spin .8s linear infinite !important;
}

@keyframes mtfwc-spin {
	to { transform: rotate(360deg); }
}

/* Logs are a support tool — keep them present but visually quiet. */
#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-logging-section {
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	background: #f8fafc !important;
	color: #334155 !important;
	border: 0 !important;
	border-top: 1px solid #e2e8f0 !important;
}

/* Log tools disabled in settings: the textarea stays in the DOM (JS writes to
   it) but the whole section is hidden so no empty bordered strip shows. */
#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-logging-section.mtfwc-logging-hidden {
	display: none !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-logging-header {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 1rem !important;
	margin: 0 !important;
	padding: .5rem 1rem !important;
	background: none !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-logging-header h4 {
	font-size: 12px !important;
	text-transform: uppercase !important;
	letter-spacing: .04em !important;
	color: #64748b !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-logging-actions {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: .4rem !important;
	margin: 0 !important;
	padding: 0 !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-logging-actions .button {
	display: inline-block !important;
	float: none !important;
	width: auto !important;
	min-height: 26px !important;
	height: auto !important;
	margin: 0 !important;
	padding: .25rem .6rem !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 6px !important;
	background: #fff !important;
	background-image: none !important;
	color: #334155 !important;
	font-family: inherit !important;
	font-size: 12px !important;
	font-weight: 400 !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	text-decoration: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
	cursor: pointer !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-logging-actions .button:hover {
	background: #f1f5f9 !important;
	color: #334155 !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-log-content {
	margin: 0 !important;
	padding: 0 1rem 1rem !important;
	background: none !important;
}

#mtfwc-payment-interface#mtfwc-payment-interface .mtfwc-payment-log-textarea {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	min-height: 180px !important;
	margin: 0 !important;
	padding: .75rem !important;
	border: 1px solid #334155 !important;
	border-radius: 6px !important;
	background: #020617 !important;
	color: #d1fae5 !important;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace !important;
	font-size: 12px !important;
	line-height: 1.45 !important;
	text-transform: none !important;
	box-shadow: none !important;
	resize: vertical !important;
	opacity: 1 !important;
}
