/*
 * Auto Transport one-page order ([qiform_transport], templates/transport-order.php). Loaded after qiform_v2.css, which
 * provides the base look (steps, inputs, radios, buttons, loading overlay) through the shared .qiform classes, and after
 * transport-quote.css (the quote form). This file only adds what those do not have; the rules for the steps are a copy
 * of css/bilagent.css (the two are deliberately separate for now), plus the file box, the quote summary and the
 * order summary.
 */

.qiform-transport {
	--transport-primary: #334d6a; /* same as $primary-color in qiform_v2.scss */
	--transport-alert: #ff4136; /* same as $alert-color in qiform_v2.scss */
	--transport-radius: 8px;
}

/* The author rules below set display on elements that JS toggles with the
   hidden attribute, which would otherwise lose to them. */
.qiform-transport [hidden] {
	display: none !important;
}

/* The open step shows its content from the first paint. Once JS runs it takes over (it sets an inline display on
   the open step and adds --js): this rule must not outlive that, or a step that loses --active would vanish at
   once instead of sliding up with jQuery's slideUp. */
.qiform-transport:not(.qiform-transport--js) .qiform__step--active > .qiform__content {
	display: block;
}

.qiform-transport form.qiform {
	margin-top: 20px;
}

/* "Ændr" / "Start forfra" scroll to the quote's form tag: leave some air above it instead of sitting flush at the top. */
.qiform-transport [data-quote] form {
	scroll-margin-top: 40px;
}

/* The quote, once the order is started: one line with the choice and the price, and a way back. */
.transport__quote-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px 20px;
	padding: 15px 20px;
	border: 1px solid #dedede;
	border-radius: var(--transport-radius);
	background: #fff;
}

.transport__quote-summary-price {
	margin-left: auto;
	font-size: 1.4em;
	font-weight: bold;
}

.transport__quote-summary a {
	color: var(--transport-primary);
	text-decoration: underline;
}

.transport__quote-summary a:hover {
	text-decoration: none;
}

.transport__badge {
	display: inline-block;
	margin-right: 10px;
	vertical-align: middle;
	padding: 2px 8px;
	border: 1px solid #6ee7b7;
	border-radius: 4px;
	background: #d1fae5;
	color: #065f46;
	font-size: 11px;
	font-weight: bold;
	white-space: nowrap;
}

.transport__headline {
	margin: 0 0 10px;
	font-weight: bold;
}

.transport__note {
	margin: 10px 0;
	font-size: 0.9em;
}

.transport__help {
	display: block;
	margin-top: 4px;
	font-size: 0.85em;
	line-height: 1.5;
}

/* Fields the server has fixed (country, ZIP code, car type, and the car of a verified QuickID). */
.qiform-transport .qiform__input input[readonly] {
	background: rgba(51, 77, 106, 0.08);
	color: #555;
	cursor: not-allowed;
}

/* Back / next: back on the left, next on the right. */
.transport__nav {
	justify-content: space-between;
	align-items: center;
	flex-wrap: nowrap;
}

.transport__nav .qiform__input {
	width: auto;
	margin: 10px 0 0;
}

.transport__nav [data-travel="back"] {
	margin-left: 0;
	background: transparent;
	color: var(--transport-primary);
	border: 1px solid var(--transport-primary);
}

/* The partner halls: a box that opens a searchable list (a port of the old form's partnerdropdown.css). */
.qiform-transport .partner {
	position: relative;
	margin: 10px 0 0;
}

.qiform-transport .partner__opener {
	position: relative;
	padding: 0.75em 30px 0.75em 0.75em;
	border: 1px solid #ccc;
	border-radius: 2px;
	background: #fff;
	color: #666;
	cursor: pointer;
	user-select: none;
}

.qiform-transport .partner__opener:after {
	content: "\2303";
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%) rotate(180deg);
	font-size: 18px;
	line-height: 18px;
}

.qiform-transport .partner__opener[aria-expanded="true"]:after {
	transform: translateY(-50%);
}

.qiform-transport .partner__container {
	position: absolute;
	z-index: 20;
	left: 0;
	width: 100%;
	max-height: 400px;
	overflow: auto;
	padding: 10px;
	border: 1px solid #ccc;
	background: #fff;
}

