/* Gutschein-Komponente – Frontend-Styles */

.gutschein-wrap {
	max-width: 760px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #2b2b2b;
	line-height: 1.5;
}

.gutschein-title {
	font-size: 2rem;
	margin-bottom: .25rem;
	color: #9b1b1b;
}

.gutschein-intro {
	color: #666;
	margin-bottom: 2rem;
}

.gutschein-form .gutschein-step {
	border: 1px solid #e8e3da;
	border-radius: 10px;
	padding: 1.25rem 1.5rem 1.5rem;
	margin: 0 0 1.5rem;
	background: #fff;
}

.gutschein-step legend {
	font-size: 1.1rem;
	font-weight: 600;
	padding: 0 .5rem;
	color: #2b2b2b;
	display: flex;
	align-items: center;
	gap: .5rem;
	width: auto;
	border: none;
	margin: 0;
}

.gutschein-step-no {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.7rem;
	height: 1.7rem;
	border-radius: 50%;
	background: #9b1b1b;
	color: #fff;
	font-size: .9rem;
	font-weight: 700;
}

.gutschein-optional {
	font-weight: 400;
	color: #999;
	font-size: .85rem;
}

/* --- Schrittweiser Aufbau (greift nur mit aktivem JS: .gv-js) --- */
.gv-js .gutschein-step-pending { display: none; }
.gv-js .gutschein-step-locked > :not(legend) { display: none; }

.gv-js .gutschein-step-locked {
	background: #fbfaf8;
	border-style: dashed;
	padding-bottom: .9rem;
	opacity: .7;
}

.gv-js .gutschein-step-locked legend { color: #a9a294; }
.gv-js .gutschein-step-locked .gutschein-step-no { background: #c9c2b6; }

.gutschein-step-open { animation: gv-step-open .4s ease; }

@keyframes gv-step-open {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: none; }
}

/* „Weiter“-Schaltflaeche unter dem optionalen Schritt 4 */
.gutschein-step-next { display: none; margin-top: .25rem; }
.gv-js .gutschein-step-next { display: block; }

.gutschein-btn-next {
	background: #fff;
	border: 2px solid #9b1b1b;
	color: #9b1b1b;
	border-radius: 8px;
	padding: .55rem 1.5rem;
	font-size: .95rem;
	font-weight: 600;
	cursor: pointer;
	transition: all .15s ease;
}

.gutschein-btn-next:hover {
	background: #9b1b1b;
	color: #fff;
}

/* Betraege */
.gutschein-amounts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: .75rem;
}

.gutschein-amount-option,
.gutschein-pay-option,
.gutschein-template-option {
	position: relative;
	cursor: pointer;
	margin: 0;
}

.gutschein-amount-option input,
.gutschein-pay-option input,
.gutschein-template-option input {
	position: absolute;
	opacity: 0;
	inset: 0;
	cursor: pointer;
}

.gutschein-amount-label {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: .9rem .5rem;
	border: 2px solid #e0d8cc;
	border-radius: 8px;
	font-weight: 600;
	transition: all .15s ease;
	text-align: center;
}

.gutschein-amount-option input:checked + .gutschein-amount-label {
	border-color: #9b1b1b;
	background: #fbf2f2;
	color: #9b1b1b;
}

.gutschein-custom-field {
	margin-top: 1rem;
}

.gutschein-input-euro {
	display: flex;
	align-items: center;
	max-width: 200px;
	border: 2px solid #e0d8cc;
	border-radius: 8px;
	overflow: hidden;
}

.gutschein-input-euro input {
	border: none;
	padding: .7rem;
	font-size: 1.1rem;
	width: 100%;
	outline: none;
}

.gutschein-input-euro span {
	padding: 0 .9rem;
	background: #f7f4ef;
	align-self: stretch;
	display: flex;
	align-items: center;
	font-weight: 600;
}

/* Zahlungsarten */
.gutschein-payments {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .75rem;
}

.gutschein-pay-body {
	display: block;
	padding: 1rem 1.1rem;
	border: 2px solid #e0d8cc;
	border-radius: 8px;
	transition: all .15s ease;
}

.gutschein-pay-body strong {
	display: block;
	margin-bottom: .25rem;
}

.gutschein-pay-body small {
	color: #777;
	font-size: .82rem;
}

.gutschein-pay-option input:checked + .gutschein-pay-body {
	border-color: #9b1b1b;
	background: #fbf2f2;
}

.gutschein-badge {
	display: inline-block;
	background: #1f7a3d;
	color: #fff;
	font-style: normal;
	font-size: .72rem;
	font-weight: 700;
	padding: .1rem .45rem;
	border-radius: 20px;
	margin-left: .35rem;
	vertical-align: middle;
}

.gutschein-price-summary {
	margin-top: 1rem;
	padding: .8rem 1rem;
	background: #f7f4ef;
	border-radius: 8px;
	font-size: .95rem;
	display: none;
}

.gutschein-price-summary.active {
	display: block;
}

