/* ============================================================
   Hail Damage Estimator v2 — Stylesheet
   ============================================================ */

#hde-wrap {
	max-width: 640px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	color: #1a1a2e;
}

/* ── Progress bar ────────────────────────────────────────── */

.hde-progress {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	margin-bottom: 32px;
}
.hde-prog-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}
.hde-prog-circle {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .3s, box-shadow .3s;
}
.hde-prog-circle span {
	font-size: 15px;
	font-weight: 700;
	color: #9ca3af;
	transition: color .3s;
}
.hde-prog-step em {
	font-style: normal;
	font-size: 12px;
	color: #9ca3af;
	font-weight: 500;
	transition: color .3s;
}
.hde-prog-step.active .hde-prog-circle {
	background: #2563eb;
	box-shadow: 0 0 0 4px rgba(37,99,235,.15);
}
.hde-prog-step.active .hde-prog-circle span { color: #fff; }
.hde-prog-step.active em { color: #2563eb; font-weight: 700; }
.hde-prog-step.done .hde-prog-circle { background: #16a34a; }
.hde-prog-step.done .hde-prog-circle span { color: #fff; }
.hde-prog-step.done em { color: #16a34a; }
.hde-prog-line {
	flex: 1;
	height: 2px;
	background: #e5e7eb;
	margin-top: 21px;
	max-width: 90px;
	transition: background .3s;
}
.hde-prog-line.done { background: #16a34a; }

/* ── Card panels ─────────────────────────────────────────── */

.hde-panel {
	display: none;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 36px 32px;
	box-shadow: 0 4px 24px rgba(0,0,0,.07);
}
.hde-panel.active { display: block; }

.hde-title {
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 6px;
	color: #111827;
}
.hde-subtitle {
	font-size: 14px;
	color: #6b7280;
	margin: 0 0 28px;
}

/* ── Form fields ─────────────────────────────────────────── */

.hde-field {
	margin-bottom: 20px;
}
.hde-field label,
.hde-section-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: #374151;
	margin-bottom: 7px;
	text-transform: uppercase;
	letter-spacing: .05em;
}
.hde-field .req,
.hde-section-label .req { color: #ef4444; }

.hde-field input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 11px 14px;
	border: 1.5px solid #d1d5db;
	border-radius: 9px;
	font-size: 15px;
	color: #111827;
	background: #f9fafb;
	transition: border-color .2s, background .2s, box-shadow .2s;
	-webkit-appearance: none;
}
.hde-field input:focus {
	outline: none;
	border-color: #2563eb;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Two-column layout for name + phone */
.hde-row-2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

/* Three-column layout for year/make/model */
.hde-field-divider {
	border-top: 1px solid #f3f4f6;
	padding-top: 20px;
	margin-top: 4px;
}
.hde-row-3col {
	display: grid;
	grid-template-columns: 100px 1fr 1fr;
	gap: 12px;
}
.hde-field-sub { margin-bottom: 0; }
.hde-field-sub label {
	font-size: 11px;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: .04em;
	margin-bottom: 5px;
}

/* ── Dent Size Card Selector ─────────────────────────────── */

.hde-dent-field {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 18px 20px;
	margin-bottom: 24px;
}
.hde-dent-field .hde-section-label { margin-bottom: 4px; }
.hde-dent-hint {
	font-size: 13px;
	color: #6b7280;
	margin: 0 0 16px;
}

.hde-dent-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
}

.hde-dent-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 10px 12px;
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	cursor: pointer;
	transition: border-color .2s, background .2s, box-shadow .2s;
	text-align: center;
	-webkit-user-select: none;
	user-select: none;
}
.hde-dent-card input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.hde-dent-card:hover {
	border-color: #93c5fd;
	background: #f0f9ff;
}
.hde-dent-card.selected {
	border-color: #2563eb;
	background: #eff6ff;
	box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Coin visual */
.hde-coin-wrap {
	height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.hde-coin {
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #f5d78e, #c9a227);
	box-shadow: inset -2px -2px 4px rgba(0,0,0,.2), 0 2px 6px rgba(0,0,0,.15);
	flex-shrink: 0;
}

.hde-dent-card strong {
	font-size: 13px;
	font-weight: 700;
	color: #111827;
	line-height: 1.2;
}
.hde-dent-card span {
	font-size: 11px;
	color: #9ca3af;
}

/* ── Panel rows (step 2) ─────────────────────────────────── */

.hde-panels-field { margin-bottom: 0; }

.hde-row {
	display: grid;
	grid-template-columns: 1fr 1fr auto auto;
	gap: 10px;
	align-items: center;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 11px 14px;
	margin-bottom: 8px;
	transition: border-color .2s;
}
.hde-row:hover { border-color: #c7d2fe; }

.hde-row select {
	padding: 9px 30px 9px 10px;
	border: 1.5px solid #d1d5db;
	border-radius: 7px;
	font-size: 14px;
	color: #111827;
	background: #fff;
	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 d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	box-sizing: border-box;
}
.hde-row select:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.hde-row-price {
	font-size: 14px;
	font-weight: 800;
	color: #2563eb;
	text-align: right;
	white-space: nowrap;
	min-width: 62px;
}
.hde-row-price.cr      { color: #dc2626; font-size: 11px; }
.hde-row-price.pending { color: #9ca3af; font-weight: 400; }
.hde-row-del {
	background: none;
	border: none;
	cursor: pointer;
	color: #d1d5db;
	font-size: 20px;
	line-height: 1;
	padding: 0 3px;
	transition: color .2s;
}
.hde-row-del:hover { color: #ef4444; }

/* ── Buttons ─────────────────────────────────────────────── */

.hde-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px 26px;
	border-radius: 9px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	border: none;
	transition: background .2s, transform .1s;
	line-height: 1;
}
.hde-btn:active { transform: scale(.98); }

.hde-primary { background: #2563eb; color: #fff; }
.hde-primary:hover { background: #1d4ed8; }
.hde-primary.loading { opacity: .65; cursor: not-allowed; pointer-events: none; }

.hde-outline {
	background: #fff;
	color: #374151;
	border: 1.5px solid #d1d5db;
}
.hde-outline:hover { background: #f3f4f6; }

.hde-add-btn {
	width: 100%;
	background: transparent;
	color: #2563eb;
	border: 1.5px dashed #93c5fd;
	border-radius: 9px;
	padding: 10px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	margin-top: 4px;
	transition: background .2s, border-color .2s;
}
.hde-add-btn:hover { background: #eff6ff; border-color: #2563eb; }

.hde-actions     { margin-top: 28px; }
.hde-split       { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ── Alert ───────────────────────────────────────────────── */

.hde-alert {
	font-size: 13px;
	color: #dc2626;
	font-weight: 500;
	min-height: 20px;
	margin-top: 10px;
}

/* ── Estimate display ────────────────────────────────────── */

.hde-est-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 14px 18px;
	margin-bottom: 20px;
}
.hde-est-meta-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.hde-est-meta-item strong {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #9ca3af;
}
.hde-est-meta-item span { font-size: 14px; color: #111827; font-weight: 600; }

.hde-est-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
	font-size: 14px;
}
.hde-est-table thead th {
	background: #f3f4f6;
	padding: 10px 12px;
	text-align: left;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #6b7280;
	border-bottom: 2px solid #e5e7eb;
}
.hde-est-table tbody td {
	padding: 11px 12px;
	border-bottom: 1px solid #f3f4f6;
	color: #374151;
}
.hde-est-table tbody tr:last-child td { border-bottom: none; }
.hde-est-table .price-col { text-align: right; font-weight: 700; color: #111827; }
.hde-est-table .cr-col    { text-align: right; font-weight: 700; color: #dc2626; font-size: 12px; }

.hde-est-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: linear-gradient(135deg, #eff6ff, #dbeafe);
	border: 1.5px solid #bfdbfe;
	border-radius: 12px;
	padding: 18px 22px;
	margin-bottom: 16px;
}
.hde-est-total .tot-label  { font-weight: 700; color: #1e40af; font-size: 15px; }
.hde-est-total .tot-amount { font-weight: 900; color: #1e40af; font-size: 28px; letter-spacing: -.02em; }

.hde-est-note {
	font-size: 12px;
	color: #6b7280;
	line-height: 1.65;
	background: #fafafa;
	border-left: 3px solid #e5e7eb;
	border-radius: 0 6px 6px 0;
	padding: 10px 14px;
	margin-bottom: 10px;
}
.hde-est-note.warn {
	border-left-color: #fbbf24;
	background: #fffbeb;
	color: #92400e;
}

/* ── Success ─────────────────────────────────────────────── */

.hde-success-wrap { text-align: center; padding: 20px 0 8px; }
.hde-check-icon {
	width: 68px;
	height: 68px;
	background: #16a34a;
	color: #fff;
	border-radius: 50%;
	font-size: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 22px;
	box-shadow: 0 4px 18px rgba(22,163,74,.3);
}
.hde-success-wrap h2 { font-size: 26px; font-weight: 800; margin: 0 0 12px; color: #111827; }
.hde-success-wrap p  { font-size: 15px; color: #374151; margin: 0 0 10px; line-height: 1.6; }
.hde-soft            { font-size: 13px !important; color: #9ca3af !important; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 540px) {
	.hde-panel    { padding: 24px 16px; }
	.hde-row-2col { grid-template-columns: 1fr; }
	.hde-row-3col { grid-template-columns: 1fr 1fr; }
	.hde-row-3col .hde-field-sub:first-child { grid-column: 1/-1; }

	.hde-dent-cards { grid-template-columns: repeat(2, 1fr); }

	.hde-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 8px; }
	.hde-row-price { grid-column: 1; grid-row: 2; text-align: left; }
	.hde-row-del   { grid-column: 2; grid-row: 2; text-align: right; }

	.hde-split { flex-direction: column-reverse; }
	.hde-split .hde-btn { width: 100%; }

	.hde-prog-line { max-width: 40px; }
	.hde-est-meta  { flex-direction: column; gap: 10px; }
}
