/* Declaration Form - scoped under .declf so it doesn't clash with the theme. */
.declf {
	--declf-accent: #1f4e79;
	--declf-accent-ink: #fff;
	--declf-border: #cfd6de;
	--declf-bg: #fff;
	--declf-soft: #f5f7fa;
	--declf-muted: #5b6673;
	--declf-error: #b3261e;
	--declf-ok: #1e6b3a;
	max-width: 760px;
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.5;
	color: inherit;
}
.declf *, .declf *::before, .declf *::after { box-sizing: border-box; }
.declf [hidden] { display: none !important; }

.declf .declf-card {
	border: 1px solid var(--declf-border);
	border-radius: 10px;
	background: var(--declf-bg);
	padding: 20px 22px 18px;
	margin: 0 0 20px;
	min-width: 0;
}
.declf legend {
	font-weight: 700;
	font-size: 1.1em;
	padding: 0 6px;
	margin-left: -6px;
}
.declf .declf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
@media (max-width: 600px) {
	.declf .declf-grid { grid-template-columns: 1fr; }
	.declf .declf-card { padding: 16px 14px 14px; }
}
.declf .declf-field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 12px; }
.declf .declf-grid .declf-field { margin: 0; }
.declf label, .declf .declf-label { font-weight: 600; margin: 0; }
.declf b { color: var(--declf-error); font-weight: 700; }
.declf .declf-muted { color: var(--declf-muted); font-weight: 400; }
.declf .declf-small { font-size: 0.875em; margin: 10px 0 0; }

.declf input[type="text"], .declf input[type="email"], .declf input[type="tel"], .declf input[type="number"], .declf input:not([type]),
.declf select, .declf textarea {
	width: 100%;
	max-width: none;
	font: inherit;
	color: #1a1a1a;
	background: #fff;
	border: 1px solid #9aa5b1;
	border-radius: 6px;
	padding: 10px 12px;
	margin: 0;
	min-height: 44px;
	box-shadow: none;
}
.declf input:focus-visible, .declf select:focus-visible, .declf textarea:focus-visible, .declf button:focus-visible, .declf a:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--declf-accent) 45%, transparent);
	outline-offset: 1px;
	border-color: var(--declf-accent);
}

.declf .declf-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-weight: 400;
	padding: 8px 10px;
	margin: 0 -10px 2px;
	border-radius: 6px;
	cursor: pointer;
}
.declf .declf-check:hover { background: var(--declf-soft); }
.declf .declf-check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--declf-accent); }
.declf .declf-group { margin-top: 6px; }
.declf .declf-group .declf-label { margin-bottom: 6px; }

.declf .declf-other { margin: 4px 0 6px 30px; }
.declf .declf-other label { display: block; margin-bottom: 5px; }
.declf .declf-prefix { display: flex; align-items: stretch; }
.declf .declf-prefix span {
	display: flex; align-items: center; padding: 0 12px;
	border: 1px solid #9aa5b1; border-right: 0; border-radius: 6px 0 0 6px;
	background: var(--declf-soft); font-weight: 600;
}
.declf .declf-prefix textarea { border-radius: 0 6px 6px 0; resize: vertical; }

