/* [gp_feedback_form] and [gp_subscribe_form] (shortcode.php). Dark pages only: both forms sit on the storefront's
   dark background. Hover changes colour only, in --gp-hover-in and out --gp-hover-out, and only where there is a
   pointer; the focus ring is the keyboard's (:focus-visible). */

.gp-form {
	margin: 0;
	font-family: 'Onest', sans-serif;
	color: var(--wp--preset--color--primary);
}

.gp-form fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.gp-form__sr,
.gp-form__trap {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ── The button: the accent pill; while the form is sent, a turning ring in place of its label ─────────────────── */

.gp-form__submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 41px;
	margin: 0;
	padding: 10px 20px;
	border: 0;
	border-radius: 20px;
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--secondary);
	font: inherit;
	font-size: 16px;
	line-height: 21px;
	cursor: pointer;
}

.gp-form__submit:focus {
	outline: none;
}

.gp-form__submit:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.gp-form__submit-label {
	transition: opacity var(--gp-hover-out, 0.3s);
}

.gp-form__submit::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	box-sizing: border-box;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	opacity: 0;
	transition: opacity var(--gp-hover-out, 0.3s);
	animation: gp-form-ring 1s linear infinite;
}

.gp-form.is-busy .gp-form__submit {
	cursor: default;
}

.gp-form.is-busy .gp-form__submit-label {
	opacity: 0;
}

.gp-form.is-busy .gp-form__submit::after {
	opacity: 1;
}

@keyframes gp-form-ring {
	to {
		transform: rotate(360deg);
	}
}

.gp-form__status {
	margin: 0;
	font-size: 14px;
	line-height: 20px;
}

.gp-form__status:empty {
	display: none;
}

.gp-form__status.is-error {
	color: #ff7a7a;
}

/* ── Subscription: the e-mail pill and the button, side by side while they fit ─────────────────────────────────── */

.gp-subscribe-form__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.gp-form .gp-subscribe-form__email {
	box-sizing: border-box;
	width: 300px;
	max-width: 100%;
	height: 43px;
	margin: 0;
	padding: 10px 15px;
	border: 1px solid #ccc;
	border-radius: 20px;
	background-color: transparent;
	color: var(--wp--preset--color--primary);
	font: inherit;
	font-size: 16px;
	outline: none;
	transition: border-color var(--gp-hover-out, 0.3s);
}

.gp-form .gp-subscribe-form__email::placeholder {
	color: rgba(255, 255, 255, 0.45);
}

.gp-form .gp-subscribe-form__email:focus {
	border-color: var(--wp--preset--color--accent);
	transition-duration: var(--gp-hover-in, 0.12s);
}

.gp-subscribe-form .gp-form__status {
	margin-top: 8px;
}

/* ── Feedback: the scale 1–10, then the text, Telegram and the button ──────────────────────────────────────────── */

/* The form takes the page column's whole width, which WordPress's constrained layout gives it and centres; its parts
   keep to the scale's width from the column's left edge, under the page's heading. */
.gp-feedback-form {
	margin-top: 28px;
}

.gp-feedback-form > * {
	max-width: 690px;
}

/* Ten cells with the digits in one row, left to right; the chosen one in the accent. */
.gp-nps {
	display: flex;
	gap: 6px;
	margin: 8px 0 0;
}

.gp-nps__cell {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	cursor: pointer;
}

.gp-nps__cell input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.gp-nps__label {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.06);
	font-size: 16px;
	transition: background-color var(--gp-hover-out, 0.3s), border-color var(--gp-hover-out, 0.3s),
		color var(--gp-hover-out, 0.3s);
}

@media (hover: hover) {
	.gp-nps__cell:hover .gp-nps__label {
		border-color: var(--wp--preset--color--accent);
		transition-duration: var(--gp-hover-in, 0.12s);
	}
}

.gp-nps__cell input:checked + .gp-nps__label {
	border-color: var(--wp--preset--color--accent);
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--secondary);
}

.gp-nps__cell input:focus-visible + .gp-nps__label {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.gp-nps__ends {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 10px;
	color: rgba(255, 255, 255, 0.6);
	font-size: 14px;
	line-height: 20px;
}

.gp-nps__ends span:last-child {
	text-align: right;
}

.gp-form__heading {
	margin: 56px 0 20px;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
}

.gp-form__field {
	display: block;
	margin: 0 0 20px;
}

.gp-form__label {
	display: block;
	margin-bottom: 8px;
	font-size: 16px;
	line-height: 22px;
}

.gp-form .gp-form__input {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.06);
	color: var(--wp--preset--color--primary);
	font: inherit;
	font-size: 16px; /* no zoom on focus in iOS Safari */
	line-height: 22px;
	outline: none;
	transition: border-color var(--gp-hover-out, 0.3s);
}

.gp-form textarea.gp-form__input {
	min-height: 160px;
	resize: vertical;
}

.gp-form .gp-form__field--short .gp-form__input {
	max-width: 340px;
}

.gp-form .gp-form__input::placeholder {
	color: rgba(255, 255, 255, 0.45);
}

.gp-form .gp-form__input:focus {
	border-color: var(--wp--preset--color--accent);
	transition-duration: var(--gp-hover-in, 0.12s);
}

.gp-feedback-form .gp-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin-top: 4px;
}

@media (max-width: 781px) {
	/* The page's column runs edge to edge on a phone: the form keeps the storefront's gutter (layout.css) */
	.gp-feedback-form {
		padding-left: var(--gp-phone-gutter, 10px);
		padding-right: var(--gp-phone-gutter, 10px);
	}

	.gp-nps {
		gap: 4px;
	}

	.gp-nps__label {
		height: 40px;
		font-size: 14px;
	}

	.gp-nps__ends {
		font-size: 12px;
		line-height: 16px;
	}

	.gp-form__heading {
		margin-top: 40px;
		font-size: 24px;
	}
}
