/**
 * ThatWorks Core — public styles.
 *
 * Styles the [tw_ent_lead_form] shortcode and the thank-you page.
 * Uses the same CSS custom properties as the main theme so the form
 * blends naturally on homepage, service pages, and location pages.
 */

/* ============================================================
   Honeypot — must be invisible to sighted users but NOT
   display:none (screen readers should skip via aria-hidden).
============================================================ */
.tw-hp {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

/* ============================================================
   Form wrapper
============================================================ */
.tw-lead-wrap {
	max-width: 780px;
	margin-inline: auto;
}

/* ============================================================
   Error / success notice
============================================================ */
.tw-lead-notice {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	padding: 0.9rem 1.1rem;
	border-radius: 10px;
	margin-bottom: 1.5rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.tw-lead-notice--error {
	background: rgba(220, 50, 50, 0.15);
	border: 1px solid rgba(220, 50, 50, 0.4);
	color: #f87171;
}

.tw-lead-notice strong {
	display: block;
	width: 100%;
}

/* ============================================================
   Headline + subtext
============================================================ */
.tw-lead-headline {
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 800;
	color: var(--tw-text, #fff);
	margin: 0 0 0.5rem;
	line-height: 1.2;
}

.tw-lead-sub {
	color: var(--tw-muted, #c8d0da);
	margin: 0 0 1.75rem;
	font-size: 1rem;
}

/* ============================================================
   Required star
============================================================ */
.tw-req {
	color: var(--tw-orange, #38bdf8);
	margin-left: 0.2em;
}

/* ============================================================
   Form layout
============================================================ */
.tw-lead-form {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}

.tw-lead-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.1rem;
}

@media ( min-width: 640px ) {
	.tw-lead-row--2 {
		grid-template-columns: 1fr 1fr;
	}
}

/* ============================================================
   Field + label
============================================================ */
.tw-lead-field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.tw-lead-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--tw-muted, #c8d0da);
	letter-spacing: 0.02em;
}

/* ============================================================
   Text inputs, select, textarea
============================================================ */
.tw-lead-input,
.tw-lead-select,
.tw-lead-textarea {
	width: 100%;
	padding: 0.75rem 0.85rem;
	background: var(--tw-surface, #151515);
	border: 1px solid var(--tw-border, rgba(255, 255, 255, 0.10));
	border-radius: 10px;
	color: var(--tw-text, #fff);
	font: inherit;
	font-size: 1rem; /* must be >= 16px — prevents iOS auto-zoom on focus */
	line-height: 1.5;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.tw-lead-input:focus,
.tw-lead-select:focus,
.tw-lead-textarea:focus {
	outline: none;
	border-color: var(--tw-orange, #38bdf8);
	box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.tw-lead-input::placeholder,
.tw-lead-textarea::placeholder {
	color: var(--tw-muted-2, #9aa4af);
}

/* Date input color fix (some browsers render it light) */
.tw-lead-input--date::-webkit-calendar-picker-indicator {
	filter: invert(0.7);
	cursor: pointer;
}

/* Select arrow */
.tw-lead-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa4af' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	padding-right: 2.2rem;
}

.tw-lead-select option {
	background: #1b1e23;
	color: #fff;
}

.tw-lead-textarea {
	resize: vertical;
	min-height: 110px;
}

/* ============================================================
   Services checkboxes
============================================================ */
.tw-lead-fieldset {
	border: 1px solid var(--tw-border, rgba(255, 255, 255, 0.10));
	border-radius: 10px;
	padding: 1rem 1.1rem;
	background: var(--tw-surface, #151515);
}

.tw-lead-fieldset legend {
	padding: 0 0.4rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--tw-muted, #c8d0da);
	letter-spacing: 0.02em;
}

.tw-lead-checks {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 0.5rem 1rem;
	margin-top: 0.65rem;
}

.tw-lead-check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	font-size: 0.9rem;
	color: var(--tw-muted, #c8d0da);
	line-height: 1.3;
}

.tw-lead-check:hover {
	color: var(--tw-text, #fff);
}

.tw-lead-checkbox {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	accent-color: var(--tw-orange, #38bdf8);
	cursor: pointer;
}

/* ============================================================
   Submit button + privacy line
============================================================ */
.tw-lead-actions {
	padding-top: 0.5rem;
}

.tw-lead-submit {
	/* Inherits .tw-btn .tw-btn-primary from the theme.
	   Width override for full-width on mobile. */
	width: 100%;
}

@media ( min-width: 480px ) {
	.tw-lead-submit {
		width: auto;
		min-width: 200px;
	}
}

.tw-lead-submit:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.tw-lead-privacy {
	font-size: 0.8rem;
	color: var(--tw-muted-2, #9aa4af);
	margin: 0.5rem 0 0;
}

/* ============================================================
   Thank-you page
============================================================ */
.tw-main--thank-you {
	min-height: 60vh;
	display: flex;
	align-items: center;
}

.tw-thank-you {
	width: 100%;
	text-align: center;
	padding-block: 5rem;
}

.tw-thank-you__inner {
	max-width: 600px;
	margin-inline: auto;
}

.tw-thank-you__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: rgba(56, 189, 248, 0.12);
	border: 2px solid var(--tw-orange, #38bdf8);
	color: var(--tw-orange, #38bdf8);
	font-size: 2rem;
	font-weight: 800;
	margin-bottom: 1.5rem;
}

.tw-thank-you__title {
	font-size: clamp(1.6rem, 4vw, 2.4rem);
	font-weight: 800;
	color: var(--tw-text, #fff);
	margin: 0 0 1rem;
	line-height: 1.2;
}

.tw-thank-you__copy {
	font-size: 1.05rem;
	color: var(--tw-muted, #c8d0da);
	margin: 0 0 2rem;
	line-height: 1.65;
}

.tw-thank-you__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: center;
}
