/**
 * Teppichfee Bestellformular – Frontend-Styles
 */

.tf-form,
#tf-carpet-template {
	/* Markenfarben Teppich-Fee */
	--tf-accent: #10214e;        /* Primär (Navy) – Titel, Auswahl, Preise */
	--tf-accent-dark: #0a1636;   /* dunkleres Navy (Hover) */
	--tf-accent-light: #e7ebf3;  /* helles Navy (Auswahl-Hintergrund) */
	--tf-gold: #f3b740;          /* Accent – Buttons / CTA */
	--tf-gold-dark: #e0a42a;     /* Gold Hover */
	--tf-gold-light: #fdf5e0;    /* helles Gold (Gesamtpreis) */
	--tf-on-gold: #10214e;       /* Text auf Gold-Buttons (Navy) */
	--tf-blue: #2e5dd8;          /* Sekundär – Links / Fokus */
	--tf-text: #23282d;
	--tf-muted: #7a7a7a;
	--tf-border: #d7dde3;
	--tf-bg: #ffffff;
	--tf-bg-soft: #f6f8fa;
	--tf-error: #c0392b;
	--tf-radius: 12px;
	--tf-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.tf-form {
	max-width: 720px;
	margin: 0 auto;
	color: var(--tf-text);
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
}

.tf-form *,
.tf-form *::before,
.tf-form *::after {
	box-sizing: border-box;
}

.tf-intro {
	font-size: 1.05em;
	color: var(--tf-muted);
	margin: 0 0 1.5em;
}

/* --- Fortschrittsanzeige --- */
.tf-steps {
	display: flex;
	list-style: none;
	margin: 0 0 1.75em;
	padding: 0;
	counter-reset: none;
}

.tf-step-indicator {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	position: relative;
	color: var(--tf-muted);
	font-size: 0.85em;
	text-align: center;
}

.tf-step-indicator::before {
	content: "";
	position: absolute;
	top: 16px;
	left: -50%;
	width: 100%;
	height: 2px;
	background: var(--tf-border);
	z-index: 0;
}

.tf-step-indicator:first-child::before {
	display: none;
}

.tf-step-num {
	position: relative;
	z-index: 1;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--tf-bg);
	border: 2px solid var(--tf-border);
	font-weight: 700;
}

.tf-step-indicator.is-active .tf-step-num,
.tf-step-indicator.is-done .tf-step-num {
	background: var(--tf-accent);
	border-color: var(--tf-accent);
	color: #fff;
}

.tf-step-indicator.is-active {
	color: var(--tf-text);
	font-weight: 600;
}

/* --- Panels --- */
.tf-panel {
	display: none;
	animation: tf-fade 0.25s ease;
}

.tf-panel.is-active {
	display: block;
}

@keyframes tf-fade {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

/* --- Teppich-Karte --- */
.tf-carpet {
	background: var(--tf-bg);
	border: 1px solid var(--tf-border);
	border-radius: var(--tf-radius);
	padding: 20px;
	margin-bottom: 18px;
	box-shadow: var(--tf-shadow);
}

.tf-carpet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.tf-carpet-title {
	margin: 0;
	font-size: 1.15em;
	color: var(--tf-accent);
}

.tf-carpet-remove {
	background: none;
	border: none;
	color: var(--tf-muted);
	font-size: 1.1em;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 8px;
	line-height: 1;
}

.tf-carpet-remove:hover {
	background: #fdecea;
	color: var(--tf-error);
}

.tf-field-group {
	margin-bottom: 18px;
}

.tf-label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
}

/* --- Reinigungsart-Karten --- */
.tf-type-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.tf-type-card {
	position: relative;
	cursor: pointer;
}

.tf-type-card input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.tf-type-card-inner {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px;
	border: 2px solid var(--tf-border);
	border-radius: 10px;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
	height: 100%;
}

.tf-type-card:hover .tf-type-card-inner {
	border-color: var(--tf-accent);
}

.tf-type-card input:checked + .tf-type-card-inner {
	border-color: var(--tf-accent);
	background: var(--tf-accent-light);
	box-shadow: 0 0 0 1px var(--tf-accent);
}

