/* New Workers Formular - frontend */

.nwf {
	--nwf-blue: #1C2B86;
	--nwf-text: #1c2340;
	--nwf-muted: #5b617a;
	--nwf-border: #dde0ea;
	--nwf-radius: 10px; /* Fælles hjørneradius for alle feltkanter */
	--nwf-bg: #f7f8fb;
	--nwf-error: #b3261e;
	font-family: "Inter Tight", sans-serif;
	color: var(--nwf-text);
	line-height: 1.5;
}

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

.nwf-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 16px;
	row-gap: 18px;
}

.nwf-heading,
.nwf-info,
.nwf-field,
.nwf-repeater,
.nwf-actions {
	grid-column: 1 / -1;
}

.nwf-field--half {
	grid-column: auto / span 1;
}

@media (max-width: 640px) {
	.nwf-field--half {
		grid-column: 1 / -1;
	}
}

/* Overskrifter og infotekst */
.nwf-heading {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 22px 0 0;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--nwf-border);
	color: var(--nwf-blue);
}

.nwf-heading:first-child {
	margin-top: 0;
}

.nwf-info {
	margin: 0;
	color: var(--nwf-muted);
	font-size: 0.9rem;
}

/* Felter */
.nwf-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin: 0;
}

.nwf-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--nwf-text);
}

.nwf-req {
	color: var(--nwf-blue);
	margin-left: 3px;
}

.nwf-desc {
	margin: -2px 0 0;
	font-size: 0.8125rem;
	color: var(--nwf-muted);
}

/* Inputs flugter i bunden, når nabofeltet har hjælpetekst */
.nwf-field .nwf-input {
	margin-top: auto;
}

.nwf-input {
	width: 100%;
	font: inherit;
	font-size: 0.9375rem;
	color: var(--nwf-text);
	background: #fff;
	border: 1px solid var(--nwf-border);
	border-radius: var(--nwf-radius);
	padding: 9px 13px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	appearance: none;
	-webkit-appearance: none;
}

select.nwf-input {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%231C2B86' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 13px center;
	padding-right: 36px;
}

.nwf-input:hover {
	border-color: #c3c8d9;
}

.nwf-input:focus {
	outline: none;
	border-color: var(--nwf-blue);
	box-shadow: 0 0 0 3px rgba(28, 43, 134, 0.1);
}

.nwf-input::placeholder {
	color: #9aa0b5;
}

textarea.nwf-input {
	resize: vertical;
	min-height: 90px;
}

/* Fejl */
.nwf-field--invalid .nwf-input {
	border-color: var(--nwf-error);
}

.nwf-field-error {
	margin: 0;
	font-size: 0.85rem;
	color: var(--nwf-error);
}

.nwf-error-summary {
	margin: 0 0 14px;
	color: var(--nwf-error);
	font-size: 0.95rem;
}

/* Repeater */
.nwf-repeater-rows {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.nwf-repeater-row {
	border: 1px solid var(--nwf-border);
	border-radius: var(--nwf-radius);
	background: var(--nwf-bg);
	padding: 16px;
}

.nwf-repeater-row-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.nwf-repeater-title {
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--nwf-blue);
}

.nwf-repeater-remove {
	font: inherit;
	font-size: 0.85rem;
	color: var(--nwf-muted);
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px 0;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.nwf-repeater-remove:hover {
	color: var(--nwf-error);
}

.nwf-repeater-add {
	margin-top: 14px;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--nwf-blue);
	background: none;
	border: 1px solid var(--nwf-blue);
	border-radius: var(--nwf-radius);
	padding: 8px 16px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.nwf-repeater-add:hover {
	background: var(--nwf-blue);
	color: #fff;
}

/* Filupload */
.nwf-file {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 1px solid var(--nwf-border);
	border-radius: var(--nwf-radius);
	padding: 5px 13px 5px 5px;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nwf-file:hover {
	border-color: #c3c8d9;
}

.nwf-file:focus-within {
	border-color: var(--nwf-blue);
	box-shadow: 0 0 0 3px rgba(28, 43, 134, 0.1);
}

.nwf-file input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.nwf-file-btn {
	flex: 0 0 auto;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--nwf-blue);
	background: #f1f2f9;
	border-radius: calc(var(--nwf-radius) - 5px);
	padding: 7px 14px;
	transition: background-color 0.15s ease;
}

.nwf-file:hover .nwf-file-btn {
	background: #e6e8f5;
}

.nwf-file-name {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 0.875rem;
	color: #9aa0b5;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nwf-file--chosen .nwf-file-name {
	color: var(--nwf-text);
}

/* Afkrydsning */
.nwf-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--nwf-text);
	cursor: pointer;
}

