/* Fossedal Form — frontend (skisse + beskyttelse mot tema / Elementor) */

.fossedal-form[data-fossedal-form="1"] {
	--ff-text: #000000;
	--ff-text-muted: #6b7280;
	--ff-placeholder: #9ca3af;
	--ff-surface: #ffffff;
	--ff-border: #d1d5db;
	--ff-border-input: #d1d5db;
	--ff-focus-ring: rgba(237, 28, 36, 0.22);
	--ff-submit: rgb(237, 28, 36);
	--ff-submit-hover: rgb(200, 22, 30);
	--ff-submit-active: rgb(180, 18, 26);
	--ff-radius-card: 12px;
	--ff-radius-control: 8px;
	--ff-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	box-sizing: border-box;
	max-width: 36rem;
	margin-left: auto;
	margin-right: auto;
	padding: 0.5rem 0 1.5rem;
	font-family: var(--ff-font) !important;
	font-size: 1rem !important;
	line-height: 1.5 !important;
	font-weight: 400 !important;
	color: var(--ff-text) !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	-webkit-font-smoothing: antialiased;
	isolation: isolate;
}

.fossedal-form[data-fossedal-form="1"] *,
.fossedal-form[data-fossedal-form="1"] *::before,
.fossedal-form[data-fossedal-form="1"] *::after {
	box-sizing: border-box;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__form {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	background: var(--ff-surface) !important;
	background-image: none !important;
	border: 1px solid var(--ff-border) !important;
	border-radius: var(--ff-radius-card) !important;
	padding: 1.75rem 1.5rem 1.5rem !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__field {
	margin: 0 0 1.375rem 0 !important;
	padding: 0 !important;
	border: none !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__field:last-of-type {
	margin-bottom: 0 !important;
}

/* Google reCAPTCHA v2 */
.fossedal-form[data-fossedal-form="1"] .fossedal-form__recaptcha {
	margin: 1.25rem 0 0.5rem !important;
	padding: 0 !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__label {
	display: block !important;
	float: none !important;
	width: auto !important;
	margin: 0 0 0.5rem 0 !important;
	padding: 0 !important;
	font-family: var(--ff-font) !important;
	font-size: 0.9375rem !important;
	font-weight: 700 !important;
	line-height: 1.45 !important;
	color: var(--ff-text) !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	border: none !important;
	background: transparent !important;
}

/* Tekstfelt / textarea: høy spesifisitet + !important mot Elementor/tema */
.fossedal-form[data-fossedal-form="1"] .fossedal-form__form input.fossedal-form__input,
.fossedal-form[data-fossedal-form="1"] .fossedal-form__form textarea.fossedal-form__textarea {
	display: block !important;
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	min-height: 3rem !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0.75rem 0.875rem !important;
	font-family: var(--ff-font) !important;
	font-size: 1rem !important;
	font-weight: 400 !important;
	line-height: 1.45 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	color: var(--ff-text) !important;
	background-color: var(--ff-surface) !important;
	background-image: none !important;
	border: 1px solid var(--ff-border-input) !important;
	border-radius: var(--ff-radius-control) !important;
	box-shadow: none !important;
	outline: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	transition:
		border-color 0.15s ease,
		box-shadow 0.15s ease !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__form textarea.fossedal-form__textarea {
	min-height: 8rem !important;
	resize: vertical !important;
	padding-top: 0.875rem !important;
	padding-bottom: 0.875rem !important;
}

/* Dato: behold native kalender-ikon der nettleseren støtter det */
.fossedal-form[data-fossedal-form="1"] .fossedal-form__form input.fossedal-form__input[type="date"] {
	min-height: 3rem !important;
	-webkit-appearance: auto !important;
	appearance: auto !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__form input.fossedal-form__input::placeholder,
.fossedal-form[data-fossedal-form="1"] .fossedal-form__form textarea.fossedal-form__textarea::placeholder {
	color: var(--ff-placeholder) !important;
	opacity: 1 !important;
	font-weight: 400 !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__form input.fossedal-form__input:hover,
.fossedal-form[data-fossedal-form="1"] .fossedal-form__form textarea.fossedal-form__textarea:hover {
	border-color: #bfc4ca !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__form input.fossedal-form__input:focus,
.fossedal-form[data-fossedal-form="1"] .fossedal-form__form textarea.fossedal-form__textarea:focus {
	outline: none !important;
	border-color: var(--ff-submit) !important;
	box-shadow: 0 0 0 3px var(--ff-focus-ring) !important;
	background-color: var(--ff-surface) !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__help {
	margin: 0.5rem 0 0 !important;
	padding: 0 !important;
	font-family: var(--ff-font) !important;
	font-size: 0.875rem !important;
	font-weight: 400 !important;
	line-height: 1.45 !important;
	color: var(--ff-text-muted) !important;
	border: none !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__fieldset {
	margin: 1.5rem 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	min-width: 0 !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__fieldset--guardian {
	margin-top: 1rem !important;
	margin-bottom: 0 !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__legend {
	display: block !important;
	width: 100% !important;
	float: none !important;
	margin: 0 0 0.25rem 0 !important;
	padding: 0 !important;
	font-family: var(--ff-font) !important;
	font-size: 0.9375rem !important;
	font-weight: 700 !important;
	color: var(--ff-text) !important;
	background: transparent !important;
	border: none !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__legend-sub {
	margin: 0 0 0.875rem !important;
	padding: 0 !important;
	font-family: var(--ff-font) !important;
	font-size: 0.9375rem !important;
	font-weight: 400 !important;
	color: var(--ff-text) !important;
	background: transparent !important;
	border: none !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__check {
	display: flex !important;
	align-items: flex-start !important;
	gap: 0.625rem !important;
	margin: 0 0 0.625rem 0 !important;
	padding: 0 !important;
	font-family: var(--ff-font) !important;
	font-size: 0.9375rem !important;
	font-weight: 400 !important;
	line-height: 1.45 !important;
	color: var(--ff-text) !important;
	cursor: pointer !important;
	border: none !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__check:last-child {
	margin-bottom: 0 !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__check input[type="checkbox"] {
	display: block !important;
	float: none !important;
	width: 1.125rem !important;
	height: 1.125rem !important;
	min-width: 1.125rem !important;
	min-height: 1.125rem !important;
	margin: 0.2rem 0 0 0 !important;
	padding: 0 !important;
	flex-shrink: 0 !important;
	border-radius: 4px !important;
	accent-color: var(--ff-submit) !important;
	cursor: pointer !important;
	-webkit-appearance: auto !important;
	appearance: auto !important;
	box-shadow: none !important;
	background: var(--ff-surface) !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__terms-box {
	margin-top: 1.5rem !important;
	padding: 1rem !important;
	border: 1px solid var(--ff-border) !important;
	border-radius: var(--ff-radius-control) !important;
	background: var(--ff-surface) !important;
	background-image: none !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__check--terms {
	margin-bottom: 0 !important;
	font-size: 0.9375rem !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__terms-link {
	color: inherit !important;
	font-weight: 700 !important;
	text-decoration: underline !important;
	text-underline-offset: 2px !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__terms-link:hover {
	color: var(--ff-text) !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__terms-link:focus-visible {
	outline: 2px solid var(--ff-submit) !important;
	outline-offset: 2px !important;
	border-radius: 2px !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__minor {
	margin: 1.25rem 0 1.5rem !important;
	padding: 0 !important;
	border: none !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__minor[hidden] {
	display: none !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__minor-alert {
	border: 1px solid #fecaca !important;
	background: #fef2f2 !important;
	background-image: none !important;
	border-radius: var(--ff-radius-control) !important;
	padding: 1rem !important;
	margin: 0 0 1.125rem 0 !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__minor-title {
	margin: 0 0 0.375rem !important;
	font-family: var(--ff-font) !important;
	font-weight: 700 !important;
	font-size: 0.9375rem !important;
	color: #b91c1c !important;
	border: none !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__minor-text {
	margin: 0 !important;
	font-family: var(--ff-font) !important;
	font-size: 0.875rem !important;
	line-height: 1.5 !important;
	color: #7f1d1d !important;
	border: none !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__actions {
	margin-top: 1.5rem !important;
	padding: 0 !important;
	border: none !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__form button.fossedal-form__submit {
	display: inline-block !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0.75rem 1.75rem !important;
	font-family: var(--ff-font) !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
	line-height: normal !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	color: #ffffff !important;
	background: var(--ff-submit) !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: var(--ff-radius-control) !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
	cursor: pointer !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	outline: none !important;
	transition:
		background-color 0.15s ease,
		box-shadow 0.15s ease,
		transform 0.1s ease !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__form button.fossedal-form__submit:hover {
	color: #ffffff !important;
	background: var(--ff-submit-hover) !important;
	background-image: none !important;
	box-shadow: 0 2px 6px rgba(237, 28, 36, 0.35) !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__form button.fossedal-form__submit:active {
	color: #ffffff !important;
	background: var(--ff-submit-active) !important;
	transform: translateY(1px) !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__form button.fossedal-form__submit:focus-visible {
	outline: 2px solid var(--ff-submit) !important;
	outline-offset: 3px !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__notice {
	border-radius: var(--ff-radius-control) !important;
	padding: 0.875rem 1rem !important;
	margin: 0 0 1rem 0 !important;
	font-family: var(--ff-font) !important;
	font-size: 0.9375rem !important;
	line-height: 1.45 !important;
	border: 1px solid transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__notice--success {
	background: #ecfdf5 !important;
	background-image: none !important;
	border-color: #6ee7b7 !important;
	color: #065f46 !important;
}

/* Suksess etter innsending (skjema skjult) */
.fossedal-form[data-fossedal-form="1"] .fossedal-form__success {
	margin: 0 !important;
	padding: 2.25rem 1.75rem 2rem !important;
	text-align: center !important;
	background: #ffffff !important;
	background-image: none !important;
	border: 1px solid #d1d5db !important;
	border-radius: 12px !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-icon {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 3.25rem !important;
	height: 3.25rem !important;
	margin: 0 auto 1.25rem !important;
	border-radius: 50% !important;
	background: #d1fae5 !important;
	color: #047857 !important;
	font-size: 1.5rem !important;
	font-weight: 700 !important;
	line-height: 1 !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-heading {
	margin: 0 0 0.5rem !important;
	padding: 0 !important;
	font-family: var(--ff-font) !important;
	font-size: 1.5rem !important;
	font-weight: 700 !important;
	line-height: 1.25 !important;
	color: #0f172a !important;
	border: none !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-text {
	margin: 0 0 0.75rem !important;
	padding: 0 !important;
	font-family: var(--ff-font) !important;
	font-size: 1.0625rem !important;
	font-weight: 600 !important;
	line-height: 1.45 !important;
	color: #065f46 !important;
	border: none !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-hint {
	margin: 0 0 1.5rem !important;
	padding: 0 !important;
	font-family: var(--ff-font) !important;
	font-size: 0.9375rem !important;
	font-weight: 400 !important;
	line-height: 1.5 !important;
	color: #64748b !important;
	border: none !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-actions {
	margin: 0 !important;
	padding: 0 !important;
	display: flex !important;
	justify-content: center !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-button {
	display: inline-block !important;
	margin: 0 !important;
	padding: 0.75rem 1.75rem !important;
	font-family: var(--ff-font) !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
	line-height: normal !important;
	letter-spacing: normal !important;
	text-align: center !important;
	text-decoration: none !important;
	color: #ffffff !important;
	background: var(--ff-submit) !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: var(--ff-radius-control) !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
	cursor: pointer !important;
	transition:
		background-color 0.15s ease,
		box-shadow 0.15s ease,
		transform 0.1s ease !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-button:hover {
	color: #ffffff !important;
	background: var(--ff-submit-hover) !important;
	box-shadow: 0 2px 6px rgba(237, 28, 36, 0.35) !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-button:active {
	color: #ffffff !important;
	background: var(--ff-submit-active) !important;
	transform: translateY(1px) !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-button:focus-visible {
	outline: 2px solid var(--ff-submit) !important;
	outline-offset: 3px !important;
}

.fossedal-form[data-fossedal-form="1"].fossedal-form--plain .fossedal-form__success {
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 1.75rem 0 1rem !important;
	background: transparent !important;
}

.fossedal-form[data-fossedal-form="1"] .fossedal-form__notice--error {
	background: #fef2f2 !important;
	background-image: none !important;
	border-color: #fecaca !important;
	color: #991b1b !important;
}

/* layout=plain: skjema uten avrundet kort / ytre ramme og skygge */
.fossedal-form[data-fossedal-form="1"].fossedal-form--plain .fossedal-form__form {
	background: transparent !important;
	background-image: none !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
}

@media (min-width: 480px) {
	.fossedal-form[data-fossedal-form="1"] .fossedal-form__form {
		padding: 2rem 1.75rem 1.75rem !important;
	}

	.fossedal-form[data-fossedal-form="1"].fossedal-form--plain .fossedal-form__form {
		padding: 0 !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fossedal-form[data-fossedal-form="1"] .fossedal-form__form input.fossedal-form__input,
	.fossedal-form[data-fossedal-form="1"] .fossedal-form__form textarea.fossedal-form__textarea,
	.fossedal-form[data-fossedal-form="1"] .fossedal-form__form button.fossedal-form__submit,
	.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-button {
		transition: none !important;
	}

	.fossedal-form[data-fossedal-form="1"] .fossedal-form__form button.fossedal-form__submit:active,
	.fossedal-form[data-fossedal-form="1"] .fossedal-form__success-button:active {
		transform: none !important;
	}
}
