/* ============================================================
   Contact section ("It starts with just a conversation.")
   Design ref: designs/Homepage Design Desktop.jpg y7317-8343,
   Mobile y9898-11528. Grey band, one cream card (1072px, r8-10,
   soft shadow, 80px padding on desktop): left column heading /
   intro / phone + email chip rows / Urgent Help card, right
   column enquiry form. Mobile: same order stacked in one card.
   Exact values from the .fig: left col 433, gutter 63, form 417;
   inputs 55px tall, 1px #ADADA1 border, r2; labels Onest 700
   12px/1.8px tracking teal; button 60px caramel r2.
   ============================================================ */

.contact {
	background: var(--color-light-grey);
	padding-block: 2.25rem 3.5rem;
}

/* Anchor targets (#contact, #contact-form redirect) must clear the fixed header */
.contact,
.contact__form {
	scroll-margin-top: calc(var(--header-height) + 1rem);
}

.contact__card {
	max-width: 1072px;
	margin-inline: auto;
	background: var(--color-cream-light);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-card);
	padding: 1.875rem 1.25rem 3rem;
}

/* Plain variant (Get Help Today page): no card, content sits straight on the
   grey band. The inputs are transparent by default and would otherwise pick
   up the grey rather than the design's cream fill, so they are filled here.

   ALL the card padding goes, not just the inline: with no card there is
   nothing for it to pad, and leaving the vertical padding stacked it on top
   of the section's own, which doubled the band's top gap (200px against the
   design's 87px). The band's own padding is retuned below to the measured
   values, so this variant owns its spacing outright. */
.contact--plain .contact__card {
	background: none;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
}

.contact--plain .contact__input,
.contact--plain .contact__select,
.contact--plain .contact__textarea {
	background: var(--color-cream-light);
}

/* ---- Left column ---- */

.contact__heading {
	margin-bottom: var(--space-md);
	line-height: 1.25;
}

.contact__text {
	margin-bottom: 2.25rem;
	line-height: 1.75;
}

.contact__channel {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
	text-decoration: none;
}

.contact__chip {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-md);
	background: var(--color-light-grey);
	color: var(--color-accent);
}

.contact__phone {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 1rem;
	color: var(--color-heading);
}

.contact__email {
	font-size: 0.875rem;
	line-height: 1.2;
	color: var(--color-teal);
	overflow-wrap: break-word;
}

.contact__channel:hover .contact__phone,
.contact__channel:hover .contact__email,
.contact__channel:focus-visible .contact__phone,
.contact__channel:focus-visible .contact__email {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---- Urgent Help card ---- */

.contact__urgent {
	margin-top: 2rem;
	/* mobile mockup gives the card extra air below the last helpline */
	padding: 1.25rem 1.25rem 1.75rem;
	background: var(--color-cream);
}

.contact__urgent-heading {
	margin-bottom: var(--space-md);
	font-size: 1.5rem;
	line-height: 1.1;
}

.contact__urgent-text {
	margin-bottom: 1.5rem;
	line-height: 1.5;
}

.contact__urgent-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.contact__urgent-item {
	position: relative;
	padding-left: 1.3rem;
	line-height: 1.5;
}

.contact__urgent-item::before {
	content: "\2022";
	position: absolute;
	left: 0.375rem;
}

.contact__urgent-item--bold {
	font-weight: 700;
}

.contact__urgent-item a {
	color: inherit;
	text-decoration: underline;
	/* design underlines hug the baseline (1-2px), not the browser default */
	text-underline-offset: 1px;
	transition: color var(--transition);
}

.contact__urgent-item a:hover,
.contact__urgent-item a:focus-visible {
	color: var(--color-teal);
}

/* ---- Form ---- */

.contact__form {
	margin-top: 2.25rem;
}

.contact__honeypot {
	position: absolute;
	left: -9999px;
	height: 0;
	margin: 0;
	overflow: hidden;
}

.contact__status {
	margin: 0 0 1.5rem;
	padding: 0.875rem 1rem;
	border: 1px solid var(--color-teal);
	border-radius: var(--radius-xs);
	font-size: 0.9375rem;
	color: var(--color-teal);
}

.contact__status--error {
	border-color: var(--color-error);
	color: var(--color-error);
}

.contact__fields {
	display: grid;
	grid-template-columns: 1fr;
	row-gap: 1.5rem;
}

.contact__field {
	margin: 0;
	grid-column: 1 / -1;
}

.contact__label {
	display: block;
	margin-bottom: 0.625rem;
	font-size: var(--text-eyebrow);
	font-weight: 700;
	line-height: 1.34; /* 16px box per the .fig - keeps the form rhythm */
	letter-spacing: var(--tracking-eyebrow);
	text-transform: uppercase;
	color: var(--color-teal);
}

.contact__input {
	display: block;
	width: 100%;
	height: 3.4375rem;
	padding: 0 0.875rem;
	background: transparent;
	border: 1px solid var(--color-input-border);
	border-radius: var(--radius-xs);
	font-family: var(--font-body);
	font-size: 1.125rem;
	color: var(--color-text);
	transition: border-color var(--transition);
}

.contact__input::placeholder {
	color: var(--color-placeholder);
	opacity: 1;
}

.contact__input:focus-visible {
	outline: 2px solid var(--color-teal);
	outline-offset: 1px;
	border-color: var(--color-teal);
}

.contact__select-wrap {
	position: relative;
	display: block;
}

.contact__select {
	appearance: none;
	padding-right: 2.75rem;
}

/* Placeholder option selected - grey like the other placeholders, per the design */
.contact__select:invalid {
	color: var(--color-placeholder);
}

.contact__select-chevron {
	position: absolute;
	top: 50%;
	right: 0.875rem;
	width: 12px;
	height: 6px;
	transform: translateY(-50%);
	color: var(--color-teal);
	pointer-events: none;
}

.contact__textarea {
	height: 9.9375rem; /* the design's exact 159px */
	min-height: 9.9375rem;
	padding: 0.875rem;
	line-height: 1.55;
	resize: none; /* mockups show a clean corner, no resize grip */
}

/* Full-width submit; height 60px = 1.125rem padding + 24px line */
.contact__submit {
	width: 100%;
	margin-top: 2rem;
	padding-block: 1.125rem;
	line-height: 1.5;
}

.contact__privacy {
	max-width: 389px; /* the design's text box - sets the two-line wrap */
	margin-top: 1.875rem;
	margin-inline: auto;
	font-size: 0.875rem;
	line-height: 1.45;
	text-align: center;
	color: var(--color-text-muted);
}

.contact__privacy p {
	margin: 0;
}

.contact__privacy a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color var(--transition);
}

