/* TGP gift card builder. Theme-neutral; override the variables on .tgp-gcb. */
.tgp-gcb {
	--gcb-accent: #111;
	--gcb-accent-text: #fff;
	--gcb-border: #d0d0d0;
	--gcb-muted: #666;
	--gcb-radius: 10px;
	--gcb-card-radius: 18px;
	--gcb-brand: linear-gradient(90deg, #0a6fc2 0%, #6a3fa0 45%, #e0197d 75%, #ee2a3c 100%);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 48px;
	max-width: 1180px;
	margin: 48px auto 60px;
	align-items: start;
	color: #111;
}

.tgp-gcb__step { border: 0; margin: 0 0 28px; padding: 0; min-width: 0; }
.tgp-gcb__step[hidden] { display: none; }
.tgp-gcb__step legend { font-size: 18px; font-weight: 700; margin: 0 0 12px; padding: 0; display: flex; align-items: center; gap: 10px; }
.tgp-gcb__n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gcb-accent); color: var(--gcb-accent-text); font-size: 13px; }

.tgp-gcb input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgp-gcb label { cursor: pointer; }

.tgp-gcb__formats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tgp-gcb__choice span { display: block; height: 100%; box-sizing: border-box; padding: 14px 16px; border: 2px solid var(--gcb-border); border-radius: var(--gcb-radius); transition: border-color .15s, box-shadow .15s; }
.tgp-gcb__choice strong { display: block; font-size: 16px; margin-bottom: 4px; }
.tgp-gcb__choice small { color: var(--gcb-muted); font-size: 13px; line-height: 1.35; display: block; }
.tgp-gcb__choice input:checked + span { border-color: var(--gcb-accent); box-shadow: 0 0 0 1px var(--gcb-accent); }
.tgp-gcb__choice input:focus-visible + span, .tgp-gcb__pill:has(input:focus-visible), .tgp-gcb__design:has(input:focus-visible) { outline: 2px solid #1565c0; outline-offset: 2px; }

.tgp-gcb__amounts, .tgp-gcb__when { display: flex; flex-wrap: wrap; gap: 10px; }
.tgp-gcb__pill { display: inline-flex; align-items: center; padding: 10px 18px; border: 2px solid var(--gcb-border); border-radius: 999px; font-weight: 600; transition: background .15s, border-color .15s, color .15s; }
.tgp-gcb__pill:has(input:checked) { background: var(--gcb-accent); border-color: var(--gcb-accent); color: var(--gcb-accent-text); }
.tgp-gcb__other { margin-top: 12px; }
.tgp-gcb__other label, .tgp-gcb__grid label, .tgp-gcb__step > p > label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.tgp-gcb__pay { margin: 10px 0 0; font-weight: 600; color: #2e7d32; }

.tgp-gcb input[type=text], .tgp-gcb input[type=email], .tgp-gcb input[type=number], .tgp-gcb input[type=date], .tgp-gcb textarea {
	width: 100%; box-sizing: border-box; font-size: 16px; padding: 10px 12px; border: 1px solid #999; border-radius: 6px; background: #fff; color: #111;
}
.tgp-gcb input:focus, .tgp-gcb textarea:focus { outline: 2px solid #1565c0; outline-offset: 1px; border-color: #111; }
.tgp-gcb__other input { max-width: 200px; }
.tgp-gcb__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tgp-gcb__grid p { margin: 0 0 12px; }
.tgp-gcb__grid p[hidden] { display: none; }
.tgp-gcb__opt { font-weight: 400; color: var(--gcb-muted); }
.tgp-gcb__count { display: block; text-align: right; font-size: 12px; color: var(--gcb-muted); margin-top: 4px; }
.tgp-gcb__date { margin: 12px 0 0; max-width: 220px; }

.tgp-gcb__designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.tgp-gcb__design img { display: block; width: 100%; aspect-ratio: 1.586; object-fit: cover; border-radius: 8px; border: 3px solid transparent; box-sizing: border-box; transition: border-color .15s; }
.tgp-gcb__design:has(input:checked) img { border-color: var(--gcb-accent); }
.tgp-gcb__design-label { display: block; margin-top: 4px; font-size: 12px; line-height: 1.3; text-align: center; color: var(--gcb-muted); }
.tgp-gcb__design:has(input:checked) .tgp-gcb__design-label { color: #111; font-weight: 600; }

.tgp-gcb__errors { background: #fdecea; border-left: 4px solid #c62828; padding: 10px 14px; margin: 0 0 16px; }
.tgp-gcb__errors p { margin: 4px 0; }
.tgp-gcb__submit { width: 100%; padding: 16px; font-size: 17px; font-weight: 700; border: 0; border-radius: var(--gcb-radius); background: var(--gcb-accent); color: var(--gcb-accent-text); cursor: pointer; }
.tgp-gcb__submit:disabled { opacity: .6; cursor: wait; }
.tgp-gcb__note { font-size: 13px; color: var(--gcb-muted); margin: 12px 0 0; }

/* Preview */
.tgp-gcb__preview { position: sticky; top: 110px; }
.tgp-gcb__card { position: relative; aspect-ratio: 1.586; border-radius: var(--gcb-card-radius); overflow: hidden; background: #15151a; box-shadow: 0 18px 40px rgba(0, 0, 0, .25); color: #fff; }
.tgp-gcb__card-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: background-image .2s; }
.tgp-gcb--plain .tgp-gcb__card-bg { background: radial-gradient(120% 90% at 85% 10%, #3a2a6e 0%, #15151a 55%); }
.tgp-gcb__card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 55%; background: linear-gradient(to top, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0)); pointer-events: none; }
.tgp-gcb--plain .tgp-gcb__card::before { content: ""; position: absolute; left: 7%; right: 7%; top: 50%; height: 3px; background: var(--gcb-brand); border-radius: 3px; opacity: .9; }
.tgp-gcb__logo { position: absolute; left: 7%; top: 9%; width: 44%; height: auto; z-index: 2; }
.tgp-gcb__card-bottom { position: absolute; left: 7%; bottom: 9%; z-index: 2; display: flex; flex-direction: column; }
.tgp-gcb__card-label { font-size: clamp(11px, 1.3vw, 14px); letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.tgp-gcb__card-amount { font-size: clamp(30px, 4.4vw, 52px); font-weight: 800; line-height: 1.05; }
.tgp-gcb__card-to { position: absolute; right: 7%; bottom: 9%; z-index: 2; max-width: 45%; text-align: right; font-size: clamp(12px, 1.4vw, 15px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgp-gcb--print .tgp-gcb__logo, .tgp-gcb--print .tgp-gcb__card-bottom, .tgp-gcb--print .tgp-gcb__card-to, .tgp-gcb--print .tgp-gcb__card::after { display: none; }
.tgp-gcb__msg-preview { margin-top: 18px; padding: 16px 18px; border-radius: var(--gcb-radius); background: #f6f6f7; }
.tgp-gcb__msg-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; font-style: italic; }
.tgp-gcb__msg-from { margin: 8px 0 0; text-align: right; color: var(--gcb-muted); }

@media (max-width: 900px) {
	.tgp-gcb { grid-template-columns: 1fr; gap: 24px; margin-top: 24px; }
	.tgp-gcb__preview { position: static; order: -1; }
	.tgp-gcb__msg-preview { display: none; }
}
@media (max-width: 520px) {
	.tgp-gcb__formats, .tgp-gcb__grid { grid-template-columns: 1fr; }
	.tgp-gcb__pill { padding: 9px 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.tgp-gcb * { transition: none !important; }
}
