/**
 * Product pages: the support card's button and its form (see class-support.php).
 * WP Rocket's Remove Unused CSS leaves this file alone.
 */

/* Support card */

body .vs-sup-open {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	width: auto;
	min-width: 44px;
	height: auto;
	min-height: 44px;
	/* A 44px touch target that takes up about one line of text. */
	margin: -10px 0;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: none;
	box-shadow: none;
	color: #334da2;
	font: inherit;
	font-weight: 600;
	letter-spacing: normal;
	text-align: start;
	text-decoration: underline;
	text-transform: none;
	text-underline-offset: 2px;
	white-space: nowrap;
	cursor: pointer;
}

body .vs-sup-open:hover,
body .vs-sup-open:focus {
	background: none;
	box-shadow: none;
	color: #1e2b66;
}

body .vs-sup-open:focus-visible,
.vs-sup :focus-visible {
	outline: 2px solid #334da2;
	outline-offset: 2px;
}

@media (scripting: none) {
	body .vs-sup-open {
		display: none;
	}
}

.vs-sup-mail:not([hidden]) {
	display: block;
}

.vs-sup-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Form. Nothing here sets "display" on the dialog itself, so it stays hidden until it opens. */

.vs-sup {
	box-sizing: border-box;
	width: min(500px, calc(100vw - 24px));
	max-width: none;
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px);
	margin: auto;
	padding: 22px;
	border: 0;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 20px 60px rgba(19, 21, 21, 0.28);
	color: #131515;
	font: 400 14px/1.45 Poppins, var(--minimog-typography-body-font-family, sans-serif);
	text-align: start;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.vs-sup::backdrop {
	background: rgba(19, 21, 21, 0.55);
}

.vs-sup *,
.vs-sup *::before,
.vs-sup *::after {
	box-sizing: border-box;
}

.vs-sup [hidden] {
	display: none !important;
}

.vs-sup__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.vs-sup .vs-sup__title {
	margin: 0;
	color: #131515;
	font: 600 18px/1.3 Poppins, var(--minimog-typography-body-font-family, sans-serif);
}

/* Focus moves to these two by script, so the ring would only be noise. */
.vs-sup .vs-sup__title:focus,
.vs-sup .vs-sup__thanks:focus {
	outline: none;
}

body .vs-sup .vs-sup__close {
	display: grid;
	flex: none;
	place-items: center;
	width: 44px;
	min-width: 0;
	height: 44px;
	min-height: 0;
	margin: -8px -10px -8px 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: none;
	box-shadow: none;
	color: #131515;
	font: 400 26px/1 sans-serif;
	cursor: pointer;
}

body .vs-sup .vs-sup__close:hover {
	background: #f3f4f6;
	color: #131515;
}

.vs-sup .vs-sup__form {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
	margin: 0;
}

.vs-sup__two {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

@media (max-width: 479px) {
	.vs-sup {
		padding: 16px;
	}

	.vs-sup__two {
		grid-template-columns: minmax(0, 1fr);
	}
}

.vs-sup .vs-sup__field label {
	display: block;
	margin: 0 0 4px;
	color: #131515;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
}

.vs-sup .vs-sup__field label span {
	color: #5b6270;
	font-weight: 400;
}

/* 16px text: iPhones zoom in on anything smaller. */
body .vs-sup .vs-sup__field :is(input, select, textarea) {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 9px 11px;
	border: 1px solid #8a91a0;
	border-radius: 9px;
	background-color: #fff;
	box-shadow: none;
	color: #131515;
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
}

body .vs-sup .vs-sup__field textarea {
	min-height: 108px;
	resize: vertical;
}

body .vs-sup .vs-sup__field.is-locked input {
	border-color: #dcdfe6;
	background-color: #f3f4f6;
	color: #374151;
	text-overflow: ellipsis;
}

body .vs-sup .vs-sup__field [aria-invalid="true"] {
	border-color: #b42318;
	box-shadow: 0 0 0 1px #b42318;
}

body .vs-sup .vs-sup__field :is(input, select, textarea):focus-visible {
	outline: 2px solid #334da2;
	outline-offset: 1px;
}

.vs-sup .vs-sup__error {
	margin: 4px 0 0;
	color: #b42318;
	font-size: 13px;
}

.vs-sup__extra {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

.vs-sup .vs-sup__status {
	margin: 0;
	color: #5b6270;
}

/* Takes up no space while empty. It's never hidden, so screen readers notice new text. */
.vs-sup .vs-sup__status:empty {
	margin-top: -10px;
}

.vs-sup .vs-sup__status.is-problem {
	color: #b42318;
	font-weight: 500;
}

body .vs-sup .vs-sup__button {
	display: block;
	width: 100%;
	height: auto;
	min-height: 46px;
	margin: 0;
	padding: 10px 16px;
	border: 1.5px solid #334da2;
	border-radius: 9px;
	background: #334da2;
	box-shadow: none;
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

body .vs-sup .vs-sup__button:hover {
	border-color: #1e2b66;
	background: #1e2b66;
	color: #fff;
}

body .vs-sup .vs-sup__button--light,
body .vs-sup .vs-sup__button--light:hover {
	border-color: #334da2;
	background: #fff;
	color: #334da2;
}

/* The theme turns every disabled button black with !important, so these need it too. */
body .vs-sup .vs-sup__button:disabled {
	border-color: #e5e7eb !important;
	background-color: #e5e7eb !important;
	color: #4b5563 !important;
	opacity: 1;
	cursor: not-allowed;
}

body .vs-sup .vs-sup__button--light:disabled {
	border-color: #c5cad3 !important;
	background-color: #fff !important;
	color: #5b6270 !important;
}

.vs-sup .vs-sup__note {
	margin: 0;
	color: #5b6270;
	font-size: 13px;
	text-align: center;
}

.vs-sup .vs-sup__note a {
	color: #334da2;
	text-decoration: underline;
}

.vs-sup .vs-sup__thanks {
	margin: 0 0 16px;
	font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
	body .vs-sup .vs-sup__button {
		transition: none;
	}
}