.gutschein-field-error:not(:empty) {
	margin-top: .75rem;
	padding: .6rem .9rem;
	background: #fdecea;
	border: 1px solid #f3c6c0;
	border-radius: 8px;
	color: #9b1b1b;
	font-size: .9rem;
	font-weight: 600;
}

/* Sanfter Puls auf dem Element, zu dem nach einem Fehler gescrollt wurde */
.gutschein-err-target { animation: gv-err-pulse 1.2s ease-out 1; }

@keyframes gv-err-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(155, 27, 27, .4); }
	100% { box-shadow: 0 0 0 12px rgba(155, 27, 27, 0); }
}

.gutschein-price-summary .pay {
	font-weight: 700;
	color: #9b1b1b;
	font-size: 1.15rem;
}

/* Vorlagen */
.gutschein-templates {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: .9rem;
}

.gutschein-template-preview {
	display: flex;
	align-items: flex-end;
	height: 110px;
	border-radius: 8px;
	border: 3px solid transparent;
	padding: .6rem;
	transition: all .15s ease;
	box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.gutschein-template-option input:checked + .gutschein-template-preview {
	border-color: #9b1b1b;
	box-shadow: 0 2px 10px rgba(155,27,27,.25);
}

.gutschein-template-name {
	background: rgba(255,255,255,.85);
	padding: .2rem .55rem;
	border-radius: 5px;
	font-size: .8rem;
	font-weight: 600;
	color: #333;
}

.gutschein-tpl-elegant { background: linear-gradient(135deg, #2b2b2b, #5a4a3a); }
.gutschein-tpl-festive { background: linear-gradient(135deg, #9b1b1b, #d4a017); }
.gutschein-tpl-minimal { background: #f3f1ec; border: 1px solid #ddd; }
.gutschein-tpl-minimal .gutschein-template-name { background: #fff; }
.gutschein-tpl-japan   { background: linear-gradient(135deg, #1c1c1c 0%, #1c1c1c 60%, #9b1b1b 60%, #9b1b1b 100%); }

/* Felder */
.gutschein-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.gutschein-field {
	margin-bottom: 1rem;
}

.gutschein-field label {
	display: block;
	font-weight: 600;
	margin-bottom: .35rem;
	font-size: .9rem;
}

.gutschein-field input,
.gutschein-field textarea {
	width: 100%;
	padding: .65rem .8rem;
	border: 2px solid #e0d8cc;
	border-radius: 8px;
	font-size: 1rem;
	outline: none;
	box-sizing: border-box;
}

.gutschein-field input:focus,
.gutschein-field textarea:focus,
.gutschein-input-euro:focus-within {
	border-color: #9b1b1b;
}

.req { color: #9b1b1b; }

.gutschein-msg-hint {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: .25rem .75rem;
	flex-wrap: wrap;
	font-size: .78rem;
	color: #999;
	margin-top: .35rem;
}

.gutschein-msg-counter {
	font-weight: 600;
	color: #777;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.gutschein-msg-counter.is-warn { color: #b87a00; }
.gutschein-msg-counter.is-full { color: #9b1b1b; }

/* Fehler-Banner (Fallback ohne JS) + Modal */
.gutschein-error-inline {
	background: #fdecea;
	border: 1px solid #f3c6c0;
	border-radius: 8px;
	padding: .8rem 1rem;
	color: #9b1b1b;
	margin-bottom: 1.5rem;
}
.gutschein-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 1rem;
}
.gutschein-modal {
	background: #fff;
	border-radius: 12px;
	max-width: 420px;
	width: 100%;
	padding: 2rem 1.75rem;
	text-align: center;
	box-shadow: 0 12px 44px rgba(0, 0, 0, .35);
}
.gutschein-modal-icon {
	width: 56px;
	height: 56px;
	line-height: 56px;
	border-radius: 50%;
	background: #fdecea;
	color: #9b1b1b;
	font-size: 30px;
	font-weight: 700;
	margin: 0 auto 1rem;
}
.gutschein-modal-title { font-size: 1.3rem; font-weight: 700; color: #9b1b1b; margin-bottom: .5rem; }
.gutschein-modal-msg { color: #444; margin-bottom: 1.5rem; line-height: 1.5; }
.gutschein-modal .gutschein-btn-submit { width: 100%; }

/* Honeypot (Spamschutz) – fuer Menschen unsichtbar */
.gutschein-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Absenden */
.gutschein-submit-row {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: stretch;
}

.gutschein-agb {
	display: flex;
	gap: .6rem;
	align-items: flex-start;
	font-size: .9rem;
	color: #555;
	cursor: pointer;
}

.gutschein-agb input { margin-top: .2rem; }

.gutschein-btn-submit {
	display: inline-block;
	background: #9b1b1b;
	color: #fff;
	border: none;
	padding: 1rem 2rem;
	font-size: 1.1rem;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: background .15s ease;
	text-decoration: none;
	text-align: center;
}

.gutschein-btn-submit:hover {
	background: #7d1414;
	color: #fff;
}

/* Abschluss-Seite */
.gutschein-complete { text-align: center; padding: 1rem 0; }

.gutschein-result {
	border-radius: 12px;
	padding: 2.5rem 1.5rem;
	border: 1px solid #e8e3da;
}

.gutschein-result-icon {
	font-size: 3rem;
	width: 5rem;
	height: 5rem;
	line-height: 5rem;
	margin: 0 auto 1rem;
	border-radius: 50%;
	background: #fbf2f2;
}

.gutschein-result-success .gutschein-result-icon { background: #e8f5ec; color: #1f7a3d; }
.gutschein-result-warn .gutschein-result-icon { background: #fdf1e8; }

.gutschein-code-box {
	display: inline-flex;
	flex-direction: column;
	gap: .3rem;
	background: #fbf2f2;
	border: 2px dashed #9b1b1b;
	border-radius: 10px;
	padding: 1.2rem 2.5rem;
	margin: 1.5rem 0;
}

.gutschein-code-label { font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; color: #777; }
.gutschein-code-value { font-size: 1.8rem; font-weight: 700; letter-spacing: 2px; color: #9b1b1b; }
.gutschein-code-amount { font-size: 1.1rem; font-weight: 600; }

.gutschein-muted { color: #888; font-size: .9rem; }

.gutschein-bank-table {
	margin: 1.5rem auto;
	border-collapse: collapse;
	text-align: left;
	min-width: 320px;
}

.gutschein-bank-table th,
.gutschein-bank-table td {
	padding: .55rem .9rem;
	border-bottom: 1px solid #eee;
}

.gutschein-bank-table th { color: #666; font-weight: 600; }
.gutschein-bank-pay td, .gutschein-bank-ref td { color: #9b1b1b; }

.gutschein-invoice-note {
	font-size: .82rem;
	color: #888;
	background: #fafafa;
	border-left: 3px solid #ddd;
	padding: .6rem 1rem;
	text-align: left;
	max-width: 480px;
	margin: 1.5rem auto 0;
}

/* --- Design & Format + Live-Vorschau --- */
.gutschein-design-layout {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 1.5rem;
	align-items: start;
}
.gutschein-design-layout > * { min-width: 0; }

.gutschein-format-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin-bottom: 1.25rem;
}

.gutschein-seg-label {
	display: block;
	font-size: .8rem;
	color: #888;
	margin-bottom: .35rem;
}

.gutschein-seg {
	display: inline-flex;
	border: 2px solid #e0d8cc;
	border-radius: 8px;
	overflow: hidden;
}

.gutschein-seg label { margin: 0; cursor: pointer; }
.gutschein-seg label input { position: absolute; opacity: 0; }
.gutschein-seg label span {
	display: block;
	padding: .5rem 1.1rem;
	font-weight: 600;
	font-size: .9rem;
	color: #555;
}
.gutschein-seg label input:checked + span { background: #9b1b1b; color: #fff; }

.gutschein-design-cat {
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #9b1b1b;
	font-weight: 700;
	margin: 1rem 0 .5rem;
}

.gutschein-design-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: .7rem;
}

.gutschein-design-option { position: relative; cursor: pointer; margin: 0; }
.gutschein-design-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }

.gutschein-design-swatch {
	display: block;
	height: 58px;
	border-radius: 6px;
	border: 2px solid #e0d8cc;
	position: relative;
	overflow: hidden;
	transition: box-shadow .15s ease, border-color .15s ease;
}
.gutschein-swatch-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }
.gutschein-swatch-word {
	position: absolute;
	left: 0; right: 0; top: 50%;
	transform: translateY(-50%);
	text-align: center;
	font-size: .62rem;
	letter-spacing: 1.5px;
	font-weight: 600;
}
.gutschein-design-option input:checked + .gutschein-design-swatch {
	border-color: #9b1b1b;
	box-shadow: 0 0 0 2px rgba(155,27,27,.25);
}

.gutschein-design-name {
	display: block;
	font-size: .82rem;
	margin-top: .35rem;
	text-align: center;
	color: #444;
}
.gutschein-printer {
	display: block;
	width: fit-content;
	margin: .25rem auto 0;
	font-size: .66rem;
	font-style: normal;
	color: #1f7a3d;
	background: #e8f5ec;
	border: 1px solid #cfe9d6;
	border-radius: 20px;
	padding: .05rem .5rem;
	line-height: 1.5;
	white-space: nowrap;
}

.gutschein-preview-sticky { position: sticky; top: 1rem; }
.gutschein-preview-caption {
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #888;
	margin-bottom: .5rem;
}
.gutschein-preview-stage {
	background: #f3f1ec;
	border-radius: 10px;
	padding: 1rem;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 220px;
}
.gutschein-preview-hint { font-size: .78rem; color: #999; margin-top: .5rem; text-align: center; }

@media (max-width: 820px) {
	.gutschein-design-layout { grid-template-columns: 1fr; }
	.gutschein-preview-sticky { position: static; }
}

@media (max-width: 600px) {
	.gutschein-grid-2,
	.gutschein-payments { grid-template-columns: 1fr; }
}
