/*
 * Eventyrskogen-styling av DNBs <nybygg-widget> ("Meld interesse").
 *
 * Widgeten er en Angular-komponent (uten shadow DOM) som injiserer sine egne
 * stiler i <head> ved oppstart, og de er satt med !important. Derfor må alt
 * her ha både !important og høyere spesifisitet - vi legger #autoprospekt-form
 * (id) inn i hver selektor, som slår komponentens klasse+attributt-selektorer.
 *
 * Merk: DNBs nedlastbare CSS-mal treffer eldre klassenavn (.form-group,
 * .autoprospekt-widget-frame direkte). Klassene under er hentet fra
 * widget-bundlen slik den faktisk ser ut nå: .autoprospekt-widget-form-group,
 * .autoprospekt-widget-checkbox-label, .autoprospekt-widget-error-text osv.
 * Feltene er #name, #email, #mobile, #postalCode, og avkrysningsboksene
 * #contactFinance (lånetilbud) og #contactEvaluation (verdivurdering).
 */

/* Rammen er låst til 425x684px hos DNB - la den flyte i kortet i stedet. */
#autoprospekt-form .autoprospekt-widget-frame {
	width: 100% !important;
	height: auto !important;
	font-family: "Manrope", system-ui, -apple-system, sans-serif !important;
	font-size: 1rem !important;
	color: var(--ink) !important;
}

#autoprospekt-form #autoprospekt-form-container {
	display: grid !important;
	gap: 1rem !important;
}

#autoprospekt-form .autoprospekt-widget-frame h2 {
	font-family: "Fraunces", "Iowan Old Style", Georgia, serif !important;
	font-weight: 400 !important;
	font-size: 1.35rem !important;
	line-height: 1.2 !important;
	text-align: left !important;
	margin: 0 0 .25rem !important;
	color: var(--ink) !important;
}

#autoprospekt-form .autoprospekt-widget-frame a,
#autoprospekt-form .autoprospekt-widget-frame a.autoprospekt-widget-link {
	color: var(--aqua-2) !important;
	text-decoration: underline !important;
	text-underline-offset: 2px !important;
}

/* Feltgrupper: samme rytme som temaets egne .field-er. */
#autoprospekt-form .autoprospekt-widget-form-group {
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
}

#autoprospekt-form .autoprospekt-widget-frame label {
	display: block !important;
	width: 100% !important;
}

#autoprospekt-form .autoprospekt-widget-frame label span {
	display: block !important;
	margin-bottom: .35rem !important;
	font-size: .7rem !important;
	font-weight: 600 !important;
	letter-spacing: .1em !important;
	text-transform: uppercase !important;
	color: var(--ink-3) !important;
}

#autoprospekt-form .autoprospekt-widget-frame label input,
#autoprospekt-form .autoprospekt-widget-frame input[type="text"] {
	font: inherit !important;
	height: auto !important;
	padding: .7rem .85rem !important;
	width: 100% !important;
	color: var(--ink) !important;
	background: var(--panel) !important;
	border: 1px solid var(--line-2) !important;
	border-radius: 10px !important;
}

#autoprospekt-form .autoprospekt-widget-frame input::placeholder {
	color: var(--ink-3) !important;
}

#autoprospekt-form .autoprospekt-widget-frame input:focus-visible {
	outline: 2px solid var(--gold-2) !important;
	outline-offset: 2px !important;
	border-color: var(--gold-2) !important;
}

/* Avkrysningsboksene (lånetilbud / verdivurdering) - egen rute i gull,
   siden DNB skjuler selve input-en og tegner en <span> i stedet. */
#autoprospekt-form .autoprospekt-widget-frame label.autoprospekt-widget-checkbox-label {
	padding-left: 30px !important;
	font-size: .9rem !important;
	line-height: 1.45 !important;
	color: var(--ink-2) !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}

#autoprospekt-form .autoprospekt-widget-frame label.autoprospekt-widget-checkbox-label span {
	display: inline !important;
	margin-bottom: 0 !important;
	font-size: inherit !important;
	font-weight: 400 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: inherit !important;
}

#autoprospekt-form .autoprospekt-widget-frame input[type="checkbox"] + span {
	width: 18px !important;
	height: 18px !important;
	top: 2px !important;
	background: var(--panel) !important;
	border: 1px solid var(--line-2) !important;
	border-radius: 5px !important;
}

#autoprospekt-form .autoprospekt-widget-frame input[type="checkbox"]:checked + span {
	background: var(--gold-2) !important;
	border-color: var(--gold-2) !important;
}

#autoprospekt-form .autoprospekt-widget-frame input[type="checkbox"]:checked + span:before {
	left: 6px !important;
	top: 2px !important;
	width: 4px !important;
	height: 9px !important;
	border-color: #2A1F05 !important;
}

/* "Send" - samme gullpille som resten av siden (.btn-gold). */
#autoprospekt-form .autoprospekt-widget-frame button {
	font: 600 .92rem/1 "Manrope", system-ui, sans-serif !important;
	padding: .95rem 1.45rem !important;
	margin: .4rem 0 0 !important;
	width: 100% !important;
	color: #2A1F05 !important;
	background: var(--gold-2) !important;
	border: 1px solid transparent !important;
	border-radius: 999px !important;
	cursor: pointer !important;
	transition: transform .18s, box-shadow .18s !important;
}

#autoprospekt-form .autoprospekt-widget-frame button:hover:not(:disabled) {
	transform: translateY(-2px) !important;
	box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .5) !important;
}

#autoprospekt-form .autoprospekt-widget-frame button:disabled {
	color: var(--ink-3) !important;
	background: var(--panel-2) !important;
	cursor: not-allowed !important;
}

/* Valideringsfeil */
#autoprospekt-form .autoprospekt-widget-error-text,
#autoprospekt-form .error-text {
	margin-top: .35rem !important;
	font-size: .82rem !important;
	color: var(--sold) !important;
}

#autoprospekt-form .autoprospekt-widget-error,
#autoprospekt-form .error:after {
	color: var(--sold) !important;
}

/* Info-popupene ("hva er verdivurdering?" o.l.) og takk-skjermen */
#autoprospekt-form .autoprospekt-popup-container {
	padding-top: 2rem !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

#autoprospekt-form .autoprospekt-popup-content {
	color: var(--ink) !important;
	background: var(--panel-2) !important;
	border: 1px solid var(--line-2) !important;
	border-radius: 16px !important;
	padding: 1.1rem 1.2rem !important;
	font-size: .92rem !important;
	line-height: 1.5 !important;
}

#autoprospekt-form .autoprospekt-popup-content .autoprospekt-widget-close,
#autoprospekt-form .autoprospekt-popup-content .close {
	background: var(--panel) !important;
}

#autoprospekt-form .text-center {
	text-align: left !important;
}
