/* Thai Tolketjenesten – forespørselsskjema
   Fargene hentes fra temaets paletten, med trygge reserver. */

.ttt-fp {
	--ttt-navy: var(--wp--preset--color--color2, #00247d);
	--ttt-red: var(--wp--preset--color--primary, #a51931);
	--ttt-red-dark: #8a1428;
	--ttt-ink: var(--wp--preset--color--contrast, #172033);
	--ttt-soft: var(--wp--preset--color--color1, #f1f4fa);
	--ttt-line: #c9d2e3;
	--ttt-err: #9b1c1c;
	color: var(--ttt-ink);
}

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

/* --- Grupper ---------------------------------------------------------- */

.ttt-fp__group {
	border: 1px solid var(--ttt-line);
	border-radius: 14px;
	background: #fff;
	padding: 22px;
	margin: 0 0 20px;
	min-width: 0;
}

.ttt-fp__legend {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.18rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--ttt-navy);
	padding: 0;
	margin-bottom: 4px;
}

.ttt-fp__step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--ttt-navy);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 700;
}

.ttt-fp__lead {
	margin: 10px 0 16px;
	font-size: 0.95rem;
}

/* --- Felt ------------------------------------------------------------- */

.ttt-fp__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0 18px;
}

.ttt-fp__row > .ttt-fp__field {
	flex: 1 1 220px;
	min-width: 0;
}

.ttt-fp__field {
	display: block;
	margin: 16px 0 0;
	min-width: 0;
}

.ttt-fp__field > label,
.ttt-fp__choice > span {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	margin-bottom: 6px;
	line-height: 1.4;
}

.ttt-fp__req {
	font-weight: 400;
	color: var(--ttt-red);
	font-size: 0.85em;
}

.ttt-fp__optional {
	font-weight: 400;
	opacity: 0.7;
	font-size: 0.85em;
}

.ttt-fp input[type="text"],
.ttt-fp input[type="email"],
.ttt-fp input[type="tel"],
.ttt-fp input[type="date"],
.ttt-fp input[type="time"],
.ttt-fp select,
.ttt-fp textarea {
	width: 100%;
	max-width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--ttt-line);
	border-radius: 8px;
	background: #fff;
	color: var(--ttt-ink);
	font: inherit;
	font-size: 1rem; /* hindrer at iOS zoomer inn */
	line-height: 1.4;
}

.ttt-fp textarea {
	resize: vertical;
	min-height: 120px;
}

.ttt-fp input:focus-visible,
.ttt-fp select:focus-visible,
.ttt-fp textarea:focus-visible,
.ttt-fp button:focus-visible,
.ttt-fp a:focus-visible {
	outline: 3px solid var(--ttt-navy);
	outline-offset: 2px;
}

.ttt-fp__hint {
	display: block;
	margin-top: 6px;
	font-size: 0.85rem;
	line-height: 1.45;
	opacity: 0.8;
}

/* --- Valg (radio) ------------------------------------------------------ */

.ttt-fp__choices {
	display: grid;
	gap: 10px;
	margin-top: 14px;
}

.ttt-fp__choice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid var(--ttt-line);
	border-radius: 10px;
	cursor: pointer;
	background: #fff;
	transition: border-color 0.15s, background-color 0.15s;
}

.ttt-fp__choice:hover {
	border-color: var(--ttt-navy);
	background: var(--ttt-soft);
}

.ttt-fp__choice > span {
	margin: 0;
	font-weight: 500;
}

.ttt-fp__choice input[type="radio"] {
	margin: 2px 0 0;
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	accent-color: var(--ttt-navy);
}

.ttt-fp__choice:has(input:checked) {
	border-color: var(--ttt-navy);
	background: var(--ttt-soft);
	box-shadow: inset 0 0 0 1px var(--ttt-navy);
}

/* --- Merknad i skjemaet ------------------------------------------------ */

.ttt-fp__merknad {
	margin: 16px 0 0;
	padding: 14px 16px;
	border-left: 4px solid var(--ttt-navy);
	border-radius: 0 8px 8px 0;
	background: var(--ttt-soft);
	font-size: 0.92rem;
	line-height: 1.55;
}

.ttt-fp__merknad p {
	margin: 0;
}

/* --- Betingede felt ---------------------------------------------------- */

.ttt-fp__cond[hidden],
.ttt-fp__other[hidden] {
	display: none !important;
}

/* --- Filopplasting ----------------------------------------------------- */

.ttt-fp__drop {
	margin-top: 4px;
	padding: 18px;
	border: 2px dashed var(--ttt-line);
	border-radius: 12px;
	background: var(--ttt-soft);
}