.tf-type-card input:focus-visible + .tf-type-card-inner {
	outline: 2px solid var(--tf-accent);
	outline-offset: 2px;
}

.tf-type-card.tf-invalid .tf-type-card-inner {
	border-color: var(--tf-error);
	box-shadow: 0 0 0 1px var(--tf-error);
}

/* Reinigungsart nicht verfügbar (z. B. vollautomatisch unter Mindestfläche) */
.tf-type-card.tf-type-disabled {
	opacity: 0.45;
	pointer-events: none;
}

/* Hinweis: automatische Handwäsche unter Mindestfläche */
.tf-minarea-notice {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-top: 12px;
	padding: 10px 14px;
	background: var(--tf-gold-light);
	border: 1px solid #f4dfa6;
	border-radius: 8px;
	font-size: 0.88em;
	color: #8a6a12;
}

.tf-minarea-icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--tf-gold);
	color: var(--tf-on-gold);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.85em;
}

.tf-type-name {
	font-weight: 600;
}

.tf-type-price {
	color: var(--tf-accent-dark);
	font-weight: 700;
}

.tf-type-info {
	margin-top: 12px;
	padding: 12px 14px;
	background: var(--tf-bg-soft);
	border-left: 3px solid var(--tf-accent);
	border-radius: 6px;
	font-size: 0.92em;
	color: var(--tf-muted);
}

.tf-type-info p {
	margin: 0 0 0.5em;
}

.tf-type-info p:last-child {
	margin-bottom: 0;
}

.tf-type-info a {
	color: var(--tf-blue);
	font-weight: 600;
}

/* --- Felder --- */
.tf-field {
	display: block;
	margin-bottom: 14px;
}

.tf-field > span {
	display: block;
	font-size: 0.9em;
	font-weight: 600;
	margin-bottom: 6px;
}

.tf-form input[type="text"],
.tf-form input[type="tel"],
.tf-form input[type="email"],
.tf-form input[type="number"],
.tf-form textarea {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--tf-border);
	border-radius: 9px;
	font-size: 1em;
	font-family: inherit;
	color: var(--tf-text);
	background: var(--tf-bg);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.tf-form input:focus,
.tf-form textarea:focus {
	outline: none;
	border-color: var(--tf-blue);
	box-shadow: 0 0 0 3px rgba(46, 93, 216, 0.18);
}

.tf-form input.tf-invalid,
.tf-form textarea.tf-invalid {
	border-color: var(--tf-error);
	box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.tf-field-row {
	display: flex;
	gap: 12px;
}

.tf-field-row .tf-field {
	flex: 1;
}

.tf-field-plz { flex: 0 0 120px; }
.tf-field-city { flex: 1; }

/* --- Maße --- */
.tf-size-row {
	display: flex;
	align-items: flex-end;
	gap: 10px;
}

.tf-field-size {
	flex: 1;
	margin-bottom: 0;
}

.tf-size-x {
	padding-bottom: 12px;
	font-size: 1.2em;
	color: var(--tf-muted);
}

.tf-area-line {
	margin: 10px 0 0;
	color: var(--tf-muted);
	font-size: 0.92em;
}

/* --- Foto-Upload --- */
.tf-upload-hint {
	margin: 0 0 10px;
	font-size: 0.88em;
	color: var(--tf-muted);
}

.tf-dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 22px;
	border: 2px dashed var(--tf-border);
	border-radius: 10px;
	background: var(--tf-bg-soft);
	cursor: pointer;
	text-align: center;
	color: var(--tf-muted);
	transition: border-color 0.15s, background 0.15s;
}

.tf-dropzone:hover,
.tf-dropzone.is-drag,
.tf-dropzone:focus-visible {
	border-color: var(--tf-accent);
	background: var(--tf-accent-light);
	outline: none;
}

.tf-dropzone-icon {
	font-size: 1.6em;
}

.tf-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}

.tf-photo {
	position: relative;
	width: 76px;
	height: 76px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--tf-border);
	background: var(--tf-bg-soft);
}

.tf-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tf-photo.is-uploading {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.7em;
	color: var(--tf-muted);
}

