/**
 * Faris Blocks: Form and Account form.
 *
 * Loaded with the form blocks on any theme. Colours, type and radius come
 * from the HostRider design tokens (the theme's, or fallback.css with
 * another theme). Logical properties only, so RTL needs no extra rules.
 */

.hr-form-wrap {
	--hr-form-gap: 20px;
	max-inline-size: 100%;
	box-sizing: border-box;
}

.hr-form-wrap *,
.hr-form-wrap *::before,
.hr-form-wrap *::after {
	box-sizing: border-box;
}

.hr-form-wrap.is-card {
	padding: clamp(24px, 4vw, 40px);
	background: var(--hr-bg, #fff);
	border: var(--hr-border-w,1px) solid var(--hr-border, #e8e4f4);
	border-radius: var(--hr-radius-lg, 26px);
	box-shadow: var(--hr-shadow-sm, 0 10px 24px -18px rgba(26, 19, 69, .25));
}

.hr-account {
	max-inline-size: 480px;
	margin-inline: auto;
}

.hr-form {
	margin: 0;
}

/* Hidden steps, fields and buttons stay hidden, whatever display a theme
   gives buttons. */
.hr-form [hidden],
.hr-form-wrap [hidden] {
	display: none !important;
}

/* Grid of fields ---------------------------------------------------------- */

.hr-form__fields {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: var(--hr-form-gap);
}

.hr-form__fields > * {
	grid-column: 1 / -1;
	margin: 0;
}

.hr-form__fields > .hr-field--half {
	grid-column: span 3;
}

.hr-form__fields > .hr-field--third {
	grid-column: span 2;
}

@media (max-width: 640px) {
	.hr-form__fields > .hr-field--half,
	.hr-form__fields > .hr-field--third {
		grid-column: 1 / -1;
	}
}

/* Fields ------------------------------------------------------------------- */

.hr-field {
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.hr-form .hr-field > label:not(.hr-choice),
.hr-form .hr-field > legend {
	display: block;
	margin: 0 0 8px;
	padding: 0;
	font: 700 var(--hr-fs-label-sm, .82rem)/1.3 var(--hr-font-label, system-ui, sans-serif);
	letter-spacing: .05em;
	text-transform: var(--hr-label-case, uppercase);
	color: var(--hr-primary, #3f2c97);
}

/* Arabic letters join, so Arabic labels get no tracking or capitals. */
:lang(ar) .hr-form .hr-field > label:not(.hr-choice),
:lang(ar) .hr-form .hr-field > legend {
	letter-spacing: 0;
	text-transform: none;
}

.hr-field .required {
	color: var(--hr-action, #c74306);
}

.hr-form :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]), select, textarea) {
	display: block;
	inline-size: 100%;
	max-inline-size: 100%;
	min-block-size: 50px;
	margin: 0;
	padding: 14px 16px;
	font: 400 16px/1.4 var(--hr-font-text, system-ui, sans-serif);
	color: var(--hr-ink, #191341);
	background-color: #fff;
	border: 1.5px solid var(--hr-border-input, #857dab);
	border-radius: var(--hr-radius-sm, 12px);
	box-shadow: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.hr-form textarea {
	min-block-size: 150px;
	line-height: 1.6;
	resize: vertical;
}

.hr-form select {
	padding-inline-end: 40px;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233F2C97' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: 18px;
	background-position: right 14px center;
}

[dir="rtl"] .hr-form select {
	background-position: left 14px center;
}

/* Phone, email and web addresses are typed left to right, also on Arabic
   pages; they still line up with the other fields. */
[dir="rtl"] .hr-form input[dir="ltr"] {
	text-align: right;
}

.hr-form :is(input, select, textarea):focus {
	outline: none;
	border-color: var(--hr-violet-500, #643fff);
	box-shadow: 0 0 0 4px rgba(var(--hr-glow, 100, 63, 255), .14);
}

.hr-form :is(input, select, textarea):focus-visible {
	outline: 3px solid var(--hr-ring, #eb5207);
	outline-offset: 2px;
}

.hr-form :is(input, textarea)::placeholder {
	color: var(--hr-muted, #666b7a);
	opacity: 1;
}

.hr-form .has-error :is(input, select, textarea),
.hr-form [aria-invalid="true"] {
	border-color: var(--hr-danger, #b42318);
}

/* Choices ------------------------------------------------------------------ */

.hr-field__choices {
	display: grid;
	gap: 10px;
}

.hr-form .hr-choice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font: 400 1rem/1.5 var(--hr-font-text, system-ui, sans-serif);
	letter-spacing: 0;
	text-transform: none;
	color: var(--hr-body, #4b4a5e);
	cursor: pointer;
}

.hr-form .hr-choice input {
	flex: none;
	inline-size: 20px;
	block-size: 20px;
	margin: 2px 0 0;
	accent-color: var(--hr-primary, #3f2c97);
}

.hr-form .hr-choice a {
	color: var(--hr-primary, #3f2c97);
	text-decoration: underline;
	text-underline-offset: .18em;
}

/* Stars (1.8.0) ------------------------------------------------------------
   Five radio buttons. The picked star and the ones before it fill in; the
   order follows the page direction. The buttons stay in the page for
   keyboards and screen readers, each named "3 stars" and so on. */

.hr-stars {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
}

.hr-form .hr-star {
	position: relative;
	display: inline-grid;
	place-items: center;
	inline-size: 44px;
	block-size: 44px;
	margin: 0;
	border-radius: var(--hr-radius-sm, 12px);
	cursor: pointer;
}

.hr-form .hr-star input {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	min-block-size: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.hr-star__icon {
	display: block;
	inline-size: 32px;
	block-size: 32px;
	background: var(--hr-border-input, #857dab);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 2.5l2.94 5.96 6.58.96-4.76 4.64 1.12 6.55L12 17.52l-5.88 3.09 1.12-6.55L2.48 9.42l6.58-.96z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 2.5l2.94 5.96 6.58.96-4.76 4.64 1.12 6.55L12 17.52l-5.88 3.09 1.12-6.55L2.48 9.42l6.58-.96z'/%3E%3C/svg%3E") center / contain no-repeat;
	pointer-events: none;
	transition: background-color .15s ease;
}

.hr-star input:checked + .hr-star__icon,
.hr-stars:has(.hr-star:nth-child(1) input:checked) .hr-star:nth-child(-n+1) .hr-star__icon,
.hr-stars:has(.hr-star:nth-child(2) input:checked) .hr-star:nth-child(-n+2) .hr-star__icon,
.hr-stars:has(.hr-star:nth-child(3) input:checked) .hr-star:nth-child(-n+3) .hr-star__icon,
.hr-stars:has(.hr-star:nth-child(4) input:checked) .hr-star:nth-child(-n+4) .hr-star__icon,
.hr-stars:has(.hr-star:nth-child(5) input:checked) .hr-star:nth-child(-n+5) .hr-star__icon {
	background: var(--hr-orange-500, #f26f21);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.94 5.96 6.58.96-4.76 4.64 1.12 6.55L12 17.52l-5.88 3.09 1.12-6.55L2.48 9.42l6.58-.96z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.94 5.96 6.58.96-4.76 4.64 1.12 6.55L12 17.52l-5.88 3.09 1.12-6.55L2.48 9.42l6.58-.96z'/%3E%3C/svg%3E");
}

@media (hover: hover) {
	.hr-stars:has(.hr-star:nth-child(1):hover) .hr-star:nth-child(-n+1) .hr-star__icon,
	.hr-stars:has(.hr-star:nth-child(2):hover) .hr-star:nth-child(-n+2) .hr-star__icon,
	.hr-stars:has(.hr-star:nth-child(3):hover) .hr-star:nth-child(-n+3) .hr-star__icon,
	.hr-stars:has(.hr-star:nth-child(4):hover) .hr-star:nth-child(-n+4) .hr-star__icon,
	.hr-stars:has(.hr-star:nth-child(5):hover) .hr-star:nth-child(-n+5) .hr-star__icon {
		background: var(--hr-orange-500, #f26f21);
		-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.94 5.96 6.58.96-4.76 4.64 1.12 6.55L12 17.52l-5.88 3.09 1.12-6.55L2.48 9.42l6.58-.96z'/%3E%3C/svg%3E");
		mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.94 5.96 6.58.96-4.76 4.64 1.12 6.55L12 17.52l-5.88 3.09 1.12-6.55L2.48 9.42l6.58-.96z'/%3E%3C/svg%3E");
	}
}

.hr-form .hr-star:has(input:focus-visible) {
	outline: 3px solid var(--hr-ring, #eb5207);
	outline-offset: 2px;
}

.hr-form .has-error .hr-star__icon {
	background: var(--hr-danger, #b42318);
}

/* Range and file ----------------------------------------------------------- */

.hr-field__range {
	display: flex;
	align-items: center;
	gap: 14px;
}

.hr-field__range input {
	flex: 1;
	/* Tall enough to hit with a finger; the track stays thin. */
	min-block-size: 32px;
	margin: 0;
	accent-color: var(--hr-primary, #3f2c97);
	cursor: pointer;
}

.hr-field__range output {
	min-inline-size: 3ch;
	font: 700 1rem/1 var(--hr-font-label, system-ui, sans-serif);
	color: var(--hr-ink, #191341);
	text-align: center;
}

.hr-form input[type="file"] {
	display: block;
	inline-size: 100%;
	padding: 10px;
	font: 400 .95rem/1.4 var(--hr-font-text, system-ui, sans-serif);
	color: var(--hr-body, #4b4a5e);
	background: var(--hr-bg-alt, #f8f8fc);
	border: 1.5px dashed var(--hr-border-strong, #d5cdf0);
	border-radius: var(--hr-radius-sm, 12px);
}

.hr-form input[type="file"]::file-selector-button {
	margin-inline-end: 12px;
	padding: 10px 16px;
	font: 700 .9rem/1 var(--hr-font-label, system-ui, sans-serif);
	color: var(--hr-primary, #3f2c97);
	background: #fff;
	border: 1.5px solid var(--hr-border-strong, #d5cdf0);
	border-radius: var(--hr-radius-full, 999px);
	cursor: pointer;
}

/* Password with a Show button ---------------------------------------------- */

.hr-field__password {
	position: relative;
}

.hr-form .hr-field__password input {
	padding-inline-end: 84px;
}

.hr-field__show {
	position: absolute;
	inset-block: 6px;
	inset-inline-end: 6px;
	padding: 0 14px;
	font: 700 .85rem/1 var(--hr-font-label, system-ui, sans-serif);
	color: var(--hr-primary, #3f2c97);
	background: var(--hr-tint, #f6f3ff);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.hr-field__show[aria-pressed="true"] {
	background: var(--hr-lav-200, #ddd2ff);
}

/* Help and errors ---------------------------------------------------------- */

.hr-field__help {
	margin: 6px 0 0;
	font-size: .9rem;
	line-height: 1.5;
	color: var(--hr-muted, #666b7a);
}

.hr-field__error {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 8px 0 0;
	font-size: .9rem;
	font-weight: 600;
	line-height: 1.45;
	color: var(--hr-danger, #b42318);
}

.hr-field__error::before {
	content: "!";
	display: inline-grid;
	place-items: center;
	flex: none;
	inline-size: 18px;
	block-size: 18px;
	margin-block-start: 1px;
	font: 800 12px/1 var(--hr-font-label, system-ui, sans-serif);
	color: #fff;
	background: var(--hr-danger, #b42318);
	border-radius: 50%;
}

/* Messages ----------------------------------------------------------------- */

.hr-form-wrap .hr-status {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 14px 18px;
	font-size: .95rem;
	line-height: 1.5;
	border: 1px solid;
	border-radius: var(--hr-radius, 18px);
}

.hr-form-wrap .hr-status p {
	margin: 0;
}

.hr-form-wrap .hr-status--success {
	color: var(--hr-green-800, #0f6b33);
	background: var(--hr-green-50, #eafbf0);
	border-color: var(--hr-green-200, #b6ebc8);
}

.hr-form-wrap .hr-status--danger {
	color: var(--hr-red-700, #b42318);
	background: var(--hr-red-50, #fef3f2);
	border-color: var(--hr-red-200, #fecdca);
}

.hr-form-wrap .hr-status--info {
	color: var(--hr-plum-700, #3f2c97);
	background: var(--hr-tint, #f6f3ff);
	border-color: var(--hr-lav-200, #ddd2ff);
}

.hr-form__notice {
	margin-block-end: 24px;
}

.hr-form__icon {
	flex: none;
	margin-block-start: 1px;
}

.hr-form__done {
	padding: 20px 22px;
	font-size: 1.05rem;
}

.hr-form__done:focus,
.hr-form__notice:focus {
	outline: 3px solid var(--hr-ring, #eb5207);
	outline-offset: 3px;
}

/* Steps -------------------------------------------------------------------- */

.hr-form__step {
	min-inline-size: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.hr-form__legend {
	display: block;
	margin: 0 0 20px;
	padding: 0;
	font: 400 clamp(1.3rem, 2.4vw, 1.6rem)/1.2 var(--hr-font-display, Georgia, serif);
	color: var(--hr-ink, #191341);
}

.hr-form__head {
	margin-block-end: 24px;
}

.hr-form__progress {
	margin: 0 0 10px;
	font: 700 var(--hr-fs-label-sm, .82rem)/1.3 var(--hr-font-label, system-ui, sans-serif);
	letter-spacing: .05em;
	text-transform: var(--hr-label-case, uppercase);
	color: var(--hr-muted, #666b7a);
}

.hr-form__bar {
	block-size: 6px;
	overflow: hidden;
	background: var(--hr-lav-100, #ede9fe);
	border-radius: var(--hr-radius-full, 999px);
}

.hr-form__bar span {
	display: block;
	block-size: 100%;
	inline-size: 0;
	background: var(--hr-primary, #3f2c97);
	border-radius: inherit;
	transition: width .3s ease;
}

@media (prefers-reduced-motion: reduce) {
	.hr-form__bar span {
		transition: none;
	}
}

/* Actions, trap, bot check ------------------------------------------------- */

.hr-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-block-start: 28px;
}

.hr-form__actions .hr-btn--wide {
	flex: 1 1 100%;
	justify-content: center;
}

.hr-form__actions .hr-btn.is-busy {
	cursor: progress;
	opacity: .75;
}

.hr-form__hp {
	position: absolute !important;
	inset-inline-start: -10000px;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
}

.hr-form .hrx-turnstile {
	min-block-size: 65px;
	margin-block-start: 24px;
}

.hr-account__links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	justify-content: center;
	margin: 20px 0 0;
	font-size: .95rem;
}

.hr-account__links a {
	color: var(--hr-primary, #3f2c97);
	text-decoration: underline;
	text-underline-offset: .18em;
}

/* Forms from other plugins ------------------------------------------------- */

.hr-form-style :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="hidden"]), select, textarea) {
	inline-size: 100%;
	min-block-size: 50px;
	padding: 14px 16px;
	font: 400 16px/1.4 var(--hr-font-text, system-ui, sans-serif);
	color: var(--hr-ink, #191341);
	background-color: #fff;
	border: 1.5px solid var(--hr-border-input, #857dab);
	border-radius: var(--hr-radius-sm, 12px);
}

.hr-form-style :is(input, select, textarea):focus {
	outline: none;
	border-color: var(--hr-violet-500, #643fff);
	box-shadow: 0 0 0 4px rgba(var(--hr-glow, 100, 63, 255), .14);
}

.hr-form-style label,
.hr-form-style .gfield_label,
.hr-form-style .wpforms-field-label,
.hr-form-style .ff-el-input--label label {
	display: block;
	margin-block-end: 8px;
	font: 700 var(--hr-fs-label-sm, .82rem)/1.3 var(--hr-font-label, system-ui, sans-serif);
	letter-spacing: .05em;
	text-transform: var(--hr-label-case, uppercase);
	color: var(--hr-primary, #3f2c97);
}

.hr-form-style :is(input[type="submit"], button[type="submit"], .wpforms-submit, .gform_button, .ff-btn-submit) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-block-size: 50px;
	padding: 16px 28px;
	font: 700 1rem/1 var(--hr-font-label, system-ui, sans-serif);
	color: var(--hr-on-action, #fff);
	background: var(--hr-action, #c74306);
	border: 0;
	border-radius: var(--hr-radius-full, 999px);
	cursor: pointer;
}

.hr-form-style :is(input[type="submit"], button[type="submit"], .wpforms-submit, .gform_button, .ff-btn-submit):hover {
	background: var(--hr-action-hover, #a93a05);
}

.hr-form-style :is(.wpcf7-not-valid-tip, .wpforms-error, .gfield_validation_message, .error.text-danger) {
	margin-block-start: 6px;
	font-size: .9rem;
	font-weight: 600;
	color: var(--hr-danger, #b42318);
}

.hr-form-style :is(.wpcf7-response-output, .wpforms-confirmation-container-full, .gform_confirmation_message, .ff-message-success) {
	margin: 20px 0 0;
	padding: 14px 18px;
	border: var(--hr-border-w,1px) solid var(--hr-border, #e8e4f4);
	border-radius: var(--hr-radius, 18px);
}