.nwf-check input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 18px;
	width: 18px !important;
	height: 18px !important;
	min-width: 18px;
	max-width: 18px;
	min-height: 18px;
	max-height: 18px;
	aspect-ratio: 1;
	padding: 0;
	margin: 2px 0 0;
	background: #fff;
	border: 1px solid var(--nwf-border);
	border-radius: calc(var(--nwf-radius) / 2);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
	background-position: center;
	background-repeat: no-repeat;
}

.nwf-check input[type="checkbox"]:hover {
	border-color: #c3c8d9;
}

.nwf-check input[type="checkbox"]:focus-visible {
	outline: none;
	border-color: var(--nwf-blue);
	box-shadow: 0 0 0 3px rgba(28, 43, 134, 0.1);
}

.nwf-check input[type="checkbox"]:checked {
	background-color: var(--nwf-blue);
	border-color: var(--nwf-blue);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='9' fill='none'%3E%3Cpath d='M1 4.5 4 7.5 10 1.5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.nwf-field--invalid .nwf-check input[type="checkbox"],
.nwf-field--invalid .nwf-file {
	border-color: var(--nwf-error);
}

.nwf-file .nwf-file-remove {
	flex: 0 0 auto;
	font: inherit;
	font-size: 0.8125rem;
	color: var(--nwf-muted);
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	line-height: 1;
}

.nwf-file .nwf-file-remove:hover {
	color: var(--nwf-error);
}

/* Honeypot */
.nwf-hp {
	position: absolute !important;
	left: -9999px !important;
	height: 0;
	width: 0;
	opacity: 0;
}

/* Send-knap */
.nwf-actions {
	margin-top: 10px;
}

.nwf-submit {
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	color: #fff;
	background: var(--nwf-blue);
	border: 1px solid var(--nwf-blue);
	border-radius: var(--nwf-radius);
	padding: 11px 26px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.nwf-submit:hover {
	background: #14206b;
}

.nwf-submit:focus-visible {
	outline: 2px solid var(--nwf-blue);
	outline-offset: 2px;
}

.nwf-submit[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* Kvittering */
.nwf-success {
	border: 1px solid var(--nwf-border);
	border-radius: var(--nwf-radius);
	background: var(--nwf-bg);
	padding: 18px 22px;
	font-size: 1rem;
}

.nwf-success p {
	margin: 0;
}

/* Betinget skjulte elementer: vind over display-regler på felterne */
.nwf [hidden] {
	display: none !important;
}

/* Værn mod tema-CSS: felternes kanter, runding og baggrund skal altid
   følge pluginnets eget udtryk, også når temaet styler input-elementer
   med !important. Specificiteten (.nwf + element + klasse) vinder over
   temaets typiske element-selektorer. */
.nwf input.nwf-input,
.nwf select.nwf-input,
.nwf textarea.nwf-input {
	border: 1px solid var(--nwf-border) !important;
	border-radius: var(--nwf-radius) !important;
	background-color: #fff !important;
	box-shadow: none !important;
	outline: none !important;
}

.nwf input.nwf-input:focus,
.nwf select.nwf-input:focus,
.nwf textarea.nwf-input:focus {
	border-color: var(--nwf-blue) !important;
	box-shadow: 0 0 0 4px rgba(28, 43, 134, 0.1) !important;
}

.nwf .nwf-field--error input.nwf-input,
.nwf .nwf-field--error select.nwf-input,
.nwf .nwf-field--error textarea.nwf-input {
	border-color: var(--nwf-error) !important;
}

.nwf label.nwf-file {
	border: 1px solid var(--nwf-border) !important;
	border-radius: var(--nwf-radius) !important;
	background-color: #fff !important;
	box-shadow: none !important;
}

.nwf .nwf-file .nwf-file-btn {
	border-radius: calc(var(--nwf-radius) - 5px) !important;
}

.nwf div.nwf-repeater-row,
.nwf div.nwf-success {
	border-radius: var(--nwf-radius) !important;
}

.nwf button.nwf-repeater-add,
.nwf button.nwf-submit {
	border-radius: var(--nwf-radius) !important;
}
