/* =========================
   FORMS
   Shared form-control system
   ========================= */

/* =========================
   FIELD WRAPPERS
   ========================= */

.rv-field,
.rv-auth-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 14px;
}

/* =========================
   LABELS
   ========================= */

.rv-field label,
.rv-auth-field label,
.rv-label {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: rgba(255, 255, 255, 0.88);
}

/* =========================
   TEXT INPUTS / TEXTAREAS / SELECTS
   ========================= */

.rv-input,
.rv-textarea,
.rv-select,
.rv-auth input[type="text"],
.rv-auth input[type="email"],
.rv-auth input[type="password"],
.rv-auth input[type="tel"],
.rv-auth input[type="url"],
.rv-auth input[type="search"],
.rv-auth input[type="number"],
.rv-auth textarea,
.rv-auth select {
	display: block;
	width: 100%;
	min-height: 52px;
	padding: 0 16px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: var(--rv-radius-md);
	background: rgba(0, 0, 0, 0.16);
	color: var(--rv-color-white) !important;
	font-family: var(--rv-font-body);
	font-size: 15px;
	line-height: 1.2;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	transition:
		border-color var(--rv-dur-ui) ease,
		background-color var(--rv-dur-ui) ease,
		box-shadow var(--rv-dur-ui) ease,
		color var(--rv-dur-ui) ease;
}

.rv-textarea,
.rv-auth textarea {
	min-height: 120px;
	padding-top: 14px;
	padding-bottom: 14px;
	resize: vertical;
	line-height: 1.5;
}

.rv-select,
.rv-auth select {
	padding-right: 42px;
	background-image:
		linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.82) 50%),
		linear-gradient(135deg, rgba(255, 255, 255, 0.82) 50%, transparent 50%);
	background-position:
		calc(100% - 18px) calc(50% - 3px),
		calc(100% - 12px) calc(50% - 3px);
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
}

/* =========================
   PLACEHOLDERS
   ========================= */

.rv-input::placeholder,
.rv-textarea::placeholder,
.rv-select::placeholder,
.rv-auth input::placeholder,
.rv-auth textarea::placeholder {
	color: rgba(255, 255, 255, 0.56);
	opacity: 1;
}

/* =========================
   HOVER / FOCUS
   ========================= */

.rv-input:hover,
.rv-textarea:hover,
.rv-select:hover,
.rv-auth input[type="text"]:hover,
.rv-auth input[type="email"]:hover,
.rv-auth input[type="password"]:hover,
.rv-auth input[type="tel"]:hover,
.rv-auth input[type="url"]:hover,
.rv-auth input[type="search"]:hover,
.rv-auth input[type="number"]:hover,
.rv-auth textarea:hover,
.rv-auth select:hover {
	border-color: rgba(255, 255, 255, 0.22);
	background-color: rgba(0, 0, 0, 0.18);
}

.rv-input:focus,
.rv-input:focus-visible,
.rv-textarea:focus,
.rv-textarea:focus-visible,
.rv-select:focus,
.rv-select:focus-visible,
.rv-auth input[type="text"]:focus,
.rv-auth input[type="text"]:focus-visible,
.rv-auth input[type="email"]:focus,
.rv-auth input[type="email"]:focus-visible,
.rv-auth input[type="password"]:focus,
.rv-auth input[type="password"]:focus-visible,
.rv-auth input[type="tel"]:focus,
.rv-auth input[type="tel"]:focus-visible,
.rv-auth input[type="url"]:focus,
.rv-auth input[type="url"]:focus-visible,
.rv-auth input[type="search"]:focus,
.rv-auth input[type="search"]:focus-visible,
.rv-auth input[type="number"]:focus,
.rv-auth input[type="number"]:focus-visible,
.rv-auth textarea:focus,
.rv-auth textarea:focus-visible,
.rv-auth select:focus,
.rv-auth select:focus-visible {
	outline: none !important;
	border-color: rgba(255, 255, 255, 0.28);
	background-color: rgba(0, 0, 0, 0.20);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.04),
		0 0 0 4px rgba(204, 84, 124, 0.22);
}

/* =========================
   DISABLED
   ========================= */

.rv-input:disabled,
.rv-textarea:disabled,
.rv-select:disabled,
.rv-auth input:disabled,
.rv-auth textarea:disabled,
.rv-auth select:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* =========================
   AUTOFILL NORMALIZATION
   Chrome / Edge / Safari
   ========================= */

