/**
 * DoitPay — checkout field styling (classic + blocks).
 *
 * Mobile-first, responsive and touch-friendly. Inputs are ≥44px tall for
 * comfortable tapping; the card form reflows to a single column on phones.
 *
 * @package DoitPay_Payment_Gateway
 */

/* ── Shared form scaffold ─────────────────────────────────────────────── */
.doitpay-card-form,
.doitpay-wallet-form,
.doitpay-local-form {
	border: 0;
	margin: 0;
	padding: 4px 0 0;
	max-width: 460px;
}

.doitpay-field {
	margin: 0 0 14px;
}

.doitpay-field > label,
.doitpay-blocks-field > label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--dp-label, #3c434a);
}

.doitpay-req {
	color: #d63638;
}

/* Inputs / selects — unified look, large touch targets */
.doitpay-card-form input,
.doitpay-wallet-form input,
.doitpay-wallet-form select,
.doitpay-local-form select,
.doitpay-blocks-input {
	box-sizing: border-box;
	width: 100%;
	min-height: 46px;
	padding: 11px 14px;
	font-size: 16px; /* 16px stops iOS zoom-on-focus */
	line-height: 1.4;
	color: #1e1e1e;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 10px;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.doitpay-card-form input:focus,
.doitpay-wallet-form input:focus,
.doitpay-wallet-form select:focus,
.doitpay-local-form select:focus,
.doitpay-blocks-input:focus {
	outline: 0;
	border-color: var(--dp-accent, #3858e9);
	box-shadow: 0 0 0 3px rgba(56, 88, 233, .15);
}

.doitpay-card-form input::placeholder,
.doitpay-blocks-input::placeholder {
	color: #9aa0a6;
}

/* ── Card number with brand badge ─────────────────────────────────────── */
.doitpay-input-wrap {
	position: relative;
}

.doitpay-input-wrap input {
	padding-right: 56px;
	letter-spacing: .04em;
	font-variant-numeric: tabular-nums;
}

.doitpay-card-brand {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	width: 34px;
	height: 22px;
	border-radius: 4px;
	background: #f0f0f1 center/contain no-repeat;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: .02em;
	color: #50575e;
	display: flex;
	align-items: center;
	justify-content: center;
	text-transform: uppercase;
}

.doitpay-card-brand[data-brand]::after {
	content: attr(data-brand);
}

.doitpay-card-brand[data-brand="visa"] { background: #1a1f71; color: #fff; }
.doitpay-card-brand[data-brand="mastercard"] { background: #1a1a1a; color: #ff5f00; }
.doitpay-card-brand[data-brand="amex"] { background: #2e77bb; color: #fff; }
.doitpay-card-brand[data-brand="mir"] { background: #0f754b; color: #fff; }
.doitpay-card-brand[data-brand="discover"] { background: #e6731b; color: #fff; }

/* ── Expiry + CVC row ─────────────────────────────────────────────────── */
.doitpay-row,
.doitpay-blocks-row {
	display: flex;
	gap: 12px;
}

.doitpay-row .doitpay-field {
	flex: 1 1 0;
	min-width: 0;
}

.doitpay-expiry {
	display: flex;
	align-items: center;
	gap: 6px;
}

.doitpay-expiry input {
	text-align: center;
}

.doitpay-sep {
	color: #9aa0a6;
	font-weight: 600;
}

/* ── Secure note ──────────────────────────────────────────────────────── */
.doitpay-secure-note {
	margin: 2px 0 0;
	font-size: 12px;
	color: #646970;
	display: flex;
	align-items: center;
	gap: 6px;
}

.doitpay-secure-note::before {
	content: "";
	width: 13px;
	height: 13px;
	flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1 4 5v6c0 5 3.4 9.7 8 11 4.6-1.3 8-6 8-11V5l-8-4zm0 10h6c-.5 3.9-3 7.3-6 8.3V12H6V6.3l6-3v7.7z'/%3E%3C/svg%3E") center/contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1 4 5v6c0 5 3.4 9.7 8 11 4.6-1.3 8-6 8-11V5l-8-4zm0 10h6c-.5 3.9-3 7.3-6 8.3V12H6V6.3l6-3v7.7z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── Currency conversion note ─────────────────────────────────────────── */
.doitpay-fx-note {
	margin: 8px 0 0;
	padding: 8px 10px;
	font-size: 12.5px;
	line-height: 1.45;
	color: #2c5234;
	background: #edf7ed;
	border: 1px solid #cce5cc;
	border-radius: 8px;
}

/* ── Wallet / local single-field forms ────────────────────────────────── */
.doitpay-wallet-form,
.doitpay-local-form {
	padding-top: 6px;
}

/* ── Blocks-specific tidy-ups ─────────────────────────────────────────── */
.doitpay-blocks-field {
	margin: 0 0 14px;
}

.doitpay-blocks-card .doitpay-blocks-row .doitpay-blocks-field {
	flex: 1 1 0;
	min-width: 0;
}

/* ── Phone / small screens ────────────────────────────────────────────── */
@media (max-width: 480px) {
	.doitpay-card-form,
	.doitpay-wallet-form,
	.doitpay-local-form {
		max-width: 100%;
	}

	/* Keep expiry + CVC side by side (they're short), but allow shrinking. */
	.doitpay-row,
	.doitpay-blocks-row {
		gap: 10px;
	}

	.doitpay-card-form input,
	.doitpay-blocks-input,
	.doitpay-wallet-form select,
	.doitpay-local-form select {
		min-height: 48px; /* a touch bigger for thumbs */
	}
}

/* ── Dark-theme friendliness ──────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
	.doitpay-card-form input,
	.doitpay-wallet-form input,
	.doitpay-wallet-form select,
	.doitpay-local-form select,
	.doitpay-blocks-input {
		background: #1e1e1e;
		color: #f0f0f1;
		border-color: #4b4b4b;
	}
	.doitpay-field > label,
	.doitpay-blocks-field > label {
		color: #e0e0e0;
	}
}
