/**
 * HWSD Site Forms — front-end styles.
 *
 * Everything is scoped under .hwsdf. Values are read from the theme's own
 * custom properties with fallbacks, so recolouring the theme recolours the
 * forms. No fonts, no resets, no global selectors.
 */

.hwsdf {
	--hwsdf-ink: var(--ink, #231314);
	--hwsdf-muted: var(--muted, #65575a);
	--hwsdf-red: var(--red, #661314);
	--hwsdf-red-dark: var(--red-dark, #5c1c21);
	--hwsdf-accent: var(--red-2, #852027);
	--hwsdf-line: var(--line, rgba(102, 19, 20, 0.14));
	--hwsdf-soft: var(--soft, #f7eff1);
	--hwsdf-radius: var(--radius, 24px);
	--hwsdf-shadow: var(--shadow, 0 18px 45px rgba(92, 28, 33, 0.14));
	color: var(--hwsdf-ink);
}

.hwsdf-form {
	background: #fff;
	border: 1px solid rgba(102, 19, 20, 0.08);
	border-radius: var(--hwsdf-radius);
	box-shadow: var(--hwsdf-shadow);
	padding: 40px;
	margin: 0 0 28px;
}

.hwsdf-section {
	border: 0;
	padding: 0;
	margin: 0 0 34px;
}

.hwsdf-section:last-of-type {
	margin-bottom: 26px;
}

.hwsdf-section-title {
	padding: 0;
	margin: 0 0 6px;
	font-size: 24px;
	line-height: 1.1;
	font-weight: 800;
	color: var(--hwsdf-red-dark);
	border-bottom: 1px solid var(--hwsdf-line);
	padding-bottom: 12px;
	width: 100%;
}

.hwsdf-section-desc {
	margin: 14px 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--hwsdf-muted);
	max-width: 72ch;
}

.hwsdf-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 20px;
	margin-top: 22px;
}

.hwsdf-w-full {
	grid-column: span 6;
}

.hwsdf-w-two-thirds {
	grid-column: span 4;
}

.hwsdf-w-half {
	grid-column: span 3;
}

.hwsdf-w-third {
	grid-column: span 2;
}

.hwsdf-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.hwsdf-field[hidden] {
	display: none;
}

.hwsdf-label {
	font-size: 14px;
	font-weight: 900;
	color: var(--hwsdf-red-dark);
}

.hwsdf-req {
	color: var(--hwsdf-accent);
}

.hwsdf-input {
	min-height: 54px;
	border: 1px solid rgba(102, 19, 20, 0.18);
	border-radius: 999px;
	padding: 0 20px;
	font: inherit;
	color: var(--hwsdf-ink);
	background: #fff;
	width: 100%;
}

.hwsdf-textarea {
	border-radius: 18px;
	padding: 16px 20px;
	min-height: 130px;
	line-height: 1.6;
	resize: vertical;
}

.hwsdf-select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--hwsdf-red) 50%), linear-gradient(135deg, var(--hwsdf-red) 50%, transparent 50%);
	background-position: calc(100% - 22px) 55%, calc(100% - 16px) 55%;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	padding-right: 44px;
}

.hwsdf-input:hover {
	border-color: rgba(102, 19, 20, 0.34);
}

.hwsdf-input:focus-visible,
.hwsdf-choice input:focus-visible,
.hwsdf-submit:focus-visible {
	outline: 3px solid var(--rose, #d7b5b7);
	outline-offset: 3px;
}

.hwsdf-help {
	font-size: 13px;
	line-height: 1.5;
	color: var(--hwsdf-muted);
}

.hwsdf-error {
	font-size: 13px;
	font-weight: 800;
	line-height: 1.5;
	color: #8b1118;
}

.hwsdf-has-error .hwsdf-input {
	border-color: #8b1118;
	background: #fff7f7;
}

.hwsdf-choices {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.hwsdf-choice {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 20px;
	border: 1px solid var(--hwsdf-line);
	border-radius: 18px;
	cursor: pointer;
	font-size: 15px;
	line-height: 1.6;
	min-height: 44px;
}

.hwsdf-choice:hover {
	background: var(--hwsdf-soft);
}

.hwsdf-choice input {
	width: 20px;
	height: 20px;
	margin: 3px 0 0;
	accent-color: #8b1118;
	flex: 0 0 auto;
}

.hwsdf-acceptance {
	border: 0;
	padding: 0;
}

.hwsdf-acceptance:hover {
	background: none;
}

.hwsdf-heading {
	margin: 8px 0 0;
	font-size: 20px;
	line-height: 1.15;
	color: var(--hwsdf-red-dark);
}

.hwsdf-html {
	font-size: 15px;
	line-height: 1.7;
	color: var(--hwsdf-muted);
	max-width: 74ch;
}

.hwsdf-html p:first-child {
	margin-top: 0;
}

.hwsdf-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	align-items: center;
}

.hwsdf-submit {
	cursor: pointer;
}

.hwsdf-notice {
	border-radius: 18px;
	padding: 20px 24px;
	margin: 0 0 24px;
	font-size: 15px;
	line-height: 1.65;
}

.hwsdf-notice p:first-child {
	margin-top: 0;
}

.hwsdf-notice p:last-child {
	margin-bottom: 0;
}

.hwsdf-notice-success {
	background: var(--hwsdf-soft);
	color: var(--hwsdf-red-dark);
	font-weight: 700;
}

.hwsdf-notice-error {
	background: #fff3f3;
	border: 1px solid rgba(139, 17, 24, 0.3);
	color: #8b1118;
	font-weight: 700;
}

.hwsdf-notice-error ul {
	margin: 8px 0 0;
	padding-left: 20px;
}

.hwsdf-notice-error a {
	color: #8b1118;
}

.hwsdf-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 1200px) {
	.hwsdf-w-third,
	.hwsdf-w-two-thirds {
		grid-column: span 3;
	}
}

@media (max-width: 720px) {
	.hwsdf-form {
		padding: 24px;
		border-radius: 18px;
	}

	.hwsdf-grid > .hwsdf-field {
		grid-column: span 6;
	}

	.hwsdf-submit {
		width: 100%;
		justify-content: center;
	}
}


/* --- Success screen (Phase 3) ------------------------------------------ */

.hwsdf-success {
	border-left: 3px solid var(--red, #0088b0);
	background: var(--soft, #f6f5f4);
	padding: 22px 24px;
	max-width: 62ch;
}

.hwsdf-success:focus {
	outline: 2px solid var(--red, #0088b0);
	outline-offset: 3px;
}

.hwsdf-success-head {
	margin: 0 0 8px;
	font-size: 1.15rem;
	font-weight: 700;
}

.hwsdf-success-tick {
	color: var(--red, #0088b0);
}

.hwsdf-success p {
	margin: 0 0 10px;
}

.hwsdf-success-ref {
	font-weight: 600;
}

.hwsdf-success-actions {
	margin-top: 16px;
}

.hwsdf-download {
	display: inline-block;
}

.hwsdf-success-ready {
	font-weight: 600;
}
