/**
 * Earth's Suns — catering enquiry form.
 *
 * Palette is drawn from Haitian visual vernacular rather than the default
 * farm-to-table cream: flag indigo as the structural colour, soup joumou gold
 * for the single call to action, pikliz red reserved for errors.
 */

.esc {
	/* Colour — sampled from the Earth & Sun's Cuisine business card */
	--esc-indigo: #3d5232;        /* globe green: structural */
	--esc-indigo-deep: #25331e;   /* deep green: success panel */
	--esc-cobalt: #b8641f;        /* deep orange: focus rings */
	--esc-gold: #e08238;          /* sun orange: primary action */
	--esc-gold-deep: #b8641f;
	--esc-pikliz: #c2342f;        /* errors only */
	--esc-surface: #fdf9ee;
	--esc-paper: #f7edcb;
	--esc-ink: #2a2a22;
	--esc-muted: #6e6553;
	--esc-line: #e3d7b4;

	/* Type */
	--esc-display: "Newsreader", Georgia, "Times New Roman", serif;
	--esc-body: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

	/* Rhythm */
	--esc-gap: 1.125rem;
	--esc-radius: 4px;

	font-family: var(--esc-body);
	color: var(--esc-ink);
	font-size: 1rem;
	line-height: 1.55;
	max-width: 46rem;
	margin-inline: auto;
	text-align: left;
}

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

/* -------------------------------------------------------------------------
 * Shell
 * ---------------------------------------------------------------------- */

.esc-form {
	background: var(--esc-surface);
	border: 1px solid var(--esc-line);
	border-top: 5px solid var(--esc-indigo);
	border-radius: var(--esc-radius);
	padding: clamp(1.25rem, 4vw, 2.5rem);
}

.esc-form__head {
	margin-bottom: 2rem;
}

.esc-form__title {
	font-family: var(--esc-display);
	font-weight: 600;
	font-size: clamp(1.6rem, 5vw, 2.3rem);
	line-height: 1.1;
	letter-spacing: -0.02em;
	color: var(--esc-indigo);
	margin: 0 0 0.5rem;
}

.esc-form__sub {
	margin: 0;
	color: var(--esc-muted);
	max-width: 42ch;
}

/* -------------------------------------------------------------------------
 * Steps
 *
 * The numbers are load-bearing: this form is filled top to bottom, so the
 * sequence is real information rather than decoration.
 * ---------------------------------------------------------------------- */

.esc-step {
	border: 0;
	border-top: 1px solid var(--esc-line);
	margin: 0;
	padding: 1.75rem 0 0;
}

.esc-step + .esc-step {
	margin-top: 1.75rem;
}

.esc-step__legend {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0;
	margin-bottom: 1.25rem;
}

.esc-step__num {
	display: grid;
	place-items: center;
	inline-size: 1.75rem;
	block-size: 1.75rem;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--esc-indigo);
	color: #fff;
	font-family: var(--esc-display);
	font-weight: 600;
	font-size: 0.9rem;
	line-height: 1;
}

.esc-step__name {
	font-family: var(--esc-display);
	font-weight: 600;
	font-size: 1.15rem;
	color: var(--esc-indigo);
	letter-spacing: -0.01em;
}

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

.esc-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--esc-gap);
}

.esc-field {
	grid-column: span 4;
	min-inline-size: 0;
}

.esc-field--half {
	grid-column: span 2;
}

.esc-field--quarter {
	grid-column: span 1;
}

@media (max-width: 40rem) {
	.esc-field--half,
	.esc-field--quarter {
		grid-column: span 4;
	}
}

.esc-field label {
	display: block;
	font-weight: 700;
	font-size: 0.92rem;
	margin-bottom: 0.35rem;
	color: var(--esc-ink);
}

.esc-opt {
	font-weight: 400;
	color: var(--esc-muted);
	font-size: 0.85em;
}

.esc-field input[type="text"],
.esc-field input[type="email"],
.esc-field input[type="tel"],
.esc-field input[type="number"],
.esc-field input[type="date"],
.esc-field input[type="time"],
.esc-field select,
.esc-field textarea {
	inline-size: 100%;
	font-family: inherit;
	font-size: 1rem;
	color: var(--esc-ink);
	background: var(--esc-paper);
	border: 1px solid var(--esc-line);
	border-radius: var(--esc-radius);
	padding: 0.7rem 0.8rem;
	transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
	/* Prevents iOS zoom-on-focus at 16px. */
	-webkit-appearance: none;
	appearance: none;
}

.esc-field select {
	background-image: linear-gradient(45deg, transparent 50%, var(--esc-indigo) 50%),
		linear-gradient(135deg, var(--esc-indigo) 50%, transparent 50%);
	background-position: calc(100% - 1.1rem) 1.15rem, calc(100% - 0.75rem) 1.15rem;
	background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
	background-repeat: no-repeat;
	padding-right: 2.25rem;
}

