/*
Arch UI Form Styles
Updated: 08/05/2025
*/

form {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
}

fieldset {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
}

/*========= Buttons ==========*/
button.at-button, .at-button, .cluster-button {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: bold;
	line-height: 1.4;
	height: 45px;
	width: 100%;
	border-radius: 5px;
	text-decoration: none;
	white-space: nowrap;
	background: #f9f9f9;
	cursor: pointer;
	transition: background 0.2s ease;
	box-sizing: border-box;
	font-family: inherit;
	border: none;
	outline: none;
	position: relative;
}

.at-button.compact {
	width: auto;
	padding: 0px 10px;
}

.at-button.icon {
	width: 45px;
	min-width: 45px;
}

.at-button a {
	color: inherit;
	text-decoration: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.at-button .count {
    position: absolute;
    top: -7px;
    right: -7px;
    color: #fff;
    background-color: #1b2831;
    border-radius: 50%;
    width: 20px;
    height: 20px;
}

.at-button-cluster {
	display: flex;
	align-items: center;
	border: 1px solid #ccc;
	border-radius: 4px;
	overflow: hidden;
	background: #f9f9f9;
}

.cluster-button {
	padding: 2px 6px;
	font-size: 16px;
}

.cluster-button + .cluster-button {
	border-left: 1px solid #ddd;
}

.icon-button {
    gap: 20px;
}

.icon-button svg {
	height: 100%;
    max-height: 100%;
    fill: #fff;
}

.at-button.primary {
	background: #79b92e;
	color: #fff;
}

.at-button.primary svg {
	fill: #fff;
}

.at-button.primary:hover {
	background: #64b702;
}

.at-button.alt {
	background: #1c2833;
	color: #fff;
}

.at-button.alt svg {
	fill: #fff;
}

.at-button.alt:hover {
	background: #3b4a5a;
}

.at-button.minimal {
	background: transparent;
	color: #66c000;
	border: transparent;
}

.at-button.minimal svg {
	fill: #66c000;
}

.at-button.minimal:hover {
	background: rgba(255, 255, 255, 0.1);
}

.at-button.danger {
	background: #dc3545;
	color: #fff;
	border-color: #dc3545;
}

.at-button.danger:hover {
	background: #a71d2a;
	border-color: #a71d2a;
}

.at-button.hidden {
	visibility: hidden;
}

/*========= Input Fields ==========*/
.at-field {
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.at-field label {
	position: absolute;
	top: 4px;
	left: 8px;
	color: #333;
	font-size: 10px;
	pointer-events: none;
}

/* Floating label inputs */
.at-field[data-type="text"] input,
.at-field[data-type="email"] input,
.at-field[data-type="tel"] input,
.at-field[data-type="url"] input,
.at-field[data-type="date"] input,
.at-field[data-type="password"] input,
.at-field[data-type="number"] input,
.at-field[data-type="textarea"] textarea,
.at-field[data-type="select"] select {
	display: block;
	width: 100%;
	height: 45px;
	border: none;
	border-radius: 5px;
	font-size: 20px;
	padding-top: 15px;
	padding-left: 10px;
	box-sizing: border-box;
}

.at-field[data-type="textarea"] textarea {
	height: 200px;
}

.at-field input:focus-visible,
.at-field textarea:focus-visible,
.at-field select:focus-visible {
	outline: none;
}

/* Checkbox */
.at-field[data-type="checkbox"] label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	position: static;
	top: auto;
	left: auto;
	color: #fff;
	font-size: 15px;
}

.at-field[data-type="checkbox"] input[type="checkbox"] {
	height: 20px;
	width: 20px;
}

/* Upload input container */
.at-field[data-type="upload"] {
	position: relative;
}

.at-field[data-type="upload"] label {
	position: absolute;
	top: 1px;
	left: 42px;
	font-size: 11px;
}

.at-field[data-type="upload"] input[type="text"] {
	padding-left: 41px;
	height: 40px;
	padding-top: 12px;
	box-sizing: border-box;
}

.at-field[data-type="upload"] .at-icon {
	position: absolute;
	left: 3px;
	top: 3px;
	font-size: 35px;
	pointer-events: none;
}

/* Select replacement styles */
.at-select {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	font-size: 13px;
	line-height: 1.4;
	min-height: 26px;
	color: #333;
	background: #f9f9f9;
	border: 1px solid #ccc;
	border-radius: 4px;
	cursor: pointer;
	box-sizing: border-box;
	transition: background 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-image: url('data:image/svg+xml;utf8,<svg fill="%23666" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
	background-repeat: no-repeat;
	background-position: right 6px center;
	background-size: 16px 16px;
	padding-right: 28px;
}

.at-select:hover {
	background: #eee;
}

.at-select:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(100, 150, 250, 0.2);
}

/* Inline layouts */
.organized-inline {
	display: flex;
	gap: 10px;
	width: 100%;
}

@media screen and (max-width: 570px) {
	.at-button.icon-button .btn-text {
		display: none;
	}
	.organized-inline {
    	flex-wrap: wrap;
	}
}