.tippy-box[data-theme~='input-ntf'] {
	border-radius: calc(28px / 2);
	background-color: $color-white;

	.tippy-content {
		padding: 6px 10px;
		font-weight: 500;
		font-size: 14px;
		line-height: 16px;
		color: $color-black;
	}

	.tippy-arrow {
		color: $color-white;
	}

	&[role='error'] {
		background-color: $color-error-primary;

		.tippy-content {
			color: $color-white;
		}

		.tippy-arrow {
			color: $color-error-primary;
		}
	}

	&[role='success'] {
		background-color: $color-success-primary;

		.tippy-content {
			color: $color-white;
		}

		.tippy-arrow {
			color: $color-success-primary;
		}
	}
}

.input-group {
	display: flex;
	flex-flow: row nowrap;

	.input-wrapper {
		flex: 1;
		border-radius: 0;

		&:nth-child(1) {
			border-radius: 10px 0 0 10px;

			@include desktop {
				border-radius: 12px 0 0 12px;
			}
		}

		&:nth-child(2) {
			border-radius: 0 10px 10px 0;

			@include desktop {
				border-radius: 0 12px 12px 0;
			}
		}

		&:not(:last-child) {
			&::after {
				content: '';
				position: absolute;
				top: 7px;
				bottom: 7px;
				right: -0.5px;
				width: 1px;
				background-color: $color-border;
			}
		}
	}
}

.input-wrapper {
	$self: &;
	position: relative;

	&--textarea {
		.input-textarea {
			width: 100%;
		}
	}

	&:not(#{ $self }--textarea) {
		height: 54px;
		border-radius: 10px;
		background-color: $color-surface;

		&.input-wrapper--primary {
			background-color: $color-white;
		}

		@include desktop {
			height: 64px;
			border-radius: 12px;
		}
	}
}

.input-placeholder {
	position: absolute;
	top: calc(50% - 16px / 2);
	left: 0;
	right: 0;
	font-size: 14px;
	padding: 0 14px;
	line-height: 16px;
	color: $color-gray-md;
	pointer-events: none;
	z-index: 1;
	transition:
		top 0.3s ease,
		font-size 0.3s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;

	@include desktop {
		font-size: 16px;
		line-height: 18px;
		padding: 0 16px;
	}
}

.input-default {
	position: absolute;
	inset: 0;
	background-color: transparent;
	padding: 0px 14px;
	font-size: 14px;
	color: $color-black;
	text-overflow: ellipsis;

	@include desktop {
		font-size: 16px;
		padding: 0px 16px;
	}

	&:focus,
	&:not(:placeholder-shown) {
		padding-top: calc(14px + 4px);

		@include desktop {
			padding-top: calc(16px + 6px);
		}
	}

	&:focus ~ .input-placeholder,
	&:not(:placeholder-shown) ~ .input-placeholder {
		top: 10px;
		font-size: 12px;
		line-height: 14px;

		@include desktop {
			top: 12px;
			font-size: 14px;
			line-height: 16px;
		}
	}
}

.input-ntf {
	cursor: pointer;
	position: absolute;
	top: calc(50% - 24px / 2);
	right: 14px;
	width: 24px;
	height: 24px;
	z-index: 2;

	@include desktop {
		right: 16px;
	}
}

.input-select {
	cursor: pointer;

	&.opened {
		.input-select-arrow {
			color: $color-green;
			transform: rotate(-180deg);
		}
	}

	.input-default {
		padding-right: calc(24px + 14px + 4px);
		pointer-events: none;

		@include desktop {
			padding-right: calc(24px + 16px + 4px);
		}
	}
}

.input-select-arrow {
	position: absolute;
	top: calc(50% - 24px / 2);
	right: 14px;
	width: 24px;
	height: 24px;
	z-index: 2;
	pointer-events: none;
	transition:
		transform 0.3s ease,
		color 0.3s ease;
}

