/**
 * Hosterwise — forms v2 (contact form of inc/forms.php, reCAPTCHA mention) and
 * the Contact page layout (page-templates/contact.php).
 *
 * Enqueued as "hw-forms" wherever hw_contact_form() is printed. Every value comes
 * from the design-system tokens (main.css), so the form works on the dark canvas
 * and inside a light card (.hw-paper / .hw-sheet), where it is designed to live.
 */

/* =========================================================================
 * Form
 * ====================================================================== */

.hw-form {
	--hw-form-gap: 1.15rem;
	display: grid;
	gap: 1.5rem;
	color: var(--hw-text);
	font-family: var(--hw-font-body);
}

.hw-form__title {
	margin: 0;
	font-family: var(--hw-font-head);
	font-size: var(--hw-fs-2xl);
	letter-spacing: -0.03em;
	color: var(--hw-heading);
}

.hw-form__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--hw-form-gap);
}

@media (min-width: 40em) {
	.hw-form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.hw-field--full { grid-column: 1 / -1; }

	.hw-form--compact .hw-form__grid { grid-template-columns: minmax(0, 1fr); }
}

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

.hw-field {
	display: grid;
	gap: 0.45rem;
	align-content: start;
	min-width: 0;
}

.hw-field__label,
.hw-field__check-label {
	font-family: var(--hw-font-head);
	font-size: var(--hw-fs-sm);
	font-weight: 650;
	line-height: 1.4;
	color: var(--hw-text);
}

.hw-field__req { margin-inline-start: 0.125em; color: var(--hw-pink-text); }

.hw-field__opt {
	font-family: var(--hw-font-body);
	font-weight: 400;
	color: var(--hw-text-muted);
}

.hw-field__input {
	box-sizing: border-box;
	width: 100%;
	min-height: 52px;
	padding: 0.75rem 1rem;
	font: inherit;
	font-size: 1rem; /* No zoom on iOS. */
	line-height: 1.5;
	color: var(--hw-input-text);
	background: var(--hw-input-bg);
	border: 1px solid var(--hw-input-border);
	border-radius: var(--hw-radius);
	box-shadow: 0 1px 2px rgba(11, 13, 46, 0.04);
	transition: border-color var(--hw-dur-fast) var(--hw-ease), box-shadow var(--hw-dur-fast) var(--hw-ease), background-color var(--hw-dur-fast) var(--hw-ease);
}

.hw-field__input::placeholder { color: var(--hw-text-faint); opacity: 1; }

.hw-field__input:hover { border-color: var(--hw-border-strong); }

.hw-field__input:focus-visible,
.hw-field__input:focus {
	outline: none;
	border-color: var(--hw-cyan);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--hw-cyan) 18%, transparent);
}

.hw-field__area { min-height: 10rem; resize: vertical; }

.hw-field__select {
	appearance: none;
	padding-inline-end: 2.75rem;
	background-image:
		linear-gradient(45deg, transparent 50%, currentColor 50%),
		linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 1.35rem) 54%, calc(100% - 1rem) 54%;
	background-size: 0.36rem 0.36rem;
	background-repeat: no-repeat;
	cursor: pointer;
}

.hw-field__select option { color: #0b0d2e; background: #fff; }

.hw-field__hint {
	margin: 0;
	font-size: var(--hw-fs-xs);
	line-height: 1.5;
	color: var(--hw-text-muted);
}

/* Errors */
.hw-field--error .hw-field__input {
	border-color: var(--hw-danger);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--hw-danger) 16%, transparent);
}

:is(.hw-light, .hw-sheet, .hw-paper) .hw-field--error .hw-field__input { border-color: var(--hw-danger-text); }

.hw-field__error {
	display: flex;
	align-items: center;
	gap: 0.4em;
	margin: 0;
	font-size: var(--hw-fs-xs);
	font-weight: 650;
	line-height: 1.45;
	color: var(--hw-danger-text);
}

.hw-field__error::before { content: "⚠\FE0E"; }

/* Checkbox */
.hw-field--check {
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: 0.75rem;
	align-items: start;
	padding: 0.95rem 1rem;
	border: 1px solid var(--hw-border);
	border-radius: var(--hw-radius);
	background: var(--hw-surface-2);
}

.hw-field--check .hw-field__error { grid-column: 1 / -1; }

.hw-field__check {
	width: 1.25rem;
	height: 1.25rem;
	margin: 0.1rem 0 0;
	accent-color: var(--hw-accent);
	cursor: pointer;
}