.esc-field textarea {
	resize: vertical;
	min-block-size: 3.5rem;
	line-height: 1.5;
}

.esc-field :is(input, select, textarea):focus-visible {
	outline: none;
	background: var(--esc-surface);
	border-color: var(--esc-cobalt);
	box-shadow: 0 0 0 3px rgba(184, 100, 31, 0.22);
}

.esc-field.is-invalid :is(input, select, textarea) {
	border-color: var(--esc-pikliz);
	background: #fdf6f5;
}

.esc-hint {
	margin: 0.35rem 0 0;
	font-size: 0.82rem;
	color: var(--esc-muted);
	line-height: 1.4;
}

.esc-error {
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--esc-pikliz);
	line-height: 1.4;
	display: none;
}

.esc-field.is-invalid .esc-error {
	display: block;
}

/* -------------------------------------------------------------------------
 * Coverage answer — the one loud moment in the form
 * ---------------------------------------------------------------------- */

.esc-coverage {
	margin-top: 1rem;
	padding: 0.85rem 1rem;
	border-radius: var(--esc-radius);
	font-size: 0.95rem;
	line-height: 1.45;
	border-left: 4px solid var(--esc-gold);
	background: #fdf6e6;
	color: #5a4209;
}

.esc-coverage.is-outside {
	border-left-color: var(--esc-cobalt);
	background: #eef3fb;
	color: var(--esc-indigo-deep);
}

.esc-coverage.is-checking {
	border-left-color: var(--esc-line);
	background: var(--esc-paper);
	color: var(--esc-muted);
}

/* -------------------------------------------------------------------------
 * Consents, honeypot, footer
 * ---------------------------------------------------------------------- */

.esc-consents {
	margin-top: 1.25rem;
	display: grid;
	gap: 0.6rem;
}

.esc-check {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	font-size: 0.9rem;
	color: var(--esc-muted);
	cursor: pointer;
}

.esc-check input {
	margin-top: 0.22rem;
	accent-color: var(--esc-indigo);
	inline-size: 1rem;
	block-size: 1rem;
	flex: 0 0 auto;
}

.esc-hp {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.esc-form__foot {
	margin-top: 2rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--esc-line);
}

.esc-submit {
	font-family: var(--esc-display);
	font-weight: 600;
	font-size: 1.05rem;
	letter-spacing: 0.005em;
	color: #ffffff;
	background: var(--esc-gold);
	border: 0;
	border-radius: var(--esc-radius);
	padding: 0.85rem 2rem;
	cursor: pointer;
	inline-size: 100%;
	transition: background 0.12s ease;
}

@media (min-width: 40rem) {
	.esc-submit {
		inline-size: auto;
		min-inline-size: 14rem;
	}
}

.esc-submit:hover:not(:disabled) {
	background: var(--esc-gold-deep);
}

.esc-submit:focus-visible {
	outline: 3px solid var(--esc-indigo);
	outline-offset: 2px;
}

.esc-submit:disabled {
	opacity: 0.6;
	cursor: progress;
}

.esc-foot-note {
	margin: 0.9rem 0 0;
	font-size: 0.85rem;
	color: var(--esc-muted);
	max-width: 46ch;
}

/* -------------------------------------------------------------------------
 * Form-level alert
 * ---------------------------------------------------------------------- */

.esc-alert {
	margin-bottom: 1.5rem;
	padding: 0.85rem 1rem;
	border-radius: var(--esc-radius);
	border-left: 4px solid var(--esc-pikliz);
	background: #fdf1f0;
	color: #7d1d19;
	font-size: 0.95rem;
}

.esc-alert:focus-visible {
	outline: 2px solid var(--esc-pikliz);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Success state
 * ---------------------------------------------------------------------- */

.esc-done {
	background: var(--esc-indigo);
	color: #fff;
	border-radius: var(--esc-radius);
	padding: clamp(1.75rem, 5vw, 3rem);
	text-align: center;
}

.esc-done__mark {
	inline-size: 3rem;
	block-size: 3rem;
	margin: 0 auto 1rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--esc-gold);
	color: #ffffff;
	font-size: 1.5rem;
	line-height: 1;
}

.esc-done__title {
	font-family: var(--esc-display);
	font-weight: 600;
	font-size: clamp(1.4rem, 4vw, 1.9rem);
	margin: 0 0 0.6rem;
	letter-spacing: -0.015em;
}

.esc-done__body {
	margin: 0 auto;
	max-width: 44ch;
	color: rgba(255, 255, 255, 0.92);
}

.esc-done__meta {
	margin: 1.25rem auto 0;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.22);
	max-width: 46ch;
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.75);
}

/* -------------------------------------------------------------------------
 * Motion
 * ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.esc *,
	.esc *::before,
	.esc *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