.tf-photo-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 22px;
	height: 22px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	cursor: pointer;
	font-size: 0.8em;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tf-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid var(--tf-border);
	border-top-color: var(--tf-accent);
	border-radius: 50%;
	animation: tf-spin 0.7s linear infinite;
}

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

/* --- Preise --- */
.tf-carpet-price {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 14px;
	margin-top: 4px;
	border-top: 1px solid var(--tf-border);
	font-size: 1.05em;
}

.tf-carpet-price strong {
	color: var(--tf-accent-dark);
	font-size: 1.1em;
}

.tf-subtotal-bar,
.tf-total-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	background: var(--tf-bg-soft);
	border-radius: 10px;
	margin: 4px 0 18px;
	font-size: 1.1em;
}

.tf-total-bar {
	background: var(--tf-gold-light);
	border: 1px solid #f4dfa6;
	font-size: 1.25em;
}

.tf-subtotal,
.tf-total {
	color: var(--tf-accent-dark);
	font-size: 1.1em;
}

.tf-total-note {
	margin: -8px 0 18px;
	font-size: 0.85em;
	color: var(--tf-muted);
}

/* --- Buttons --- */
.tf-actions {
	display: flex;
	gap: 12px;
	justify-content: space-between;
	margin-top: 22px;
}

.tf-actions .tf-btn-primary {
	margin-left: auto;
}

.tf-btn {
	appearance: none;
	border: none;
	border-radius: 10px;
	padding: 13px 22px;
	font-size: 1em;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}

.tf-btn:active { transform: translateY(1px); }

.tf-btn-primary {
	background: var(--tf-gold);
	color: var(--tf-on-gold);
}

.tf-btn-primary:hover { background: var(--tf-gold-dark); }

.tf-btn-primary:disabled {
	background: #f5e4b2;
	color: #9a875a;
	cursor: not-allowed;
}

.tf-btn-ghost {
	background: transparent;
	color: var(--tf-muted);
	border: 1px solid var(--tf-border);
}

.tf-btn-ghost:hover {
	background: var(--tf-bg-soft);
	color: var(--tf-text);
}

.tf-btn-add {
	width: 100%;
	background: transparent;
	border: 2px dashed var(--tf-border);
	color: var(--tf-accent-dark);
	padding: 14px;
	margin-bottom: 18px;
}

.tf-btn-add:hover {
	border-color: var(--tf-accent);
	background: var(--tf-accent-light);
}

.tf-btn-submit {
	font-size: 1.1em;
	padding: 15px 26px;
}

.tf-btn.is-loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}

.tf-btn.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid rgba(16, 33, 78, 0.3);
	border-top-color: var(--tf-accent);
	border-radius: 50%;
	animation: tf-spin 0.7s linear infinite;
}

/* --- Adressen --- */
.tf-section-title {
	margin: 0 0 4px;
	font-size: 1.2em;
	color: var(--tf-accent);
}

.tf-section-hint {
	margin: 0 0 16px;
	color: var(--tf-muted);
	font-size: 0.92em;
}

.tf-plz-feedback {
	margin: -4px 0 14px;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 0.92em;
}

.tf-plz-feedback.is-ok {
	background: var(--tf-accent-light);
	color: var(--tf-accent-dark);
}

.tf-plz-feedback.is-error {
	background: #fdecea;
	color: var(--tf-error);
}

.tf-plz-feedback.is-checking {
	background: var(--tf-bg-soft);
	color: var(--tf-muted);
}

.tf-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 14px 0;
	cursor: pointer;
	font-size: 0.95em;
}

.tf-check input {
	margin-top: 3px;
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	accent-color: var(--tf-accent);
}

.tf-delivery-fields {
	padding: 16px;
	border: 1px solid var(--tf-border);
	border-radius: 10px;
	background: var(--tf-bg-soft);
	margin-bottom: 8px;
}

.tf-delivery-fields .tf-section-title {
	font-size: 1.05em;
}

/* --- Übersicht --- */
.tf-summary {
	border: 1px solid var(--tf-border);
	border-radius: var(--tf-radius);
	overflow: hidden;
	margin-bottom: 16px;
}

.tf-summary-row {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--tf-border);
}

.tf-summary-row:last-child { border-bottom: none; }

.tf-summary-row .tf-summary-desc {
	color: var(--tf-text);
}