.contact__privacy a:hover,
.contact__privacy a:focus-visible {
	color: var(--color-teal);
}

/* ---- Tablet: wider card padding, name/phone go two-up ---- */

@media (min-width: 768px) {
	.contact__card {
		padding: 3rem;
	}

	.contact__fields {
		grid-template-columns: 1fr 1fr;
		column-gap: 1rem; /* comfortable on the wide tablet form; 7px is desktop-only */
	}

	.contact__field--half {
		grid-column: auto;
	}
}

/* ---- Desktop split ---- */

@media (min-width: 1024px) {
	.contact {
		padding-block: 7.5rem 6rem;
	}

	/* Measured from the design: 87px above the first line of content and
	   113px below the last. The card variant keeps its own numbers above. */
	.contact--plain {
		padding-block: 5.4375rem 7rem;
	}

	.contact__card {
		display: grid;
		grid-template-columns: minmax(0, 433px) minmax(0, 417px);
		justify-content: space-between;
		align-items: start;
		padding: 5rem;
	}

	.contact__text {
		margin-bottom: 2.5rem;
		line-height: 1.55;
	}

	.contact__channel {
		gap: 0.875rem;
		margin-bottom: 1rem;
	}

	.contact__phone {
		font-size: 1.5rem;
	}

	.contact__email {
		font-size: 1.125rem;
	}

	.contact__urgent {
		margin-top: 1.5rem;
		padding: 1.25rem; /* desktop mockup is a uniform 20px */
	}

	/* The design's urgent copy sits in a 362px text box inside the 433px card */
	.contact__urgent-text,
	.contact__urgent-list {
		max-width: 362px;
	}

	.contact__urgent-text,
	.contact__urgent-item {
		line-height: 1.55;
	}

	.contact__urgent-item {
		padding-left: 1.625rem;
	}

	.contact__urgent-item::before {
		left: 0.625rem;
	}

	/* The design sets the form column 30px below the card's content top */
	.contact__form {
		margin-top: 1.875rem;
	}

	.contact__fields {
		column-gap: 7px; /* the design's exact gap between Name and Phone */
		row-gap: 0.875rem;
	}

	.contact__label {
		margin-bottom: 0.6875rem;
	}

	.contact__submit {
		margin-top: 1.5rem;
		box-shadow: var(--shadow-button);
	}

	.contact__privacy {
		margin-top: 1.5625rem;
	}
}
