/* Tlloancy People's Giftcard – gift card form and balance checker. Uses theme colours where it can. */
.tlpg-fields {
	display: grid;
	gap: 1rem;
	margin: 0 0 1.25rem;
	width: 100%;
}

.tlpg-fields p {
	margin: 0;
}

.tlpg-fields label,
.tlpg-fields legend {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
}

.tlpg-fields input[type="text"],
.tlpg-fields input[type="email"],
.tlpg-fields input[type="number"],
.tlpg-fields input[type="date"],
.tlpg-fields textarea {
	font: inherit;
	width: 100%;
	max-width: 26rem;
	box-sizing: border-box;
}

.tlpg-fields input[type="number"] {
	max-width: 10rem;
}

.tlpg-hint {
	display: block;
	margin-top: 0.3rem;
	font-size: 0.875em;
	opacity: 0.75;
}

.tlpg-presets {
	border: 0;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.tlpg-presets legend {
	width: 100%;
	padding: 0;
}

.tlpg-chip {
	position: relative;
	margin: 0 !important;
	font-weight: 600;
	cursor: pointer;
}

.tlpg-chip input {
	position: absolute;
	opacity: 0;
	inset: 0;
	cursor: pointer;
}

.tlpg-chip > span {
	display: inline-block;
	min-width: 4.5rem;
	padding: 0.65rem 1rem;
	text-align: center;
	border: 2px solid currentColor;
	border-radius: 999px;
	opacity: 0.65;
	transition: opacity 0.15s, background-color 0.15s;
}

.tlpg-chip:hover > span {
	opacity: 1;
}

.tlpg-chip input:focus-visible + span {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.tlpg-chip input:checked + span {
	opacity: 1;
	background: rgba(127, 127, 127, 0.2);
	box-shadow: 0 0 0 2px currentColor;
}

.tlpg-count {
	text-align: right;
	font-size: 0.8em;
	opacity: 0.7;
}

/* Balance checker */
.tlpg-balance-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.tlpg-balance-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.tlpg-balance-row input {
	flex: 1 1 14rem;
	font: inherit;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.tlpg-balance-card {
	margin-top: 1rem;
	padding: 1.25rem 1.5rem;
	border-radius: 12px;
	background: #14213d;
	color: #fff;
}

.tlpg-balance-amount {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.1;
}

.tlpg-balance-amount .amount,
.tlpg-balance-amount bdi {
	color: inherit;
}

.tlpg-balance-meta {
	margin-top: 0.35rem;
	opacity: 0.85;
}

.tlpg-note {
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	background: rgba(127, 127, 127, 0.12);
}

.tlpg-note--error {
	border-left: 4px solid #b32d2e;
}

/* Chip internals: never style the price's own spans. */
.tlpg-chip > span * {
	border: 0;
	background: none;
	padding: 0;
	margin: 0;
	box-shadow: none;
	color: inherit;
	font: inherit;
}

/* Fields follow the theme: light border, flat corners, no heavy default look. */
.tlpg-fields input[type="text"],
.tlpg-fields input[type="email"],
.tlpg-fields input[type="number"],
.tlpg-fields input[type="date"],
.tlpg-fields textarea {
	padding: 0.7rem 0.8rem;
	border: 1px solid currentColor;
	border-color: rgba(127, 127, 127, 0.4);
	border-radius: 0;
	background: rgba(255, 255, 255, 0.55);
	color: inherit;
	font: inherit;
	box-shadow: none;
}

.tlpg-fields input:focus,
.tlpg-fields textarea:focus {
	outline: none;
	border-color: currentColor;
}

.tlpg-fields label,
.tlpg-fields legend {
	font-size: 0.78em;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.tlpg-chip > span {
	border-width: 1px;
	opacity: 1;
	border-color: rgba(127, 127, 127, 0.45);
	color: inherit;
}

.tlpg-chip:hover > span {
	border-color: currentColor;
}

.tlpg-chip input:checked + span {
	background: #2a241c;
	color: #fffdf9;
	border-color: #2a241c;
	box-shadow: none;
}

/* Express wallet buttons skip this form (amount, recipient, message): hide them. */
.tlpg-gift-product .wc_stripe_product_payment_methods,
.tlpg-gift-product .wcpay-express-checkout-wrapper,
.tlpg-gift-product .wc-block-components-express-payment {
	display: none !important;
}

/* Delivery choice */
.tlpg-delivery {
	border: 0;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.4rem;
}

.tlpg-delivery legend {
	padding: 0;
}

.tlpg-fields .tlpg-opt {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0;
	font-size: 1em;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
}

.tlpg-when-email[hidden],
.tlpg-when-later[hidden],
.tlpg-design[hidden],
.tlpg-card-art[hidden],
.tlpg-card-msg[hidden],
.tlpg-preview[hidden] {
	display: none !important;
}

/* Design gallery */
.tlpg-designs {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.tlpg-designs legend {
	padding: 0;
}

.tlpg-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 0.75rem;
}

.tlpg-tab {
	font: inherit;
	font-size: 0.85em;
	padding: 0.4rem 0.9rem;
	border: 1px solid rgba(127, 127, 127, 0.5);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.tlpg-tab.is-active {
	border-color: currentColor;
	background: rgba(127, 127, 127, 0.2);
	font-weight: 600;
}

.tlpg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
	gap: 0.75rem;
}

.tlpg-fields .tlpg-design {
	position: relative;
	display: block;
	margin: 0;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
}

.tlpg-design input {
	position: absolute;
	opacity: 0;
	inset: 0;
	cursor: pointer;
}

.tlpg-design img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border: 2px solid transparent;
	border-radius: 6px;
	opacity: 0.8;
	transition: opacity 0.15s, border-color 0.15s;
}

.tlpg-design:hover img {
	opacity: 1;
}

.tlpg-design input:focus-visible + img {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

.tlpg-design input:checked + img {
	opacity: 1;
	border-color: currentColor;
	box-shadow: 0 0 0 2px rgba(127, 127, 127, 0.35);
}

.tlpg-design-name {
	display: block;
	margin-top: 0.3rem;
	font-size: 0.85em;
	text-align: center;
}

/* Live preview */
.tlpg-preview-title {
	margin: 0 0 0.4rem !important;
	font-size: 0.78em;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.tlpg-card {
	max-width: 26rem;
	overflow: hidden;
	border-radius: 12px;
	background: #14213d;
	color: #fff;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.tlpg-card-art {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.tlpg-card-body {
	padding: 1rem 1.25rem 1.25rem;
	text-align: center;
}

.tlpg-card-store {
	font-size: 0.75em;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.75;
}

.tlpg-card-amount {
	margin: 0.25rem 0;
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.2;
}

.tlpg-card-to,
.tlpg-card-from {
	font-size: 0.95em;
}

.tlpg-card-msg {
	margin: 0.6rem 0;
	padding: 0.5rem 0.75rem;
	border: 0;
	border-left: 3px solid #c9a227;
	background: rgba(255, 255, 255, 0.08);
	color: inherit;
	font-style: italic;
	font-size: 0.9em;
	text-align: left;
	white-space: pre-line;
	overflow-wrap: anywhere;
}

.tlpg-card-code {
	display: inline-block;
	margin-top: 0.75rem;
	padding: 0.4rem 0.9rem;
	border: 2px dashed #c9a227;
	border-radius: 8px;
	font-family: Menlo, Consolas, monospace;
	letter-spacing: 0.08em;
	color: #fcd34d;
}