.rv-input:-webkit-autofill,
.rv-input:-webkit-autofill:hover,
.rv-input:-webkit-autofill:focus,
.rv-textarea:-webkit-autofill,
.rv-textarea:-webkit-autofill:hover,
.rv-textarea:-webkit-autofill:focus,
.rv-select:-webkit-autofill,
.rv-select:-webkit-autofill:hover,
.rv-select:-webkit-autofill:focus,
.rv-auth input:-webkit-autofill,
.rv-auth input:-webkit-autofill:hover,
.rv-auth input:-webkit-autofill:focus,
.rv-auth textarea:-webkit-autofill,
.rv-auth textarea:-webkit-autofill:hover,
.rv-auth textarea:-webkit-autofill:focus,
.rv-auth select:-webkit-autofill,
.rv-auth select:-webkit-autofill:hover,
.rv-auth select:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--rv-color-white) !important;
	caret-color: var(--rv-color-white) !important;
	box-shadow:
		0 0 0 1000px rgba(0, 0, 0, 0.16) inset !important,
		0 0 0 1px rgba(255, 255, 255, 0.14) !important;
	-webkit-box-shadow:
		0 0 0 1000px rgba(0, 0, 0, 0.16) inset !important,
		0 0 0 1px rgba(255, 255, 255, 0.14) !important;
	transition: background-color 9999s ease-out 0s !important;
	border-radius: var(--rv-radius-md) !important;
}

/* =========================
   ERROR / SUCCESS STATES
   ========================= */

.rv-input.is-error,
.rv-textarea.is-error,
.rv-select.is-error,
.rv-auth input.is-error,
.rv-auth textarea.is-error,
.rv-auth select.is-error {
	border-color: rgba(255, 120, 120, 0.75) !important;
	box-shadow:
		0 0 0 1px rgba(255, 120, 120, 0.10),
		0 0 0 4px rgba(255, 120, 120, 0.16) !important;
}

.rv-input.is-success,
.rv-textarea.is-success,
.rv-select.is-success,
.rv-auth input.is-success,
.rv-auth textarea.is-success,
.rv-auth select.is-success {
	border-color: rgba(120, 220, 160, 0.70) !important;
	box-shadow:
		0 0 0 1px rgba(120, 220, 160, 0.10),
		0 0 0 4px rgba(120, 220, 160, 0.14) !important;
}

.rv-field-error,
.rv-auth-error-text {
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.45;
	color: rgba(255, 220, 220, 0.92);
}

.rv-field-help,
.rv-auth-help {
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.58);
}

/* =========================
   CHECKBOX / RADIO BASELINE
   Keep this generic only
   ========================= */

.rv-check,
.rv-auth input[type="checkbox"],
.rv-auth input[type="radio"] {
	appearance: none;
	-webkit-appearance: none;
	display: inline-grid;
	place-content: center;
	width: 18px;
	height: 18px;
	margin: 0;
	border: 1px solid rgba(255, 255, 255, 0.32);
	background: rgba(0, 0, 0, 0.10);
	box-shadow: none;
	cursor: pointer;
	transition:
		border-color var(--rv-dur-ui) ease,
		background-color var(--rv-dur-ui) ease,
		box-shadow var(--rv-dur-ui) ease,
		transform var(--rv-dur-fast) var(--rv-ease-standard);
	vertical-align: middle;
}

.rv-check,
.rv-auth input[type="checkbox"] {
	border-radius: 4px;
}

.rv-auth input[type="radio"] {
	border-radius: 50%;
}

.rv-check:hover,
.rv-auth input[type="checkbox"]:hover,
.rv-auth input[type="radio"]:hover {
	border-color: rgba(255, 255, 255, 0.46);
	background: rgba(0, 0, 0, 0.14);
}

.rv-check:focus,
.rv-check:focus-visible,
.rv-auth input[type="checkbox"]:focus,
.rv-auth input[type="checkbox"]:focus-visible,
.rv-auth input[type="radio"]:focus,
.rv-auth input[type="radio"]:focus-visible {
	outline: none !important;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.05),
		0 0 0 4px rgba(204, 84, 124, 0.20);
}

.rv-check:checked,
.rv-auth input[type="checkbox"]:checked,
.rv-auth input[type="radio"]:checked {
	border-color: rgba(255, 255, 255, 0.58);
	background: rgba(255, 255, 255, 0.12);
}

.rv-check:checked::before,
.rv-auth input[type="checkbox"]:checked::before {
	content: "";
	width: 9px;
	height: 5px;
	border-left: 2px solid var(--rv-color-white);
	border-bottom: 2px solid var(--rv-color-white);
	transform: rotate(-45deg) translateY(-1px);
}

.rv-auth input[type="radio"]:checked::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--rv-color-white);
}

.rv-check:active,
.rv-auth input[type="checkbox"]:active,
.rv-auth input[type="radio"]:active {
	transform: scale(0.96);
}

/* =========================
   FORM ROW HELPERS
   ========================= */

.rv-form-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
}

@media (min-width: 768px) {
	.rv-form-row--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rv-form-row--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}