.tf-summary-row .tf-summary-meta {
	display: block;
	color: var(--tf-muted);
	font-size: 0.88em;
	margin-top: 2px;
}

.tf-summary-row .tf-summary-price {
	font-weight: 700;
	white-space: nowrap;
	color: var(--tf-accent-dark);
}

.tf-summary-addr {
	padding: 14px 16px;
	background: var(--tf-bg-soft);
	font-size: 0.9em;
	color: var(--tf-muted);
}

.tf-summary-addr strong {
	color: var(--tf-text);
	display: block;
	margin-bottom: 2px;
}

.tf-min-order {
	padding: 14px 16px;
	background: #fff7e6;
	border: 1px solid #ffe0a3;
	border-radius: 10px;
	margin-bottom: 16px;
}

.tf-min-order-text {
	margin: 0 0 10px;
	color: #92670c;
	font-weight: 600;
}

/* --- Fehler --- */
.tf-global-error {
	padding: 12px 16px;
	background: #fdecea;
	border: 1px solid #f5c6cb;
	border-radius: 9px;
	color: var(--tf-error);
	margin-bottom: 16px;
	font-size: 0.95em;
}

.tf-field-error {
	color: var(--tf-error);
	font-size: 0.85em;
	margin-top: 4px;
}

/* --- WhatsApp-Banner --- */
.tf-wa-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: #e8f8ee;
	border: 1px solid #a6e2bf;
	border-radius: 10px;
	margin-bottom: 20px;
}

.tf-wa-icon {
	flex: 0 0 auto;
	color: #25d366;
	display: flex;
}

.tf-wa-text {
	flex: 1;
	font-size: 0.92em;
	color: #14663a;
}

.tf-wa-btn {
	flex: 0 0 auto;
	display: inline-block;
	background: #25d366;
	color: #fff !important;
	text-decoration: none;
	font-weight: 600;
	padding: 9px 16px;
	border-radius: 8px;
	white-space: nowrap;
	font-size: 0.9em;
}

.tf-wa-btn:hover { background: #1da851; }

/* --- Unsicher-Karte --- */
.tf-type-unsure {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin-top: 10px;
	padding: 10px 14px;
	background: transparent;
	border: 1px dashed var(--tf-border);
	border-radius: 9px;
	color: var(--tf-muted);
	font-family: inherit;
	font-size: 0.92em;
	cursor: pointer;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tf-type-unsure:hover {
	border-color: var(--tf-accent);
	color: var(--tf-accent-dark);
	background: var(--tf-bg-soft);
}

.tf-unsure-q {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--tf-border);
	color: var(--tf-text);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.85em;
}

.tf-info-unsure {
	border-left-color: #25d366;
}

.tf-contact-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 10px;
}

.tf-contact-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 15px;
	border-radius: 8px;
	background: var(--tf-accent);
	color: #fff !important;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9em;
}

.tf-contact-btn:hover { background: var(--tf-accent-dark); }

.tf-contact-wa {
	background: #25d366;
}

.tf-contact-wa:hover { background: #1da851; }

/* --- Maß-Hinweis --- */
.tf-size-hint {
	display: block;
	margin-top: 4px;
	font-size: 0.78em;
	color: var(--tf-muted);
}

/* --- Feld-Hinweis (z. B. unter Telefon) --- */
.tf-field-hint {
	display: block;
	margin-top: 5px;
	font-size: 0.8em;
	color: var(--tf-muted);
}

/* --- Mobile --- */
@media (max-width: 560px) {
	.tf-form { font-size: 15px; }
	.tf-type-cards { grid-template-columns: 1fr; }
	.tf-field-row { flex-direction: column; gap: 0; }
	.tf-field-plz { flex: 1; }
	.tf-step-label { display: none; }
	.tf-actions { flex-direction: column-reverse; }
	.tf-actions .tf-btn { width: 100%; margin-left: 0; }
	.tf-wa-banner { flex-direction: column; align-items: flex-start; }
	.tf-wa-btn { width: 100%; text-align: center; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
	.tf-panel { animation: none; }
	.tf-spinner,
	.tf-btn.is-loading::after { animation: none; }
}
