/*
 * Kontakt page – native Bricks Form styled like the original site.
 * Field groups get an "ac-f-{field id}" class from site.js (e.g. .ac-f-navn).
 */

/* ---------- Layout ---------- */
.ac-bricks-form {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	align-items: flex-start;
	padding: 0;
	margin: 0;
}

.ac-bricks-form > .form-group {
	flex: 0 0 100%;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
}

/* Spam trap: out of the layout (bots still see it) */
.ac-bricks-form > .ac-f-hjemmeside {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Before a choice is made only the question + options show */
.ac-bricks-form:not(.ac-ready) > .form-group:nth-child(n + 3),
.ac-bricks-form:not(.ac-ready) > .submit-button-wrapper {
	display: none;
}

@media (min-width: 40rem) {
	.ac-bricks-form > .ac-half {
		flex-basis: calc(50% - 0.75rem);
	}

	.ac-bricks-form > .ac-third {
		flex-basis: calc(33.333% - 1rem);
	}
}

/* Vertical rhythm of the original (48px after the options, 40px between blocks).
   The extra space goes under the full-width options block, so the first field row moves down as a whole. */
.ac-bricks-form > .ac-f-type {
	margin-bottom: 1.5rem;
}

.ac-bricks-form > .ac-section-start,
.ac-bricks-form > .ac-f-besked,
.ac-bricks-form > .ac-f-fil {
	margin-top: 1rem;
}

.ac-bricks-form > .ac-section-start {
	padding-top: 2.5rem;
	border-top: 1px solid var(--border);
}

.ac-bricks-form > .ac-f-filhint {
	margin-top: calc(0.375rem - 1.5rem);
}

/* Button row: site.js moves the privacy note in here, next to the button */
.ac-bricks-form > .submit-button-wrapper {
	display: flex;
	flex: 0 0 100%;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 1.25rem;
	order: 100;
	margin: 1rem 0 0;
	padding: 0;
	width: auto;
}

.ac-bricks-form > .ac-f-privat {
	order: 101;
}

/* ---------- Labels ---------- */
/* Bricks makes every form label small, uppercase and letter-spaced */
.ac-bricks-form label,
.ac-bricks-form .label {
	text-transform: none;
	letter-spacing: normal;
}

.ac-bricks-form .form-group > label:not(.choose-files),
.ac-bricks-form .form-group > .label {
	display: block;
	margin: 0;
	padding: 0;
	color: var(--foreground);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.5rem;
}

.ac-bricks-form .form-group > .label {
	line-height: 1.25rem;
}

.ac-bricks-form .form-group > label.required::after,
.ac-bricks-form .form-group > .label.required::after {
	content: " *";
	color: var(--accent);
	margin: 0;
}

/* The options already have a visible question above them */
.ac-bricks-form .ac-f-type > .label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Text inputs, selects, textareas ---------- */
.ac-bricks-form input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
.ac-bricks-form select,
.ac-bricks-form textarea {
	display: block;
	width: 100%;
	height: auto;
	min-height: 0;
	margin: 0.5rem 0 0;
	padding: 0.875rem 1rem;
	border: 1px solid transparent;
	border-radius: var(--radius-xl, 0.75rem);
	background-color: var(--card);
	box-shadow: inset 0 0 0 1px var(--border);
	color: var(--foreground);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5rem;
	transition: box-shadow 0.15s, background-color 0.15s;
	outline: none;
}

.ac-bricks-form select {
	appearance: auto;
	background-image: none;
}

.ac-bricks-form ::placeholder {
	color: color-mix(in oklab, var(--muted-foreground) 70%, transparent);
	opacity: 1;
}

.ac-bricks-form input:focus,
.ac-bricks-form select:focus,
.ac-bricks-form textarea:focus {
	box-shadow: inset 0 0 0 2px var(--primary);
}

.ac-bricks-form .ac-f-besked textarea {
	height: 9.375rem;
	resize: vertical;
}

.ac-bricks-form .ac-f-onsker textarea {
	height: 6.375rem;
	resize: vertical;
}

/* ---------- Errors ---------- */
.ac-bricks-form .form-group:has(.form-group-error-message.show) input,
.ac-bricks-form .form-group:has(.form-group-error-message.show) select,
.ac-bricks-form .form-group:has(.form-group-error-message.show) textarea {
	box-shadow: inset 0 0 0 2px var(--destructive);
}

.ac-bricks-form .form-group-error-message {
	display: none;
	margin-top: 0.5rem;
	color: var(--destructive);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.25rem;
}

.ac-bricks-form .form-group-error-message.show {
	display: block;
}

.ac-bricks-form > .message {
	flex: 0 0 100%;
	order: 102;
	margin: 0;
	padding: 1rem 1.25rem;
	border-radius: var(--radius-xl, 0.75rem);
	background: color-mix(in oklab, var(--destructive) 10%, transparent);
	color: var(--destructive);
	font-size: 0.875rem;
	font-weight: 500;
}

.ac-bricks-form > .message.success {
	display: none;
}

/* ---------- Option cards (radio) ---------- */
.ac-bricks-form .options-wrapper {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ac-bricks-form .options-wrapper li {
	position: relative;
	display: block;
	margin: 0;
	padding: 0;
}

.ac-bricks-form .options-wrapper input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.ac-bricks-form .ac-f-type .options-wrapper {
	display: grid;
	gap: 0.625rem;
}

.ac-bricks-form .ac-f-type .options-wrapper label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	height: 100%;
	margin: 0;
	padding: 1rem 1.25rem;
	border-radius: var(--radius-xl, 0.75rem);
	background-color: var(--card);
	box-shadow: inset 0 0 0 1px var(--border);
	color: var(--foreground);
	cursor: pointer;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.5;
	transition: background-color 0.15s, color 0.15s;
}

.ac-bricks-form .ac-f-type .options-wrapper label:hover {
	background-color: var(--secondary);
}

.ac-bricks-form .ac-f-type .options-wrapper label::after {
	content: "";
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
	border-radius: 9999px;
	box-shadow: inset 0 0 0 1.5px var(--border);
}

.ac-bricks-form .ac-f-type input:checked + label {
	background-color: var(--primary);
	box-shadow: none;
	color: var(--primary-foreground);
}

.ac-bricks-form .ac-f-type input:checked + label::after {
	background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff9f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
	box-shadow: none;
}

.ac-bricks-form .options-wrapper input:focus-visible + label {
	outline: 2px solid var(--ring);
	outline-offset: 0;
}

@media (min-width: 40rem) {
	.ac-bricks-form .ac-f-type .options-wrapper {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ac-bricks-form .ac-f-type .options-wrapper li:last-child {
		grid-column: 1 / -1;
	}
}

/* ---------- Pills (checkboxes) ---------- */
.ac-bricks-form .ac-pills .options-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.ac-bricks-form .ac-pills .options-wrapper label {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin: 0;
	padding: 0.5rem 1rem;
	border-radius: 9999px;
	background-color: var(--card);
	box-shadow: inset 0 0 0 1px var(--border);
	color: var(--foreground);
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.25rem;
	transition: background-color 0.15s, color 0.15s;
}

.ac-bricks-form .ac-pills .options-wrapper label:hover {
	background-color: var(--secondary);
}

.ac-bricks-form .ac-pills input:checked + label {
	background-color: var(--primary);
	box-shadow: none;
	color: var(--primary-foreground);
}

.ac-bricks-form .ac-pills input:checked + label::before {
	content: "";
	width: 0.875rem;
	height: 0.875rem;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%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 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- File upload ---------- */
.ac-bricks-form .ac-f-fil input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.ac-bricks-form .ac-f-fil .choose-files {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--primary);
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.25rem;
	text-underline-offset: 4px;
}

.ac-bricks-form .ac-f-fil .choose-files:hover {
	text-decoration: underline;
}

.ac-bricks-form .ac-f-fil .choose-files::before {
	content: "";
	width: 1rem;
	height: 1rem;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551'/%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 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ac-bricks-form .ac-f-fil .file-result {
	font-size: 0.875rem;
	color: var(--foreground);
}

/* ---------- Submit button ---------- */
.ac-bricks-form .submit-button-wrapper .bricks-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	height: 3.5rem;
	margin: 0;
	padding: 0 2rem;
	border: 0;
	border-radius: 9999px;
	background-color: var(--primary);
	color: var(--primary-foreground);
	cursor: pointer;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.025em;
	line-height: 1rem;
	text-transform: uppercase;
	white-space: nowrap;
	transition: background-color 0.15s;
}

.ac-bricks-form .submit-button-wrapper .bricks-button:hover {
	background-color: var(--primary-hover);
}

.ac-bricks-form .submit-button-wrapper .bricks-button::after {
	content: "";
	order: 2;
	width: 1rem;
	height: 1rem;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%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 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
