﻿/*------------------------------------------------------------
	Controls & Form Fields
------------------------------------------------------------*/

.st-form__flex {
	display: flex;
	width: 100%;
	gap: 1rem;
}

.st-form__group {
	margin-bottom: 1rem;
	width: 100%;
}

.st-label {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.st-required {
	color: var(--st-color--error);
}

.st-control__hint {
	margin: .25rem 0 0;
	font-size: .8rem;
}

.st-control.st-control {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 2.75rem;
	padding: 0 1rem;
	color: var(--st-color--text);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	background-color: var(--st-color--background);
	border: 1px solid var(--st-color--border);
	border-radius: var(--st-radius--sm);
	box-sizing: border-box;
	transition: all .2s ease;
}

.st-control.st-control:hover {
	border-color: var(--st-color--border-hover);
}

.st-control.st-control:active,
.st-control.st-control:focus {
	border-color: var(--st-color--border-focus);
	box-shadow: 0 0 0 1px var(--st-color--border-focus);
	outline: none;
}

.st-control.st-control::placeholder {
	color: var(--st-color--gray-400);
	opacity: 0.9;
}

select.st-control option {
	color: var(--st-color--text);
	background-color: var(--st-color--background);
}

textarea.st-control {
	min-height: 6rem;
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
	resize: vertical;
}

/* Control with icon */

.st-control--with-icon {
	position: relative;
}

.st-control--with-icon .st-control__icon {
	position: absolute;
	top: 50%;
	left: 1rem;
	z-index: 1;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	pointer-events: none;
}

.st-control--with-icon:has(.st-control:focus) .st-control__icon {
	color: var(--st-color--border-focus);
}

.st-control--with-icon .st-control__icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.st-control--with-icon .st-control {
	padding-left: 2.5rem;
}

/* Dropzone */

.st-dropzone {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	padding: 2rem 1rem;
	text-align: center;
	color: var(--st-color--text);
	background-color: transparent;
	border: 2px dashed var(--st-color--border);
	border-radius: var(--st-radius--sm);
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.st-dropzone:hover {
	background-color: color-mix(in srgb, var(--st-color--border) 10%, #fff);
}

.st-dropzone__dragover,
.st-dropzone:has(.st-dropzone__overlay:focus),
.st-dropzone:has(.st-dropzone__overlay:active) {
	color: color-mix(in srgb, var(--st-color--border-focus) 75%, #000);
	background-color: color-mix(in srgb, var(--st-color--border-focus) 5%, #fff);
	border-color: var(--st-color--border-focus);
}

.st-dropzone__overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	opacity: 0;
	color: transparent;
	font-size: 0;
	cursor: pointer;
	z-index: 1;
	-webkit-appearance: none;
	appearance: none;
}

.st-dropzone input[type="file"]::-webkit-file-upload-button,
.st-dropzone input[type="file"]::file-selector-button {
	display: none;
}

.st-dropzone__icon {
	display: block;
	margin: 0 auto 0.5rem;
	width: 2.5rem;
	height: 2.5rem;
	flex-shrink: 0;
}

.st-dropzone__icon>svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.st-dropzone__hint {
	position: relative;
	z-index: 0;
	font-weight: 500;
	font-size: 0.9rem;
	pointer-events: none;
}

.st-dropzone__hint-info {
	font-size: 0.8rem;
	opacity: 0.6;
}

.st-dropzone__remove {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 2;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 0;
	width: 1.5rem;
	height: 1.5rem;
	color: var(--st-color--error);
	border: none;
	border-radius: .25rem;
	background-color: transparent;
	transform: scale(1.0);
	outline: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.st-dropzone__remove:hover,
.st-dropzone__remove:active,
.st-dropzone__remove:focus {
	transform: scale(1.1);
}

.st-dropzone__remove>svg {
	position: absolute;
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.st-dropzone--has-file .st-dropzone__remove {
	display: flex;
	overflow: visible;
}