.ttt-fp__drop.is-dragover {
	border-color: var(--ttt-navy);
	background: #e6ecf8;
}

.ttt-fp__filelabel {
	display: inline-block;
	margin-bottom: 10px;
	font-weight: 600;
}

.ttt-fp input[type="file"] {
	display: block;
	width: 100%;
	max-width: 100%;
	font: inherit;
	font-size: 0.95rem;
}

.ttt-fp__filelist {
	list-style: none;
	margin: 14px 0 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.ttt-fp__filelist:empty {
	margin: 0;
}

.ttt-fp__fileitem {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding: 10px 12px;
	border: 1px solid var(--ttt-line);
	border-radius: 8px;
	background: #fff;
	font-size: 0.92rem;
}

.ttt-fp__filename {
	flex: 1 1 140px;
	min-width: 0;
	overflow-wrap: anywhere;
	font-weight: 500;
}

.ttt-fp__filesize {
	opacity: 0.7;
	white-space: nowrap;
}

.ttt-fp__fileremove {
	flex: 0 0 auto;
	border: 1px solid var(--ttt-line);
	background: #fff;
	color: var(--ttt-red);
	border-radius: 6px;
	padding: 5px 12px;
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}

.ttt-fp__fileremove:hover {
	border-color: var(--ttt-red);
	background: #fdf1f3;
}

/* --- Samtykke ---------------------------------------------------------- */

.ttt-fp__consent > label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-weight: 400;
	font-size: 0.95rem;
	line-height: 1.5;
}

.ttt-fp__consent input[type="checkbox"] {
	margin: 2px 0 0;
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	accent-color: var(--ttt-navy);
}

.ttt-fp__consent > label > span {
	font-weight: 400;
	margin: 0;
}

/* --- Knapp ------------------------------------------------------------- */

.ttt-fp__submit {
	margin: 24px 0 0;
}

.ttt-fp__btn {
	display: inline-block;
	width: 100%;
	padding: 14px 28px;
	border: 2px solid transparent;
	border-radius: 8px;
	background: var(--ttt-red);
	color: #fff;
	font: inherit;
	font-size: 1.05rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s;
}

.ttt-fp__btn:hover {
	background: var(--ttt-red-dark);
}

@media (min-width: 600px) {
	.ttt-fp__btn {
		width: auto;
	}
}

.ttt-fp__fineprint {
	margin: 14px 0 0;
	font-size: 0.85rem;
	opacity: 0.8;
}

/* --- Feil og kvittering ------------------------------------------------- */

.ttt-fp__errors {
	border: 1px solid var(--ttt-err);
	border-left-width: 6px;
	border-radius: 10px;
	background: #fdf1f3;
	padding: 18px 20px;
	margin: 0 0 22px;
}

.ttt-fp__errors-title {
	margin: 0 0 8px;
	font-weight: 700;
	color: var(--ttt-err);
}

.ttt-fp__errors ul {
	margin: 0;
	padding-left: 20px;
}

.ttt-fp__errors a {
	color: var(--ttt-err);
}

.ttt-fp__errors-note {
	margin: 12px 0 0;
	font-size: 0.9rem;
}

.ttt-fp__err {
	display: block;
	margin: 0 0 6px;
	color: var(--ttt-err);
	font-weight: 600;
	font-size: 0.9rem;
}

.ttt-fp__field--error input,
.ttt-fp__field--error textarea,
.ttt-fp__field--error select {
	border-color: var(--ttt-err);
	border-width: 2px;
}

.ttt-fp__receipt {
	border: 1px solid var(--ttt-navy);
	border-left-width: 6px;
	border-radius: 12px;
	background: var(--ttt-soft);
	padding: 26px 24px;
}

.ttt-fp__receipt-title {
	margin: 0 0 10px;
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--ttt-navy);
}

.ttt-fp__receipt p {
	margin: 0 0 10px;
}

.ttt-fp__receipt-more {
	margin: 16px 0 0;
	font-size: 0.9rem;
}

/* --- Honningkrukke ------------------------------------------------------ */

.ttt-fp__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Små skjermer -------------------------------------------------------- */

@media (max-width: 480px) {
	.ttt-fp__group {
		padding: 18px 16px;
		border-radius: 12px;
	}

	.ttt-fp__legend {
		font-size: 1.08rem;
	}

	.ttt-fp__row {
		gap: 0;
	}

	.ttt-fp__row > .ttt-fp__field {
		flex: 1 1 100%;
	}
}
