/* Trapp & Färg – formulär. Färger hämtas från temat om det finns, annars fallback. */
.tf-form-wrap, [data-tf-form] {
	--tf-c-primary: var(--wp--preset--color--primary, #1F3FA6);
	--tf-c-primary-dark: var(--wp--preset--color--primary-dark, #16307F);
	--tf-c-tint: var(--wp--preset--color--primary-tint, #E7ECF8);
	--tf-c-text: var(--wp--preset--color--contrast, #1C1E23);
	--tf-c-muted: var(--wp--preset--color--muted, #565A63);
	--tf-c-line: var(--wp--preset--color--line, #DCD8CE);
	--tf-c-surface: var(--wp--preset--color--surface, #fff);
	--tf-c-err: #B42318;
	--tf-r: 4px;
	color: var(--tf-c-text);
	font-size: 1rem;
	scroll-margin-top: 110px;
}
.tf-offert {
	background: var(--tf-c-surface);
	border: 1px solid var(--tf-c-line);
	border-radius: 6px;
	padding: clamp(1.25rem, 4vw, 2.5rem);
	box-shadow: 0 1px 2px rgba(28,30,35,.04), 0 12px 32px rgba(28,30,35,.06);
}
.tf-loading { color: var(--tf-c-muted); padding: 2rem 0; text-align: center; }

/* Progress */
.tf-progress { margin-bottom: 1.5rem; }
.tf-progress__meta { display: flex; justify-content: space-between; gap: 1rem; font-size: .8125rem; color: var(--tf-c-muted); margin-bottom: .5rem; font-weight: 500; }
.tf-progress__bar { height: 4px; background: var(--tf-c-tint); border-radius: 4px; overflow: hidden; }
.tf-progress__bar span { display: block; height: 100%; background: var(--tf-c-primary); transition: width .35s ease; }

.tf-step-title { font-family: var(--wp--preset--font-family--heading, Georgia, serif); font-weight: 400; font-size: clamp(1.6rem, 3.2vw, 2.1rem); line-height: 1.15; margin: 0 0 .4rem; outline: none; }
.tf-intro { color: var(--tf-c-muted); margin: 0 0 1.5rem; }

/* Grid */
.tf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1rem; }
.tf-grid > * { grid-column: 1 / -1; min-width: 0; }
.tf-grid > .tf-half { grid-column: span 1; }
.tf-grid > [hidden] { display: none !important; }
.tf-cond > .tf-field { height: 100%; }
@media (max-width: 600px) { .tf-grid > .tf-half { grid-column: 1 / -1; } }

/* Fält */
.tf-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.tf-field label:not(.tf-pill):not(.tf-card):not(.tf-consent):not(.tf-drop), .tf-field legend, .tf-label {
	display: block; font-weight: 600; font-size: .875rem; margin-bottom: .35rem; padding: 0;
}
.tf-req { color: var(--tf-c-primary); }
.tf-help { font-size: .8125rem; color: var(--tf-c-muted); margin: -.15rem 0 .5rem; line-height: 1.45; }
.tf-field input[type=text], .tf-field input[type=tel], .tf-field input[type=email], .tf-field select, .tf-field textarea {
	width: 100%; box-sizing: border-box;
	font: inherit; font-size: 1rem; color: var(--tf-c-text);
	background: var(--tf-c-surface);
	border: 1px solid var(--tf-c-line);
	border-radius: var(--tf-r);
	padding: .7rem .8rem;
	min-height: 46px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.tf-field textarea { min-height: 110px; resize: vertical; }
.tf-field select { appearance: none; -webkit-appearance: none; padding-right: 2.4rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%231C1E23' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; background-size: 12px 8px; }
.tf-field input:focus, .tf-field select:focus, .tf-field textarea:focus { outline: none; border-color: var(--tf-c-primary); box-shadow: 0 0 0 3px var(--tf-c-tint); }
.tf-field.has-error input, .tf-field.has-error select, .tf-field.has-error textarea { border-color: var(--tf-c-err); }
.tf-error { color: var(--tf-c-err); font-size: .8125rem; margin: .35rem 0 0; min-height: 0; }
.tf-error:empty { display: none; }

/* Piller (radio/checkbox) */
.tf-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.tf-pill { position: relative; cursor: pointer; }
.tf-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tf-pill span {
	display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; box-sizing: border-box;
	padding: .55rem .95rem; border: 1px solid var(--tf-c-line); border-radius: var(--tf-r);
	background: var(--tf-c-surface); font-size: .9375rem; line-height: 1.25; transition: all .15s ease;
}
.tf-pill:hover span { border-color: var(--tf-c-primary); }
.tf-pill input:checked + span { border-color: var(--tf-c-primary); background: var(--tf-c-tint); color: var(--tf-c-primary-dark); font-weight: 600; }
.tf-pill input[type=checkbox]:checked + span::before {
	content: ""; width: .85rem; height: .85rem; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%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 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.tf-pill input:focus-visible + span, .tf-card input:focus-visible + .tf-card__box { outline: 2px solid var(--tf-c-primary); outline-offset: 2px; }

/* Kort (tjänsteval) */
.tf-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 760px) { .tf-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .tf-cards { grid-template-columns: 1fr; } }
.tf-card { position: relative; cursor: pointer; display: block; }
.tf-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tf-card__box {
	display: flex; flex-direction: column; gap: .25rem; height: 100%; box-sizing: border-box;
	padding: 1rem; border: 1px solid var(--tf-c-line); border-radius: var(--tf-r); background: var(--tf-c-surface);
	transition: all .15s ease; position: relative;
}
.tf-card__box img { width: 30px; height: 30px; margin-bottom: .35rem; }
.tf-card__box strong { font-size: .9875rem; }
.tf-card__box span { font-size: .8125rem; color: var(--tf-c-muted); line-height: 1.4; }
.tf-card:hover .tf-card__box { border-color: var(--tf-c-primary); }
.tf-card input:checked + .tf-card__box { border-color: var(--tf-c-primary); background: var(--tf-c-tint); box-shadow: inset 0 0 0 1px var(--tf-c-primary); }
.tf-card input:checked + .tf-card__box::after {
	content: ""; position: absolute; top: .7rem; right: .7rem; width: 1.25rem; height: 1.25rem; border-radius: 50%;
	background: var(--tf-c-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 10.5 3.5 3.5 6.5-7.5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/70% no-repeat;
}

/* Filer */
.tf-drop {
	display: flex; align-items: center; justify-content: center; text-align: center; position: relative;
	padding: 1.25rem; border: 1.5px dashed var(--tf-c-line); border-radius: var(--tf-r); cursor: pointer;
	color: var(--tf-c-muted); font-size: .9375rem; transition: border-color .15s ease, background .15s ease;
}
.tf-drop:hover, .tf-drop:focus-within { border-color: var(--tf-c-primary); background: var(--tf-c-tint); }
.tf-drop strong { color: var(--tf-c-primary); }
.tf-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tf-files { list-style: none; margin: .5rem 0 0; padding: 0; font-size: .875rem; }
.tf-files li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--tf-c-line); }
.tf-files small { color: var(--tf-c-muted); }

/* Samtycke */
.tf-consent { display: flex; gap: .65rem; align-items: flex-start; font-size: .875rem; line-height: 1.45; cursor: pointer; }
.tf-consent input { width: 1.15rem; height: 1.15rem; margin: .1rem 0 0; flex: none; accent-color: var(--tf-c-primary); }

/* Knappar */
.tf-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
	font: inherit; font-size: .9375rem; font-weight: 500; line-height: 1.2;
	padding: .9rem 1.6rem; min-height: 48px; border-radius: var(--tf-r);
	border: 1px solid var(--tf-c-primary); background: var(--tf-c-primary); color: #fff; cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.tf-btn:hover { background: var(--tf-c-primary-dark); border-color: var(--tf-c-primary-dark); }
.tf-btn:disabled { opacity: .7; cursor: progress; }
.tf-btn--block { width: 100%; margin-top: 1.25rem; }
.tf-btn--ghost { background: transparent; color: var(--tf-c-text); border-color: var(--tf-c-line); }
.tf-btn--ghost:hover { background: transparent; border-color: var(--tf-c-text); color: var(--tf-c-text); }
.tf-btn--arrow::after, .tf-btn--block::after {
	content: ""; width: 1em; height: .75em; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpath d='M0 6h14M9 1l5 5-5 5' fill='none' stroke='black' stroke-width='1.6'/%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 16 12'%3E%3Cpath d='M0 6h14M9 1l5 5-5 5' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center/contain no-repeat;
}
.tf-btn.is-loading::after { display: none; }
.tf-link { background: none; border: 0; padding: 0; font: inherit; font-size: .875rem; color: var(--tf-c-primary); text-decoration: underline; cursor: pointer; }
.tf-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--tf-c-line); }
.tf-form-error { color: var(--tf-c-err); font-size: .9375rem; margin: 1rem 0 0; }
.tf-form-error:empty { display: none; }
.tf-foot { margin: 1.25rem 0 0; font-size: .8125rem; color: var(--tf-c-muted); text-align: center; }
.tf-foot a { color: inherit; }

/* Honungsfälla */
.tf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Sammanfattning */
.tf-sum { border: 1px solid var(--tf-c-line); border-radius: var(--tf-r); padding: .9rem 1rem; margin-bottom: .75rem; }
.tf-sum__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .35rem; }
.tf-sum h3 { font-size: .9375rem; margin: 0; font-family: inherit; font-weight: 600; }
.tf-sum table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tf-sum th { text-align: left; font-weight: 400; color: var(--tf-c-muted); width: 45%; padding: .3rem 1rem .3rem 0; vertical-align: top; }
.tf-sum td { padding: .3rem 0; }
.tf-estimate { background: var(--tf-c-tint); border-radius: var(--tf-r); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.tf-estimate p { margin: 0; }
.tf-estimate__label { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--tf-c-primary); }
.tf-estimate__price { font-family: var(--wp--preset--font-family--heading, Georgia, serif); font-size: clamp(1.5rem, 3vw, 1.9rem); margin: .25rem 0 !important; }
.tf-estimate__price small { font-family: var(--wp--preset--font-family--body, sans-serif); font-size: .8125rem; color: var(--tf-c-muted); }
.tf-estimate__rot { margin-bottom: .5rem !important; }
.tf-estimate__note { font-size: .8125rem; color: var(--tf-c-muted); margin-top: .4rem !important; line-height: 1.45; }

/* Tack */
.tf-thanks { text-align: center; padding: 1.5rem 0; outline: none; }
.tf-thanks__icon { color: var(--tf-c-primary); margin-bottom: .5rem; }
.tf-thanks h2 { font-family: var(--wp--preset--font-family--heading, Georgia, serif); font-weight: 400; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .75rem; }
.tf-thanks p { color: var(--tf-c-muted); max-width: 520px; margin: 0 auto .5rem; }

/* Kontaktformulär (kompakt, på sand-bakgrund) */
.tf-kontakt .tf-grid { gap: 1rem; }
.tf-kontakt .tf-thanks { background: var(--tf-c-surface); border-radius: 6px; padding: 2rem; }