.input-select-list {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	display: flex;
	flex-flow: column;
	padding: 20px;
	border-radius: 20px;
	background-color: $color-white;
	color: $color-black;
	box-sizing: border-box;
	box-shadow: 0px 8px 40px rgba(#000, 0.08);
	transition:
		opacity 0.3s ease,
		visibility 0.3s ease,
		margin-top 0.3s ease;
	z-index: 9;

	@include desktop {
		top: calc(100% + 18px);
	}

	&:not(.opened) {
		opacity: 0;
		visibility: hidden;
		margin-top: 10px;
	}
}

.input-select-list__item {
	cursor: pointer;
	line-height: 18px;

	&:not(:last-child) {
		padding-bottom: 12px;
		margin-bottom: 12px;
		border-bottom: 1px solid $color-border;
	}

	@include desktop {
		&:hover {
			color: $color-green;
		}
	}
}

.input-prefix {
	position: absolute;
	bottom: 10px;
	transform: translateX(calc(14px + 4px));
	font-size: 14px;
	line-height: 16px;
	color: $color-gray-md;
	pointer-events: none;

	@include desktop {
		bottom: 12px;
		font-size: 16px;
		line-height: 18px;
		transform: translateX(calc(16px + 4px));
	}
}

.input-checkbox {
	display: flex;
	flex-flow: row nowrap;
	align-items: center;
	gap: 10px;

	&--primary {
		.input-checkbox__box {
			background-color: $color-white;
		}
	}

	input {
		display: none;

		&:checked ~ .input-checkbox__box {
			background-color: $color-green;
			background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 14L8.5 17.5L19 6.5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
			background-repeat: no-repeat;
			background-size: 100% 100%;
		}
	}

	&.error {
		.input-checkbox__box {
			box-shadow: 0 0 0 1px $color-error-primary;
		}
	}
}

.input-checkbox__box {
	width: 24px;
	height: 24px;
	border-radius: 6px;
	background-color: $color-surface;
}

.input-checkbox__text {
	flex: 1;
	font-size: 14px;
	font-weight: 500;
	line-height: 16px;
}

.input-tumbler {
	display: flex;
	flex-flow: row nowrap;
	align-items: center;
	gap: 10px;

	input[type='checkbox'] {
		display: none;
	}

	input:checked ~ .input-tumbler__box {
		background-color: $color-success-primary;

		&::before {
			margin-left: calc(39px - 20px - 2px);
		}
	}
}

.input-tumbler__box {
	cursor: pointer;
	width: 39px;
	height: 24px;
	border-radius: calc(24px / 2);
	background-color: $color-gray-md;
	transition: background-color 0.3s ease;

	&::before {
		content: '';
		display: block;
		width: 20px;
		height: 20px;
		margin: 2px;
		border-radius: 50%;
		background-color: $color-white;
		transition: margin 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	}
}

.input-tumbler__text {
	flex: 1;
	font-weight: 700;
	letter-spacing: -0.03em;
}

.input-textarea {
	padding: 16px;
	height: 139px;
	border-radius: 16px;
	background-color: $color-surface;
	font-size: 16px;
	line-height: 18px;
	resize: none;
	box-sizing: border-box;

	&::placeholder {
		color: $color-gray-md;
	}

	@include mobile {
		font-size: 14px;
	}
}

.input-file {
	display: flex;
	flex-flow: row nowrap;
	align-items: center;
	gap: 20px;
}

.input-file__label {
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 64px;
	padding: 0px 16px;
	border-radius: 12px;
	border: 1px solid $color-border;
	box-sizing: border-box;

	svg {
		width: 24px;
		height: 24px;
		color: $color-green;
	}

	span {
		font-size: 16px;
		line-height: 18px;
	}

	input[type='file'] {
		display: none;
	}

	@include desktop {
		&:hover {
			border-color: $color-green;
		}
	}
}

.input-file__value {
	flex: 1;
	font-size: 16px;
	line-height: 18px;
	color: $color-gray-md;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
