/*
 * Prisberegner UX-demo - alt er scopet til .pbx
 */

.pbx {
	--pbx-blue: var(--STOM-maincolor, #3398db);
	--pbx-blue-dark: var(--STOM-maincolor-accent, #2a6891);
	--pbx-green: var(--STOM-secondarycolor, #46a68b);
	--pbx-green-dark: var(--STOM-secondarycolor-accent, #316b5b);
	--pbx-text: var(--STOM-text-color, #404040);
	--pbx-line: #cccccc;
	--pbx-soft: #f9f9f9;
	--pbx-tint: #eef6fc;
	--pbx-error: #c02b0a;
	color: var(--pbx-text);
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.pbx [hidden] { display: none !important; }

.pbx-intro h2 { margin: 0 0 12px; }
.pbx-intro p { margin: 0 0 12px; line-height: 1.4; }

.pbx-box {
	background: var(--pbx-soft);
	border: 1px solid var(--pbx-text);
	border-radius: 10px;
	padding: 30px;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.pbx-foot { margin: 0; font-size: 15px; }
.pbx-foot a { font-weight: 700; }

/* Fremskridt */
.pbx-head { display: flex; flex-direction: column; gap: 8px; }
.pbx-head-row { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.pbx-stepno { font-weight: 700; }
.pbx-bar { height: 4px; background: #e2e2e2; }
.pbx-bar-fill { height: 4px; background: var(--pbx-blue); width: 0; transition: width .25s ease; }

.pbx-link {
	border: 0;
	background: transparent;
	color: var(--pbx-blue);
	font: inherit;
	font-weight: 600;
	padding: 8px 0 8px 10px;
	min-height: 40px;
	cursor: pointer;
}
/* Temaets knap-hover (blaa baggrund) skal ikke ramme tekstlinks */
.pbx button.pbx-link:hover,
.pbx button.pbx-link:focus,
.pbx button.pbx-link:active {
	background: transparent !important;
	color: var(--pbx-blue-dark) !important;
	box-shadow: none !important;
	text-decoration: underline;
}
.pbx button.pbx-link:focus-visible { outline: 2px solid var(--pbx-blue-dark); outline-offset: 2px; }

.pbx-chip {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	background: #fff;
	border: 1px solid var(--pbx-line);
	padding: 4px 14px;
	font-size: 15px;
}

/* Titler */
.pbx-title { display: flex; flex-direction: column; gap: 6px; }
.pbx .pbx-title h3 { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.25; }
.pbx .pbx-title h3:focus { outline: none; }
.pbx .pbx-title p { margin: 0; font-size: 15px; line-height: 1.4; }
.pbx-goal { display: flex; flex-direction: column; gap: 20px; }

/* Kort */
.pbx-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
	gap: 12px;
}

.pbx .pbx-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	text-align: left;
	padding: 16px 18px;
	min-height: 84px;
	border: 2px solid var(--pbx-line);
	border-radius: 5px;
	background: #fff;
	font: inherit;
	color: var(--pbx-text);
	cursor: pointer;
	transition: border-color var(--STOM-transition, .15s), box-shadow var(--STOM-transition, .15s);
}
.pbx .pbx-card:hover { border-color: var(--pbx-blue); }
.pbx .pbx-card.is-on { border-color: var(--pbx-blue); background: var(--pbx-tint); }
.pbx .pbx-card:focus-visible,
.pbx .pbx-seg-btn:focus-visible,
.pbx .pbx-btn:focus-visible,
.pbx .pbx-step-btn:focus-visible { outline: 3px solid var(--pbx-blue-dark); outline-offset: 2px; }
.pbx-card-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pbx-card-sub { font-size: 15px; line-height: 1.3; font-weight: 400; }
.pbx-badge { font-size: 12px; font-weight: 700; color: #fff; background: var(--pbx-green); padding: 2px 8px; border-radius: 3px; }

.pbx-small { margin: 0; font-size: 15px; line-height: 1.4; }

.pbx-details { background: #fff; border: 1px solid var(--pbx-line); padding: 12px 14px; font-size: 15px; line-height: 1.4; }
.pbx-details summary { cursor: pointer; font-weight: 700; color: var(--pbx-blue); }
.pbx-details p { margin: 10px 0 0; }

/* Knapper */
.pbx .pbx-btn {
	border: 0;
	border-radius: 5px;
	background: var(--pbx-blue);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	padding: 0 30px;
	line-height: 46px;
	cursor: pointer;
}
.pbx .pbx-btn:hover { background: var(--pbx-blue-dark); }
.pbx .pbx-btn.pbx-btn--green { background: var(--pbx-green); font-size: 19px; line-height: 52px; }
.pbx .pbx-btn.pbx-btn--green:hover { background: var(--pbx-green-dark); }
.pbx .pbx-btn--ghost { background: #fff; color: var(--pbx-blue); border: 1px solid var(--pbx-blue); }
.pbx .pbx-btn--ghost:hover { background: var(--pbx-tint); }

/* ------------------------------------------------------------------
// Gravity Forms inde i demoen
// ---------------------------------------------------------------- */

/* Sitets egen boks om prisberegneren er erstattet af .pbx-box */
.pbx .gform_wrapper.prisberegner_wrapper {
	background: none;
	border: 0;
	border-radius: 0;
	padding: 0;
	margin: 0;
}
.pbx .gform_heading { display: none; }

.pbx.pbx-js .gform_wrapper .gform_fields { row-gap: 20px; }

/* Kun det aktuelle trins felter vises (GF's betingede logik bestemmer stadig inden for trinnet) */
.pbx.pbx-js .gform_wrapper .gform_fields > .gfield:not(.pbx-cur) { display: none !important; }
.pbx.pbx-js .gform_wrapper form:not([data-pbx-step="contact"]) .gform_footer { display: none !important; }

.pbx-panel, .pbx-nav { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 18px; }
.pbx-nav { align-items: flex-start; gap: 10px; }

.pbx .gform_wrapper .gfield_label,
.pbx .gform_wrapper legend.gfield_label { font-weight: 700; font-size: 16px; }
.pbx .gform_wrapper .gfield_required_custom { color: var(--pbx-error); font-size: 13px; font-weight: 400; }
.pbx .gform_wrapper .gfield_description { font-size: 14px; line-height: 1.4; }

.pbx .gform_wrapper input[type=text],
.pbx .gform_wrapper input[type=email],
.pbx .gform_wrapper input[type=tel],
.pbx .gform_wrapper input[type=number],
.pbx .gform_wrapper select,
.pbx .gform_wrapper textarea {
	font: inherit;
	font-size: 18px;
	padding: 10px;
	border: 1px solid var(--pbx-line);
	border-radius: 0;
	background: #fff;
	color: var(--pbx-text);
	max-width: 100%;
}
.pbx .gform_wrapper input:focus,
.pbx .gform_wrapper select:focus,
.pbx .gform_wrapper textarea:focus { outline: 2px solid var(--pbx-blue); outline-offset: 0; border-color: var(--pbx-blue); }
.pbx .gform_wrapper textarea { min-height: 110px; }

/* Korte felter skal ikke fylde hele bredden */
.pbx .gform_wrapper.gravity-theme .pbx-m2-field input,
.pbx .gform_wrapper.gravity-theme form[data-pbx-step="age"] input[type=text],
.pbx .gform_wrapper.gravity-theme form[data-pbx-step="zip"] input[type=text] { width: 260px; max-width: 100%; }

/* Arealfeltet: titlen staar i panelet */
.pbx .pbx-m2-field .gfield_label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pbx .pbx-m2-field::before { content: "Præcist areal (m²)"; display: block; font-weight: 700; margin-bottom: 8px; }

/* Radio og checkbox som kort */
.pbx .gform_wrapper .gfield_radio,
.pbx .gform_wrapper .gfield_checkbox {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
	gap: 12px;
}
.pbx .gform_wrapper .gchoice { position: relative; margin: 0; }
.pbx .gform_wrapper .gchoice input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}
.pbx .gform_wrapper .gchoice label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-width: none;
	margin: 0;
	padding: 16px 18px 16px 48px;
	min-height: 64px;
	justify-content: center;
	border: 2px solid var(--pbx-line);
	border-radius: 5px;
	background: #fff;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	cursor: pointer;
	position: relative;
}
.pbx .gform_wrapper .gchoice label::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 50%;
	width: 20px;
	height: 20px;
	margin-top: -10px;
	border: 2px solid var(--pbx-line);
	border-radius: 50%;
	background: #fff;
	box-sizing: border-box;
}
.pbx .gform_wrapper .gfield_checkbox .gchoice label::before { border-radius: 4px; }
.pbx .gform_wrapper .gchoice label:hover { border-color: var(--pbx-blue); }
.pbx .gform_wrapper .gchoice input:checked + label { border-color: var(--pbx-blue); background: var(--pbx-tint); }
.pbx .gform_wrapper .gchoice input:checked + label::before { border: 6px solid var(--pbx-blue); }
.pbx .gform_wrapper .gfield_checkbox .gchoice input:checked + label::before { border: 0; background: var(--pbx-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat; }
.pbx .gform_wrapper .gchoice input:focus-visible + label { outline: 3px solid var(--pbx-blue-dark); outline-offset: 2px; }
.pbx .gform_wrapper .gchoice .pbx-card-sub { font-weight: 400; }
.pbx .gform_wrapper .gfield_choice--select_all_enabled button,
.pbx .gform_wrapper .gfield_checkbox > button { display: none; }

/* Dropdowns med faa valg vises som knapper */
.pbx .pbx-sr-select { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.pbx-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.pbx .pbx-seg-btn {
	border: 1px solid var(--pbx-blue);
	border-radius: 5px;
	background: #fff;
	color: var(--pbx-blue);
	font: inherit;
	font-weight: 600;
	padding: 0 18px;
	line-height: 42px;
	min-width: 64px;
	cursor: pointer;
}
.pbx .pbx-seg-btn.is-on { background: var(--pbx-blue); color: #fff; }

/* Areal */
.pbx-size {
	background: #fff;
	border: 1px solid var(--pbx-line);
	padding: 24px 22px 18px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.pbx-size-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.pbx .pbx-step-btn {
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	border-radius: 5px;
	border: 1px solid var(--pbx-blue);
	background: #fff;
	font: inherit;
	font-size: 22px;
	font-weight: 700;
	color: var(--pbx-blue);
	cursor: pointer;
	padding: 0;
	line-height: 1;
	text-align: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.pbx-size-val { text-align: center; min-width: 0; flex: 0 1 220px; display: flex; flex-direction: column; gap: 8px; }
.pbx-size-num { font-size: 44px; font-weight: 700; line-height: 1; }
.pbx-size-live { font-size: 15px; font-weight: 600; color: var(--pbx-blue); min-height: 1.3em; }

.pbx-range {
	--pbx-pct: 17%;
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 8px;
	border-radius: 4px;
	background: linear-gradient(90deg, var(--pbx-blue) var(--pbx-pct), #e2e2e2 var(--pbx-pct));
	margin: 6px 0;
	cursor: pointer;
}
.pbx-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid var(--pbx-blue); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.pbx-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--pbx-blue); }
.pbx-range:focus-visible { outline: 3px solid var(--pbx-blue-dark); outline-offset: 4px; }
.pbx-ticks { display: flex; justify-content: space-between; font-size: 13px; color: #595959; }

/* Pris */
.pbx-pricebox {
	background: var(--pbx-blue);
	color: #fff;
	padding: 26px 24px;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 15px;
}
.pbx-pricebox-label { font-size: 16px; font-weight: 600; }
.pbx-pricebox-num { font-size: 46px; font-weight: 700; line-height: 1.05; }
.pbx-pricebox--loading { font-size: 18px; font-weight: 600; }
.pbx-pricebox--plain { background: #fff; color: var(--pbx-text); border: 1px solid var(--pbx-line); }
.pbx-pricebox--plain strong { font-size: 22px; }
.pbx-price-out { display: flex; flex-direction: column; gap: 14px; }

.pbx-pkg-head { background: var(--pbx-blue); color: #fff; padding: 16px 20px; font-size: 18px; font-weight: 700; }
.pbx-pkg-body { background: #fff; border: 1px solid var(--pbx-line); border-top: 0; padding: 4px 20px 12px; font-size: 15px; line-height: 1.45; }
.pbx-pkg-body h4 { display: none; }
.pbx-pkg-body p { margin: 10px 0; }

.pbx-summary { background: #fff; border: 1px solid var(--pbx-line); padding: 4px 16px; }
.pbx-sum-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #eee; font-size: 15px; }
.pbx-sum-row:last-child { border-bottom: 0; }
.pbx-sum-row strong { text-align: right; }

/* Fejl */
.pbx-err { color: var(--pbx-error); font-size: 15px; font-weight: 600; margin-top: 8px; }
.pbx .pbx-invalid input,
.pbx .pbx-invalid select,
.pbx .pbx-invalid textarea,
.pbx .pbx-invalid .gchoice label { border-color: var(--pbx-error); }

.pbx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bekraeftelse */
.pbx .gform_confirmation_message { font-size: 17px; line-height: 1.45; }

@media screen and (max-width: 640px) {
	.pbx-box { padding: 20px 16px; }
	.pbx-size { padding: 18px 12px 14px; }
	.pbx-size-num { font-size: 34px; }
	.pbx-pricebox-num { font-size: 38px; }
	.pbx .gform_wrapper.gravity-theme .pbx-m2-field input,
	.pbx .gform_wrapper.gravity-theme form[data-pbx-step="age"] input[type=text],
	.pbx .gform_wrapper.gravity-theme form[data-pbx-step="zip"] input[type=text] { width: 100%; }
	.pbx .pbx-btn { width: 100%; }
}

/* ==================================================================
// Design v2
// ================================================================ */

.pbx-box {
	background: #fff;
	border: 0;
	border-top: 4px solid var(--pbx-blue);
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(30, 50, 70, .12);
	padding: 28px 32px;
}
.pbx-foot { text-align: center; font-size: 14px; }

.pbx .pbx-cards--goal .pbx-card { min-height: 150px; padding: 24px; }

/* Rapportkort med afkrydsning */
.pbx-cards--reports { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.pbx .pbx-rep { min-height: 120px; padding: 16px; gap: 8px; }
.pbx .pbx-rep .pbx-card-sub { font-size: 14px; line-height: 1.35; }
.pbx .pbx-rep .pbx-card-title { flex-wrap: nowrap; gap: 10px; }
.pbx-box-ico {
	width: 22px;
	height: 22px;
	flex: none;
	border-radius: 4px;
	border: 2px solid #aaa;
	background: #fff;
	box-sizing: border-box;
}
.pbx .pbx-rep.is-on { background: #f4f9fd; }
.pbx .pbx-rep.is-on .pbx-box-ico {
	border-color: var(--pbx-blue);
	background: var(--pbx-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.pbx-sel {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	background: #f4f9fd;
	border: 1px solid #cfe3f3;
	padding: 14px 16px;
	font-size: 15px;
}
.pbx-sel-from { font-size: 20px; font-weight: 700; color: #1f6fa6; }

/* Elementer efter knappen (info om rapporter) */
.pbx-after { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 12px; order: 101; }

/* Raekkefoelge: panel foerst, felter, knapper sidst */
.pbx.pbx-js .gform_wrapper .gform_fields > .gfield { order: 50; }
.pbx-panel { order: 0; }
.pbx-nav { order: 100; }
.pbx-nav-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pbx-nav-note { font-size: 15px; }
.pbx .pbx-btn.is-disabled { background: #a9cde8; }
.pbx .pbx-btn.is-disabled:hover { background: #a9cde8; }

/* Kontakt i to kolonner */
.pbx .gform_wrapper.gravity-theme .gform_fields > .gfield.pbx-half { grid-column: span 6; }
.pbx .pbx-hint { font-size: 15px; margin-top: 8px; }


.pbx-size-band { font-size: 14px; font-weight: 600; color: var(--pbx-blue); min-height: 1.3em; }
.pbx-size-num { font-size: 48px; }
.pbx-over { margin: 0; font-size: 15px; line-height: 1.4; color: var(--pbx-error); }
.pbx-over a { color: var(--pbx-error); font-weight: 700; }

/* Nybyg/ombyg som kort */
.pbx-seg-cards { margin-top: 0; }
.pbx .pbx-seg-cards .pbx-seg-btn { padding: 16px 18px; justify-content: center; min-height: 84px; color: var(--pbx-text); background: #fff; border: 2px solid var(--pbx-line); line-height: 1.3; }
.pbx .pbx-seg-cards .pbx-seg-btn.is-on { border-color: var(--pbx-blue); background: var(--pbx-tint); color: var(--pbx-text); }

/* pb2: ydelseskort i designets raekkefoelge */
.pbx .gform_wrapper .gfield_radio .gchoice label { padding-left: 18px; }
.pbx .gform_wrapper .gfield_radio .gchoice label::before { display: none; }

/* Pris */
.pbx-pkg-body--plain { border: 0; padding: 0; }
.pbx-done { display: flex; flex-direction: column; gap: 12px; }
.pbx .pbx-done .pbx-title h3 { font-size: 26px; }
.pbx-done-sum { font-weight: 700; }

/* GF's egen bekraeftelse erstattes af takke-blokken */
.pbx .gform_confirmation_wrapper,
.pbx .gform_confirmation_message { display: none; }

@media screen and (max-width: 640px) {
	.pbx-box { padding: 20px 16px; }
	.pbx .gform_wrapper.gravity-theme .gform_fields > .gfield.pbx-half { grid-column: 1 / -1; }
	.pbx .pbx-cards--goal .pbx-card { min-height: 0; }
}