/* =========================================================
   AUTONEER ORDERS – FORMS
   Labels, controls, help/validation text, action rows.
   Builds on Bootstrap 5 form classes rather than
   replacing them.
   ========================================================= */

.au-form-label,
.form-label {
	font-size: var(--au-font-size);
	font-weight: 500;
	color: var(--au-slate);
	margin-bottom: 4px;
}

.au-form-help {
	font-size: var(--au-font-size-sm);
	color: var(--au-text-muted);
	margin-top: 2px;
}

/* Consistent control styling on top of Bootstrap */
.form-control,
.form-select {
	font-size: var(--au-font-size);
	border-color: var(--au-border-strong);
	border-radius: var(--au-radius-sm);
	color: var(--au-text);
}

.form-control:focus,
.form-select:focus {
	border-color: var(--au-slate-light);
	box-shadow: var(--au-focus-ring);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
	background-color: var(--au-bg-alt);
	color: var(--au-text-muted);
}

/* Reusable local-time selector. The visible selects remain native controls for
   reliable keyboard and mobile interaction; JavaScript synchronizes one hidden
   HH:mm value for forms and page-specific controllers. */
.au-time-select {
	min-width: 0;
}

.au-time-select > .form-label {
	display: block;
}

.au-time-select__controls {
	display: inline-flex;
	align-items: center;
	gap: var(--au-space-1);
	max-width: 100%;
}

.au-time-select__controls .form-select {
	width: 76px;
	min-height: 38px;
	font-variant-numeric: tabular-nums;
}

.au-time-select--sm .au-time-select__controls .form-select {
	width: 64px;
	min-height: 32px;
	font-size: var(--au-font-size-sm);
}

.au-time-select__separator {
	flex: 0 0 auto;
	font-weight: 700;
	color: var(--au-slate);
}

@media (max-width: 575.98px) {
	.au-time-select--sm .au-time-select__controls .form-select {
		min-height: 40px;
	}
}

/* Password field with an inline show/hide toggle. The toggle is pinned to the
   top of the wrapper rather than centred, so a validation message rendered
   underneath the input does not drag it out of the field. */
.au-password {
	position: relative;
}

.au-password__input {
	padding-right: 2.75rem;
}

/* Height is the Bootstrap .form-control box at the same font-size, so the button
   tracks the input rather than the wrapper, which also holds the message. */
.au-password__toggle {
	position: absolute;
	top: 0;
	right: 0;
	height: calc(1.5em + 0.75rem + 2px);
	width: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-size: var(--au-font-size);
	border: none;
	border-radius: 0 var(--au-radius-sm) var(--au-radius-sm) 0;
	background: transparent;
	color: var(--au-text-muted);
	cursor: pointer;
}

.au-password__toggle:hover,
.au-password__toggle:focus-visible {
	color: var(--au-slate);
}

.au-password__toggle:focus-visible {
	outline: none;
	box-shadow: var(--au-focus-ring);
}

/* Responsive action row at the end of a form */
.au-form-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: var(--au-space-2);
	margin-top: var(--au-space-4);
}

@media (max-width: 430px) {
	.au-form-actions {
		flex-direction: column;
	}

	.au-form-actions .au-btn {
		width: 100%;
	}
}

/* Compact inline search form (page header toolbars) */
.au-search {
	display: flex;
	align-items: stretch;
	max-width: 320px;
	width: 100%;
}

.au-search input[type="text"],
.au-search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	padding: 6px 10px;
	font-size: var(--au-font-size);
	border: 1px solid var(--au-border-strong);
	border-right: none;
	border-radius: var(--au-radius-sm) 0 0 var(--au-radius-sm);
	background: var(--au-surface);
	color: var(--au-text);
}

.au-search input:focus {
	outline: none;
	border-color: var(--au-slate-light);
	box-shadow: var(--au-focus-ring);
}

.au-search button {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 12px;
	border: 1px solid var(--au-border-strong);
	border-radius: 0 var(--au-radius-sm) var(--au-radius-sm) 0;
	background: var(--au-slate);
	color: var(--au-text-on-dark);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.au-search button:hover,
.au-search button:focus-visible {
	background: var(--au-slate-light);
}
