.wc-block-components-text-input {
	position: relative;
	margin-top: em($gap-large);
	white-space: nowrap;

	label {
		@include reset-typography();
		@include font-size(regular);
		position: absolute;
		transform: translateY(0.75em);
		left: 0;
		top: 0;
		transform-origin: top left;
		line-height: 1.375; // =22px when font-size is 16px.
		color: $gray-700;
		transition: transform 200ms ease;
		margin: 0 0 0 #{$gap + 1px};
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: calc(100% - #{2 * $gap});
		cursor: text;

		.has-dark-controls & {
			color: $input-placeholder-dark;
		}
		@media screen and (prefers-reduced-motion: reduce) {
			transition: none;
		}
	}

	input:-webkit-autofill + label {
		transform: translateY(#{$gap-smallest}) scale(0.75);
	}

	&.is-active label {
		transform: translateY(#{$gap-smallest}) scale(0.75);
	}

	input[type="tel"],
	input[type="url"],
	input[type="text"],
	input[type="email"] {
		@include font-size(regular);
		background-color: #fff;
		padding: em($gap-small) $gap;
		border-radius: 4px;
		border: 1px solid $input-border-gray;
		width: 100%;
		line-height: 1.375; // =22px when font-size is 16px.
		font-family: inherit;
		margin: 0;
		box-sizing: border-box;
		height: 3em;
		min-height: 0;
		color: $input-text-active;

		&:focus {
			background-color: #fff;
		}
		.has-dark-controls & {
			background-color: $input-background-dark;
			border-color: $input-border-dark;
			color: $input-text-dark;
		}
	}

	&.is-active input[type="tel"],
	&.is-active input[type="url"],
	&.is-active input[type="text"],
	&.is-active input[type="email"] {
		padding: em($gap-large) 0 em($gap-smallest) $gap;
	}

	&.has-error input {
		&,
		&:hover,
		&:focus,
		&:active {
			border-color: $alert-red;
		}
		&:focus {
			outline: 1px dotted $alert-red;
			outline-offset: 2px;
		}
	}

	&.has-error label {
		color: $alert-red;
	}

	&:only-child {
		margin-top: 0;
	}
}