.qiform-transport .partner__search {
	padding: 10px;
}

.qiform-transport .partner__search input {
	margin-bottom: 10px;
}

.qiform-transport .partner__result {
	color: var(--transport-alert);
}

.qiform-transport .partner__list {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qiform-transport .partner__list li {
	width: 50%;
	margin: 0;
	padding: 10px;
	cursor: pointer;
}

.qiform-transport .partner__list li:hover,
.qiform-transport .partner__list li:focus {
	background: rgba(51, 77, 106, 0.1);
	outline: none;
}

.qiform-transport .partner__or {
	position: relative;
	margin: 20px 0;
	text-align: center;
}

.qiform-transport .partner__or:after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	z-index: 1;
	width: 100%;
	height: 1px;
	background: rgba(51, 77, 106, 0.4);
}

.qiform-transport .partner__or span {
	position: relative;
	z-index: 2;
	display: inline-block;
	padding: 3px 12px;
	border-radius: 20px;
	background: var(--transport-primary); /* the form's border colour */
	color: #f4f6f8;
	font-size: 0.85em;
}

@media screen and (max-width: 767px) {
	.qiform-transport .partner__list li {
		width: 100%;
	}
}

/* A stored document's box (qiform_v2.css) is clickable: it removes the document so another can be picked. */
.qiform-transport .qiform__file-name {
	cursor: pointer;
}

.qiform-transport .qiform__file-name:after {
	content: "✖";
	flex-grow: 1;
	text-align: right;
}

/* Consent and terms: the checkbox stays on the first line and the text wraps next to it. */
.qiform-transport .qiform__input--terms.qiform--active {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0 8px;
}

.qiform-transport .qiform__input--terms input[type="checkbox"] {
	flex-shrink: 0;
	margin: 4px 0 0;
}

.qiform-transport .qiform__input--terms label:not(.error) {
	display: block;
	flex: 1;
}

.qiform-transport .qiform__input--terms label.error {
	flex: 0 0 100%;
	padding-left: 21px; /* checkbox width + gap, so it lines up under the text */
}

/* Validation: qiform_v2.css colours the label and a few named inputs; this covers the rest. */
.qiform-transport .qiform__input.error input:not([type="checkbox"]):not([type="file"]),
.qiform-transport .qiform__input.error textarea {
	border-color: var(--transport-alert);
}

.qiform-transport form label.error {
	display: block;
	margin-top: 5px;
	font-size: 0.9em;
	color: var(--transport-alert);
}

.transport__error {
	margin-top: 10px;
	margin-bottom: 10px;
	padding: 10px 15px;
	border: 1px solid var(--transport-alert);
	border-radius: var(--transport-radius);
	background: rgba(255, 65, 54, 0.1);
	color: var(--transport-alert);
}

/* FDM box below the order form (a copy of .bilagent__fdm): --in is the plain "logged in" line without the box. */
.transport__fdm {
	margin-top: 15px;
	padding: 20px;
	border: 1px solid #dedede;
	border-radius: 20px; /* matches the FDM box on the main form */
	background: #fff; /* same white as the FDM box in the quote */
	text-align: center;
}

.transport__fdm .button {
	display: inline-block;
	margin-top: 15px;
}

.transport__fdm--in {
	padding: 0;
	border: 0;
	background: none;
	text-align: right;
}

.transport__fdm-logo {
	display: inline-block;
	width: 100px;
	margin-bottom: 15px;
}

/* Betaling footer: "Start forfra" on the left, the pay button on the right; on a phone the pay button comes first. */
.transport__actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 15px;
	margin-top: 20px;
}

.transport__actions .qiform__input {
	width: auto;
	margin: 0;
}

.transport__reset {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.9em;
	color: var(--transport-primary);
	text-decoration: underline;
	cursor: pointer;
}

.transport__reset:hover {
	text-decoration: none;
	color: var(--transport-alert);
}

.transport__reset-icon {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

@media screen and (max-width: 700px) {
	.transport__actions {
		flex-direction: column-reverse;
		align-items: stretch;
		text-align: center;
	}

	.transport__reset {
		justify-content: center;
	}

	.transport__nav {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	.transport__nav .qiform__input {
		width: 100%;
	}
}