.hw-field__check:focus-visible { outline: 2px solid var(--hw-focus); outline-offset: 2px; }

.hw-field__check-label {
	font-family: var(--hw-font-body);
	font-size: var(--hw-fs-sm);
	font-weight: 400;
	color: var(--hw-text-muted);
	cursor: pointer;
}

.hw-field__check-label a,
.hw-form__note a,
.hw-recaptcha-note a {
	color: var(--hw-link);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* Honeypot: out of sight, still in the DOM for bots. */
.hw-field--hp {
	position: absolute !important;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Actions & notes ---------------------------------------------------------- */

.hw-form__actions {
	display: grid;
	gap: 0.75rem;
	justify-items: start;
	padding-top: 0.25rem;
}

/* The submit button is a regular design-system button (.hw-btn--primary). */
.hw-form .hw-btn[type="submit"] { min-width: min(100%, 15rem); }

@media (max-width: 39.99em) {
	.hw-form .hw-btn[type="submit"] { width: 100%; }

	.hw-form__actions { justify-items: stretch; }
}

.hw-form .hw-btn:disabled,
.hw-form[aria-busy="true"] .hw-btn {
	opacity: 0.7;
	cursor: progress;
}

.hw-form__note,
.hw-recaptcha-note {
	margin: 0;
	font-size: var(--hw-fs-xs);
	line-height: 1.55;
	color: var(--hw-text-muted);
}

.hw-recaptcha-note { font-size: var(--hw-fs-2xs); }

/* Status (aria-live) ------------------------------------------------------- */

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

.hw-form__status {
	display: flex;
	gap: 0.6rem;
	padding: 1rem 1.15rem;
	border: 1px solid transparent;
	border-radius: var(--hw-radius);
	outline: none;
	font-weight: 600;
}

.hw-form__status p { margin: 0; }

.hw-form__status.is-success {
	color: var(--hw-success-text);
	background: var(--hw-success-bg);
	border-color: color-mix(in srgb, var(--hw-success) 55%, transparent);
}

.hw-form__status.is-error {
	color: var(--hw-danger-text);
	background: var(--hw-danger-bg);
	border-color: color-mix(in srgb, var(--hw-danger) 55%, transparent);
}

.hw-form__status:focus-visible { outline: 2px solid var(--hw-focus); outline-offset: 2px; }

/* Google's badge is replaced by the mention under each form. */
.grecaptcha-badge { visibility: hidden !important; }

/* =========================================================================
 * Contact page
 * ====================================================================== */

.hw-contact-channel { --hw-tone: 1, 200, 239; }

.hw-contact-channel--pink { --hw-tone: 243, 53, 91; }

.hw-contact-channel--violet { --hw-tone: 139, 108, 255; }

/* Hero */
.hw-contact-hero { padding-bottom: clamp(4rem, 3rem + 5vw, 8rem); }

.hw-contact-hero__grid {
	display: grid;
	gap: var(--hw-space-6);
	align-items: center;
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1100px) {
	.hw-contact-hero__grid { grid-template-columns: minmax(0, 1fr) 400px; }
}

.hw-contact-hero__text { min-width: 0; max-width: 760px; }

.hw-contact-hero__title {
	font-size: var(--hw-fs-5xl); /* Inner-page hero H1: 34 → 52 px. */
	line-height: 1.02;
	background: var(--hw-gradient-title);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.hw-contact-hero__chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hw-space-2);
	margin: var(--hw-space-6) 0 0;
	padding: 0;
	list-style: none;
}

.hw-contact-hero__chips li {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	min-height: 40px;
	padding: 0.35em 0.95em;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--hw-radius-pill);
	background: rgba(255, 255, 255, 0.04);
	color: var(--hw-text);
	font-size: var(--hw-fs-sm);
	font-weight: 600;
}

.hw-contact-hero__chips .hw-icon { --hw-icon-size: 16px; color: var(--hw-cyan); }

.hw-contact-hero__chips a { color: inherit; text-decoration: none; }

.hw-contact-hero__chips a:hover { color: var(--hw-cyan-bright); }

.hw-contact-hero__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--hw-success);
	box-shadow: 0 0 0 4px rgba(55, 194, 103, 0.18), 0 0 12px rgba(55, 194, 103, 0.8);
}

.hw-contact-hero__visual { display: none; }

@media (min-width: 1100px) {
	.hw-contact-hero__visual { display: block; }

	.hw-contact-hero__visual .hw-illustration { --hw-illus-max: 400px; }
}