/* Document preview */
.declf .declf-paper {
	margin-top: 12px;
	background: #fff;
	color: #111;
	border: 1px solid var(--declf-border);
	box-shadow: 0 1px 3px rgba(0,0,0,.08);
	padding: 32px 36px;
	font-family: "Times New Roman", Times, serif;
	font-size: 15px;
	line-height: 1.35;
	max-height: 520px;
	overflow: auto;
}
@media (max-width: 600px) { .declf .declf-paper { padding: 20px 16px; font-size: 14px; } }
.declf .declf-paper p { text-indent: 2.5em; text-align: justify; margin: 0 0 1em; }
.declf .declf-paper strong { font-weight: 700; }
.declf .declf-c { text-align: center; font-weight: 700; margin-bottom: 1em; }
.declf .declf-title { margin: 1.2em 0 1em; }
.declf .declf-caption { display: flex; gap: 16px; justify-content: space-between; margin-bottom: 1em; border-bottom: 1px solid #111; padding-bottom: .6em; }
.declf .declf-caption > div:first-child { display: flex; flex-direction: column; gap: .5em; }
.declf .declf-caption > div:last-child { align-self: center; white-space: nowrap; }
@media (max-width: 600px) { .declf .declf-caption { flex-direction: column; } }
.declf .declf-ind { padding-left: 2.5em; }
.declf .declf-sigblock { margin: 1.5em 0 0 50%; }
.declf .declf-sigspace { color: #888; font-style: italic; border-bottom: 1px solid #111; padding-bottom: 2px; margin-bottom: 2px; }
@media (max-width: 600px) { .declf .declf-sigblock { margin-left: 25%; } }

/* Signature pad */
.declf .declf-sigwrap {
	position: relative;
	margin-top: 6px;
	border: 1px dashed #9aa5b1;
	border-radius: 8px;
	background: #fff;
	height: 180px;
}
.declf .declf-sig { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; border-radius: 8px; z-index: 2; }
.declf .declf-sigline { position: absolute; left: 24px; right: 24px; bottom: 44px; border-bottom: 1px solid #c3cad2; z-index: 1; }
.declf .declf-sighint { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #8a939d; font-size: .9em; z-index: 1; pointer-events: none; }
.declf .declf-sigwrap.has-ink .declf-sighint { visibility: hidden; }
.declf .declf-sigactions { display: flex; justify-content: flex-end; margin: 6px 0 8px; }
.declf .declf-link {
	background: none; border: 0; padding: 6px 4px; color: var(--declf-accent);
	text-decoration: underline; font: inherit; cursor: pointer; min-height: 0;
}
.declf .declf-consent { margin-top: 4px; }

/* Errors and states */
.declf .declf-invalid input, .declf .declf-invalid select, .declf .declf-invalid textarea { border-color: var(--declf-error); }
.declf .declf-check.declf-invalid, .declf .declf-group.declf-invalid { background: #fdecea; }
.declf .declf-sigwrap.declf-invalid { border-color: var(--declf-error); border-style: solid; }
.declf .declf-errors {
	border: 1px solid var(--declf-error);
	background: #fdecea;
	color: #5f1410;
	border-radius: 8px;
	padding: 12px 16px;
	margin: 0 0 16px;
}
.declf .declf-errors ul { margin: 6px 0 0 1.2em; padding: 0; }
.declf .declf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.declf .declf-submit {
	display: inline-block;
	width: 100%;
	background: var(--declf-accent);
	color: var(--declf-accent-ink);
	border: 0;
	border-radius: 8px;
	padding: 14px 20px;
	font: inherit;
	font-weight: 700;
	font-size: 1.05em;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}
.declf .declf-submit:hover { filter: brightness(1.1); color: var(--declf-accent-ink); }
.declf .declf-submit:disabled { opacity: .65; cursor: progress; }
.declf .declf-download { width: auto; }
.declf .declf-done:focus { outline: none; }
.declf .declf-success { border-color: var(--declf-ok); border-left-width: 6px; }
.declf .declf-warn { border-color: #b36b00; border-left-width: 6px; }
.declf .declf-done h3 { margin: 0 0 8px; font-size: 1.2em; }

/* v1.1 additions */
.declf .declf-grid3 { grid-template-columns: 1.3fr 1fr 1fr; }
@media (max-width: 600px) { .declf .declf-grid3 { grid-template-columns: 1fr 1fr; } .declf .declf-grid3 select:first-child { grid-column: 1 / -1; } }
.declf .declf-date { margin-top: 14px; }
.declf .declf-date .declf-label { margin-bottom: 2px; }
.declf .declf-date .declf-muted { display: block; font-size: .875em; }
.declf .declf-hint { font-size: .8em; }
.declf .declf-card > .declf-grid { margin-top: 14px; }
.declf .declf-confirm-label { margin-top: 18px; margin-bottom: 4px; }
.declf .declf-radio input { border-radius: 50%; }
.declf .declf-field.declf-invalid select, .declf .declf-date.declf-invalid select { border-color: var(--declf-error); }
.declf .declf-date.declf-invalid, .declf .declf-group.declf-invalid { background: #fdecea; border-radius: 6px; padding: 6px 10px; margin-left: -10px; margin-right: -10px; }
.declf .declf-desig-note { margin: 0 0 8px; }
.declf .declf-paper ol.declf-list { margin: 0 0 1em 3.2em; padding: 0 0 0 1.2em; }
.declf .declf-paper ol.declf-list li { margin: 0; padding-left: .2em; }
.declf .declf-paper .declf-placeholder { color: #888; font-style: italic; }
