/*
 * RoofPilot homeowner form — chunk 1.
 * Single brand hook: --brand-color. Later chunks inject the contractor's
 * color into this one variable; everything accent-colored reads from it.
 */
:root {
	--brand-color: #2563eb; /* neutral professional blue (default) */
	--brand-color-dark: #1e4fd1;
	--text: #1f2937;
	--text-muted: #6b7280;
	--border: #d1d5db;
	--border-focus: var(--brand-color);
	--error: #dc2626;
	--bg: #f3f4f6;
	--card-bg: #ffffff;
	--radius: 10px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 24px 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--text);
	background: var(--bg);
	line-height: 1.5;
}

.card {
	max-width: 520px;
	margin: 0 auto;
	background: var(--card-bg);
	border-radius: var(--radius);
	padding: 28px 24px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
}

h1 {
	font-size: 1.5rem;
	margin: 0 0 8px;
	line-height: 1.25;
}

.subhead {
	margin: 0 0 24px;
	color: var(--text-muted);
}

/* Honeypot — visually removed but still in the DOM/tab-excluded. Deliberately
 * NOT display:none and NOT type=hidden so naive bots still fill it. */
.hp-field {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
}

/* ---- Fields ---- */
.field {
	margin-bottom: 18px;
}

label {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	margin-bottom: 6px;
}

.optional {
	font-weight: 400;
	color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
	width: 100%;
	padding: 11px 12px;
	font-size: 1rem;
	font-family: inherit;
	color: var(--text);
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 8px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--border-focus);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea {
	resize: vertical;
}

input.invalid,
select.invalid {
	border-color: var(--error);
}

small.error {
	display: none;
	color: var(--error);
	font-size: 0.83rem;
	margin-top: 5px;
}

small.error.show {
	display: block;
}

/* ---- Checkbox ---- */
.checkbox-field {
	margin-top: 4px;
}

.checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-weight: 400;
	cursor: pointer;
}

.checkbox input {
	margin-top: 3px;
	width: 18px;
	height: 18px;
	accent-color: var(--brand-color);
	flex-shrink: 0;
}

/* ---- Submit ---- */
.submit-btn {
	width: 100%;
	padding: 14px 16px;
	font-size: 1.05rem;
	font-weight: 600;
	color: #fff;
	background: var(--brand-color);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	margin-top: 8px;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.submit-btn:hover:not(:disabled) {
	background: var(--brand-color-dark);
}

.submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.form-error {
	color: var(--error);
	font-size: 0.92rem;
	margin: 14px 0 0;
	text-align: center;
}

.consent {
	font-size: 0.8rem;
	color: var(--text-muted);
	margin: 16px 0 0;
	text-align: center;
}

.consent a {
	color: var(--brand-color);
}

/* ---- Loading view ---- */
#loading-view {
	text-align: center;
	padding: 48px 16px;
}

.spinner {
	width: 44px;
	height: 44px;
	margin: 0 auto 20px;
	border: 4px solid rgba(37, 99, 235, 0.2);
	border-top-color: var(--brand-color);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.loading-text {
	font-size: 1.05rem;
	color: var(--text-muted);
}

/* ---- Result view ---- */
#result-view {
	text-align: center;
	padding: 24px 8px;
}

.result-label {
	font-size: 1rem;
	color: var(--text-muted);
	margin: 0 0 12px;
}

.price {
	font-size: 2.25rem;
	font-weight: 700;
	color: var(--brand-color);
	margin: 0 0 12px;
	line-height: 1.15;
}

.result-note {
	font-size: 0.95rem;
	color: var(--text-muted);
	margin: 0 0 20px;
}

.measured-address {
	font-size: 0.85rem;
	color: var(--text-muted);
	margin: 0;
}

.out-of-area {
	font-size: 1.1rem;
	color: var(--text);
	padding: 24px 8px;
	margin: 0;
}
