/* =========================================================
   Streamworks — Form controls
   Inputs, selects, radios, checkboxes, labels, plugins
   Loaded by auth-shell-app; remotes use stream-* classes.
   ========================================================= */

/* ---------- Labels & groups ---------- */
.stream-form-group {
	margin-bottom: 18px;
}

.stream-form-group label,
.stream-form-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: var(--stream-color-text-muted);
}

.stream-mandatory {
	color: var(--stream-color-danger);
}

.stream-has-error {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	color: var(--stream-color-danger);
}

.stream-form-hint {
	display: block;
	margin: -14px 4px 16px;
	font-size: 11px;
	color: var(--stream-color-text-soft);
}

.stream-form-file-link {
	display: inline-block;
	margin: -8px 0 14px;
	font-size: 12px;
	color: var(--stream-color-primary);
}

/* ---------- Text, select, textarea ---------- */
.stream-form-control {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 12px;
	border-radius: 8px;
	border: 1px solid var(--stream-color-modal-border);
	background: var(--stream-color-surface-strong);
	color: var(--stream-color-text);
	font: inherit;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.stream-form-control::placeholder {
	color: var(--stream-color-text-soft);
	opacity: 1;
}

.stream-form-control option {
	color: var(--stream-color-text);
	background: var(--stream-color-modal-surface);
}

.stream-form-control:focus {
	outline: none;
	border-color: var(--stream-color-primary);
	box-shadow: 0 0 0 3px var(--stream-color-primary-soft);
}

.stream-form-control.ng-invalid.ng-touched {
	border-color: var(--stream-color-danger);
}

.stream-form-page input[readonly] {
	cursor: pointer;
}

.stream-form-page select[multiple].stream-form-control {
	min-height: 96px;
	padding-top: 16px;
}

/* Border-nested labels (always on top — not floating) */
.stream-float-field {
	position: relative;
	margin-bottom: 22px;
}

.stream-float-field .stream-form-control {
	padding: 14px 12px 10px;
}

.stream-float-field.stream-float-textarea .stream-form-control {
	padding-top: 16px;
	resize: vertical;
	min-height: 110px;
}

.stream-float-label {
	position: absolute;
	left: 10px;
	top: 0;
	transform: translateY(-50%);
	padding: 0 6px;
	margin: 0;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	color: var(--stream-color-text-muted);
	background: var(--stream-color-modal-surface);
	pointer-events: none;
	max-width: calc(100% - 20px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	z-index: 1;
}

.stream-form-page .stream-float-label {
	background: var(--stream-color-surface);
}

.stream-float-field .stream-form-control:focus ~ .stream-float-label {
	color: var(--stream-color-primary);
}

.stream-float-select .stream-form-control {
	appearance: none;
	-webkit-appearance: none;
	color: var(--stream-color-text);
	background-color: var(--stream-color-surface-strong);
	background-image:
		linear-gradient(45deg, transparent 50%, var(--stream-color-text-muted) 50%),
		linear-gradient(135deg, var(--stream-color-text-muted) 50%, transparent 50%);
	background-position:
		calc(100% - 18px) calc(50% - 2px),
		calc(100% - 12px) calc(50% - 2px);
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 34px;
}

/* ---------- Radio & checkbox ---------- */
.stream-form-control-static {
	min-height: 46px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	padding: 10px 12px;
}

.stream-form-control-stack {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	min-height: 46px;
	padding: 10px 12px 12px;
}

.stream-form-stack-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	min-height: 26px;
}

.stream-form-stack-follow {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--stream-color-modal-border, var(--stream-color-border));
}

.stream-form-stack-follow .stream-form-control {
	border: none;
	box-shadow: none;
	background: transparent;
	padding: 4px 0 0;
	border-radius: 0;
}

.stream-form-stack-follow .stream-form-control:focus {
	border: none;
	box-shadow: none;
}

.stream-form-stack-follow.stream-float-select .stream-form-control {
	appearance: none;
	-webkit-appearance: none;
	background-color: transparent;
	background-image:
		linear-gradient(45deg, transparent 50%, var(--stream-color-text-muted) 50%),
		linear-gradient(135deg, var(--stream-color-text-muted) 50%, transparent 50%);
	background-position:
		calc(100% - 14px) calc(50% + 1px),
		calc(100% - 8px) calc(50% + 1px);
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 20px;
}

.stream-form-stack-follow select[multiple].stream-form-control {
	min-height: 88px;
	padding-top: 4px;
}