/* Main: form card + aside */
.hw-contact-main {
	padding-top: 0;
	margin-top: calc(-1 * clamp(2.5rem, 2rem + 3vw, 5rem));
}

.hw-contact-main__grid {
	display: grid;
	gap: clamp(1.5rem, 1rem + 2vw, 3rem);
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
}

@media (min-width: 1040px) {
	.hw-contact-main__grid { grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); }
}

.hw-contact-form {
	position: relative;
	z-index: 1;
	padding: clamp(1.4rem, 1rem + 2.5vw, 3rem);
	border-radius: var(--hw-radius-2xl);
	overflow: hidden;
}

.hw-contact-form::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 4px;
	background: var(--hw-gradient-brand);
}

.hw-contact-aside {
	display: grid;
	gap: var(--hw-space-4);
	min-width: 0;
	padding-top: clamp(0rem, -1rem + 3vw, 2rem);
}

.hw-contact-aside__title {
	margin: 0;
	font-size: var(--hw-fs-2xl);
	letter-spacing: -0.03em;
}

.hw-contact-aside__lead { margin: 0; color: var(--hw-text-muted); line-height: 1.6; }

.hw-contact-channels {
	display: grid;
	gap: var(--hw-space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.hw-contact-channel {
	position: relative;
	display: flex;
	gap: var(--hw-space-4);
	padding: var(--hw-space-5);
	border-radius: var(--hw-radius-lg);
	background:
		radial-gradient(240px 110px at 0% 0%, rgba(var(--hw-tone), 0.14), transparent 75%),
		var(--hw-glass);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), var(--hw-inner-hl);
	transition: box-shadow var(--hw-dur) var(--hw-ease), transform var(--hw-dur) var(--hw-ease);
}

.hw-contact-channel:hover {
	transform: translateY(-2px);
	box-shadow: inset 0 0 0 1px rgba(var(--hw-tone), 0.45), 0 18px 40px -24px rgba(var(--hw-tone), 0.7);
}

.hw-contact-channel__icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 13px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
		radial-gradient(circle at 30% 15%, rgba(var(--hw-tone), 0.55), transparent 70%),
		var(--hw-surface-2);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
	color: #fff;
}

.hw-contact-channel__icon .hw-icon { --hw-icon-size: 20px; }

.hw-contact-channel__body { min-width: 0; }

.hw-contact-channel__title { margin: 0; font-size: var(--hw-fs-md); }

.hw-contact-channel__text {
	margin: 0.3em 0 0;
	font-size: var(--hw-fs-sm);
	line-height: 1.55;
	color: var(--hw-text-muted);
}

.hw-contact-channel__link { margin: 0.55em 0 0; }

.hw-contact-channel__link a {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	color: var(--hw-cyan-bright);
	font-family: var(--hw-font-head);
	font-weight: 700;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.hw-contact-channel__link a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.hw-contact-channel__link a:focus-visible { outline: none; }

.hw-contact-channel:has(a:focus-visible) { outline: 2px solid var(--hw-focus); outline-offset: 3px; }

.hw-contact-channel__link .hw-icon { --hw-icon-size: 16px; transition: transform var(--hw-dur) var(--hw-ease); }

.hw-contact-channel:hover .hw-contact-channel__link .hw-icon { transform: translateX(3px); }

.hw-contact-tips,
.hw-contact-company {
	padding: var(--hw-space-5);
	border: 1px solid var(--hw-border);
	border-radius: var(--hw-radius-lg);
}

.hw-contact-tips__title,
.hw-contact-company__title {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin: 0 0 var(--hw-space-3);
	font-size: var(--hw-fs-base);
}

.hw-contact-tips__title .hw-icon,
.hw-contact-company__title .hw-icon { --hw-icon-size: 18px; color: var(--hw-cyan); }

.hw-contact-tips .hw-checklist { font-size: var(--hw-fs-sm); }

.hw-contact-company__dl { font-size: var(--hw-fs-sm); }

.hw-contact-company__more { margin: var(--hw-space-4) 0 0; }

/* FAQ */
.hw-contact-faq .hw-section-head { margin-bottom: var(--hw-space-6); }

.hw-contact-faq__more { margin: var(--hw-space-6) 0 0; text-align: center; }

@media (prefers-reduced-motion: reduce) {
	.hw-field__input,
	.hw-contact-channel,
	.hw-contact-channel__link .hw-icon { transition: none; }

	.hw-contact-channel:hover { transform: none; }
}

@media (prefers-contrast: more) {
	.hw-field__input { border-width: 2px; }

	.hw-contact-hero__title { background: none; color: var(--hw-text); }
}
