/**
 * #Input
 */

.c-input {
	&[type="text"],
	&[type="tel"],
	&[type="number"],
	&[type="email"],
	&[type="date"],
	&[type="password"] {
		width: 100%;
		padding: 7px 9px !important;
		border: 1px solid var(--gray);
		border-radius: var(--rd-1) !important;
		background-color: var(--gray-subtle);
		color: var(--text);
		font-size: var(--fz-16);
		line-height: 1.5;
		transition: border-color var(--duration) ease, box-shadow var(--duration) ease;
		-webkit-appearance: none;
		appearance: none;

		&::placeholder {
			color: var(--gray-darker);
		}
	}

	&[type="date"].wpcf7-date {
		&::placeholder {
			color: var(--black);
		}

		@media (max-width: 768px) {
			width: fit-content;
			white-space: nowrap;

			&::before {
				content: "日付";
				padding-right: 10px;
				font-size: var(--fz-12);
			}
		}
	}

	&:focus {
		outline: none;
		box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
	}
}

textarea.c-input {
	width: 100%;
	height: 150px;
	padding: 7px 9px;
	border: 1px solid var(--gray);
	border-radius: var(--rd-1);
	background-color: var(--gray-subtle);
	color: var(--text);
	font-size: var(--fz-16);
	line-height: 1.5;
	-webkit-appearance: none;
	appearance: none;

	&::placeholder {
		color: var(--gray-darker);
	}
}

.c-input--s {
	width: 80px !important;
}

.c-input--sm {
	width: 100px !important;
}

.c-input--m {
	width: 120px !important;
}

.c-input--ml {
	width: 150px !important;
}

.c-input--l {
	width: 100% !important;

	@media (min-width: 1024px) {
		width: 350px !important;
	}
}

.c-select {
	position: relative;
	width: fit-content;
	max-width: 100%;
	color: var(--text);
	font-size: var(--fz-16);

	.wpcf7-form-control-wrap {
		display: flex;
		flex-direction: column;
	}

	select {
		display: block;
		width: 100%;
		padding: 12px 40px 12px 15px;
		border: 1px solid var(--gray);
		border-radius: var(--rd-1);
		background-color: var(--gray-subtle);
		background-image: none;
		box-shadow: none;
		color: var(--text);
		cursor: pointer;
		text-indent: 0.01px;
		text-overflow: ellipsis;
		-webkit-appearance: none;
		appearance: none;
		outline: none;

		&::-ms-expand {
			display: none;
		}

		&:focus {
			outline: none;
			box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
		}
	}

	&::before {
		content: "";
		position: absolute;
		z-index: 1;
		top: 18px;
		right: 16px;
		width: 10px;
		height: 10px;
		padding: 0;
		border: 2px solid var(--gray-darker);
		border-left: 0;
		border-bottom: 0;
		pointer-events: none;
		translate: 0 -50%;
		rotate: 135deg;
	}
}

.c-checkbox {
	display: block;
	position: relative;
	padding-left: 26px;
	cursor: pointer;
	font-size: var(--fz-16);

	input {
		display: none;

		&:checked + .c-checkbox__check::after {
			opacity: 1;
		}
	}

	.c-checkbox__check {
		position: absolute;
		top: 2px;
		left: 0;
		box-sizing: border-box;
		width: 20px;
		height: 20px;
		border: 1px solid var(--gray);
		border-radius: var(--rd-1);
		background-color: var(--white);

		&::after {
			content: "";
			position: absolute;
			top: calc(50% - 1.5px);
			left: 50%;
			width: 7px;
			height: 14px;
			border: 2px solid var(--black);
			border-width: 0 2px 2px 0;
			opacity: 0;
			transform: rotate(45deg);
			transition: opacity 0.1s ease;
			translate: -50% -50%;
		}
	}
}