.stream-form-choice {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--stream-color-text);
	cursor: pointer;
	white-space: nowrap;
}

.stream-form-choice input {
	accent-color: var(--stream-color-primary-strong);
}

/* ---------- File upload progress ---------- */
.stream-progress {
	display: none;
	height: 14px;
	margin: 4px 0 10px;
	overflow: hidden;
	border-radius: 8px;
	background: var(--stream-color-surface-soft);
}

.stream-progress-bar {
	height: 100%;
	width: 0;
	font-size: 10px;
	line-height: 14px;
	text-align: center;
	color: #fff;
	background: var(--stream-color-primary-strong);
}

/* ---------- Datepicker ---------- */
.datepicker-dropdown,
.datepicker.dropdown-menu {
	position: absolute !important;
	z-index: 10050 !important;
	display: none;
	float: left;
	min-width: 160px;
}

.datepicker {
	padding: 8px;
	border-radius: 8px;
	border: 1px solid var(--stream-color-border);
	background: var(--stream-color-modal-surface, #fff);
	box-shadow: 0 12px 28px var(--stream-color-shadow);
	color: var(--stream-color-text);
}

.datepicker table {
	width: 100%;
	border-collapse: collapse;
}

.datepicker table tr td,
.datepicker table tr th {
	text-align: center;
	width: 30px;
	height: 30px;
	cursor: pointer;
}

/* ---------- Select2 ---------- */
.select2-container {
	width: 100% !important;
}

.stream-form-control-stack .select2-container--bootstrap .select2-selection,
.stream-form-control-stack .select2-container--default .select2-selection,
.stream-form-control-static .select2-container--bootstrap .select2-selection,
.stream-form-control-static .select2-container--default .select2-selection {
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	min-height: 32px;
}

.select2-dropdown {
	z-index: 10050;
	border: 1px solid var(--stream-color-border);
	background: var(--stream-color-modal-surface, #fff);
	color: var(--stream-color-text);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
	background: var(--stream-color-primary-soft);
	border: 1px solid var(--stream-color-border);
	color: var(--stream-color-text);
}

.stream-float-field .select2-container {
	display: block;
	width: 100% !important;
}

.stream-float-field .select2-container--default .select2-selection--single,
.stream-float-field .select2-container--bootstrap .select2-selection--single {
	height: 46px;
	border: 1px solid var(--stream-color-modal-border) !important;
	background-color: var(--stream-color-surface-strong) !important;
	background-image:
		linear-gradient(45deg, transparent 50%, var(--stream-color-text-muted) 50%),
		linear-gradient(135deg, var(--stream-color-text-muted) 50%, transparent 50%) !important;
	background-position:
		calc(100% - 18px) calc(50% - 2px),
		calc(100% - 12px) calc(50% - 2px) !important;
	background-size: 6px 6px, 6px 6px !important;
	background-repeat: no-repeat !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	display: flex;
	align-items: center;
}

.stream-float-field .select2-container--default.select2-container--focus .select2-selection--single,
.stream-float-field .select2-container--default.select2-container--open .select2-selection--single,
.stream-float-field .select2-container--bootstrap.select2-container--focus .select2-selection--single,
.stream-float-field .select2-container--bootstrap.select2-container--open .select2-selection--single {
	border-color: var(--stream-color-primary) !important;
	box-shadow: 0 0 0 3px var(--stream-color-primary-soft) !important;
}

.stream-float-field .select2-container--default .select2-selection--single .select2-selection__rendered,
.stream-float-field .select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
	line-height: 46px;
	padding-left: 12px;
	padding-right: 34px;
	color: var(--stream-color-text);
}

.stream-float-field .select2-container--default .select2-selection--single .select2-selection__placeholder,
.stream-float-field .select2-container--bootstrap .select2-selection--single .select2-selection__placeholder {
	color: var(--stream-color-text-soft);
}

.stream-float-field .select2-container--default .select2-selection--single .select2-selection__arrow,
.stream-float-field .select2-container--bootstrap .select2-selection--single .select2-selection__arrow {
	height: 46px;
	width: 34px;
	top: 0;
	right: 0;
}

.stream-float-field .select2-container--default .select2-selection--single .select2-selection__arrow b,
.stream-float-field .select2-container--bootstrap .select2-selection--single .select2-selection__arrow b {
	display: none !important;
}

.select2-search--dropdown .select2-search__field {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid var(--stream-color-border);
	border-radius: 6px;
	color: var(--stream-color-text);
	background: var(--stream-color-surface-strong);
}
