/*
 * Contact page enquiry form.
 * Ported from the paid-ads landing pages so all three forms look and behave the same.
 * Loaded only on the Contact template (see commotiondigital_enqueue_assets()).
 */

.contact-form-section {
	--cf-cyan: #00FBFF;
	--cf-blue: #00BAFF;
	--cf-grad: linear-gradient(90deg, #00FBFF 0%, #00BAFF 100%);
	--cf-line: rgba(0, 251, 255, 0.22);
	--cf-muted: rgba(255, 255, 255, 0.72);
	--cf-subtle: rgba(255, 255, 255, 0.55);
	--cf-error: #FF8A8A;
	scroll-margin-top: 130px;
}

/* ---------- Card ---------- */

.cf-card {
	position: relative;
	max-width: 640px;
	margin: 0 auto;
	padding: 32px;
	border-radius: 30px;
	background: rgba(16, 23, 43, 0.86);
	border: 1px solid var(--cf-line);
	box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 251, 255, 0.04) inset;
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	color: #fff;
}

.cf-star {
	position: absolute;
	top: -20px;
	right: -14px;
	z-index: 3;
	width: 72px;
	pointer-events: none;
}

.cf-card__title {
	font-size: var(--font-size-title);
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 8px;
}

.cf-card__sub {
	color: var(--cf-muted);
	margin: 0 0 24px;
}

.cf-flash {
	margin: 0 0 20px;
	padding: 12px 16px;
	border-radius: 12px;
	border: 1px solid rgba(255, 138, 138, 0.4);
	background: rgba(255, 138, 138, 0.08);
	color: var(--cf-error);
}

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

.cf-form {
	display: grid;
	gap: 16px;
}

.cf-field label {
	display: block;
	font-weight: 500;
	margin-bottom: 6px;
}

.cf-field input,
.cf-field select {
	width: 100%;
	min-height: 48px;
	padding: 12px 16px;
	font: inherit;
	font-size: 16px; /* prevents iOS zoom on focus */
	color: #fff;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 12px;
	transition: border-color 0.2s ease, background-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.cf-field input::placeholder { color: var(--cf-subtle); }

.cf-field input:focus,
.cf-field select:focus {
	outline: none;
	border-color: var(--cf-cyan);
	background: rgba(0, 251, 255, 0.05);
}

.cf-select { position: relative; }

.cf-select::after {
	content: "";
	position: absolute;
	right: 18px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--cf-cyan);
	border-bottom: 2px solid var(--cf-cyan);
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

.cf-select select { padding-right: 44px; cursor: pointer; }
.cf-select select:invalid { color: var(--cf-subtle); }
.cf-select option { color: #0A0F1F; background: #fff; }

.cf-field__optional { font-weight: 400; color: var(--cf-subtle); }

.cf-field__error {
	display: none;
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--cf-error);
}

.cf-field.is-invalid input,
.cf-field.is-invalid select { border-color: var(--cf-error); }
.cf-field.is-invalid .cf-field__error { display: block; }

/* Spam trap: off-screen for people, still in the form for bots */
.cf-trap {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Submit button (same as the landing pages' glowing CTA) ---------- */

.cf-submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-top: 8px;
	padding: 16px 32px;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	color: #0A0F1F;
	background: var(--cf-grad);
	border: 0;
	border-radius: 999px;
	box-shadow: 0 10px 30px -10px rgba(0, 200, 255, 0.6);
	cursor: pointer;
	overflow: hidden;
	isolation: isolate;
	transition: transform 0.25s ease, box-shadow 0.35s ease, filter 0.35s ease, opacity 0.2s ease;
}

.cf-submit::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
	transform: translateX(-120%);
	pointer-events: none;
}

.cf-submit:hover:not(:disabled),
.cf-submit:focus-visible:not(:disabled) {
	transform: translateY(-2px);
	filter: brightness(1.12) saturate(1.1);
	box-shadow:
		0 0 22px rgba(0, 251, 255, 0.85),
		0 0 60px rgba(0, 186, 255, 0.6),
		0 16px 44px -8px rgba(0, 220, 255, 0.9);
}

.cf-submit:hover:not(:disabled)::after,
.cf-submit:focus-visible:not(:disabled)::after {
	transform: translateX(120%);
	transition: transform 0.7s ease;
}

.cf-submit:disabled {
	cursor: not-allowed;
	opacity: 0.4;
	box-shadow: none;
}

.cf-form__hint {
	margin: 0;
	font-size: 13px;
	text-align: center;
	color: var(--cf-subtle);
}

.cf-email {
	margin: 20px 0 0;
	text-align: center;
	color: var(--cf-muted);
}

.cf-email a {
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid var(--cf-line);
	transition: color 0.2s ease, border-color 0.2s ease;
}

.cf-email a:hover { color: var(--cf-cyan); border-color: var(--cf-cyan); }

/* ---------- Thank-you state ---------- */

.cf-thanks { text-align: center; }
.cf-thanks__icon { width: 110px; margin: 0 auto 20px; }
.cf-thanks .cf-card__sub { margin-bottom: 0; }

/* ---------- Phones: illuminated outline with a band of light travelling round it ---------- */

@property --cf-border-angle {
	syntax: "<angle>";
	inherits: false;
	initial-value: 0deg;
}

@keyframes cf-border-travel {
	to { --cf-border-angle: 360deg; }
}

@media (max-width: 767px) {
	.contact-form-section { scroll-margin-top: 90px; }

	/* The panel's own 30px side padding would squeeze the form on phones */
	.contact-form-section.contact-methods { padding: 44px 14px 28px; }

	.cf-card {
		padding: 24px 20px;
		border-radius: 24px;
		border-color: transparent;
		box-shadow: 0 0 34px -8px rgba(0, 251, 255, 0.4), 0 30px 80px -30px rgba(0, 0, 0, 0.8);
	}

	.cf-card::before {
		content: "";
		position: absolute;
		inset: -1px;
		border-radius: inherit;
		padding: 2px;
		background: conic-gradient(from var(--cf-border-angle),
			rgba(0, 186, 255, 0.45) 0deg,
			rgba(0, 186, 255, 0.45) 240deg,
			#00FBFF 300deg,
			#fff 322deg,
			#00FBFF 344deg,
			rgba(0, 186, 255, 0.45) 360deg);
		-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
		-webkit-mask-composite: xor;
		mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
		animation: cf-border-travel 6s linear infinite;
		pointer-events: none;
	}

	.cf-star { width: 52px; top: -16px; right: -8px; }
}

@media (prefers-reduced-motion: reduce) {
	.cf-card::before { animation: none; }
	.cf-field input, .cf-field select, .cf-submit, .cf-submit::after { transition: none; }
}
