.dct-teacher-form-wrap {
	--dct-navy: #103c86;
	--dct-navy-dark: #172033;
	--dct-navy-soft: #eef3fb;
	--dct-red: #e52420;
	--dct-red-dark: #bd1916;
	--dct-yellow: #f4bd3d;
	--dct-ink: #1e1e1e;
	--dct-muted: #65718a;
	--dct-line: #dce3ee;
	--dct-soft: #f7f9fc;
	box-sizing: border-box;
	max-width: 980px;
	margin: 44px auto 64px;
	color: var(--dct-ink);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

.dct-teacher-form-wrap *,
.dct-teacher-form-wrap *::before,
.dct-teacher-form-wrap *::after { box-sizing: border-box; }

.dct-form-header {
	position: relative;
	overflow: hidden;
	padding: 46px 50px 44px;
	border-radius: 24px 24px 0 0;
	background:
		radial-gradient(circle at 90% 5%, rgba(255, 255, 255, .18), transparent 34%),
		linear-gradient(135deg, #102c65 0%, var(--dct-navy) 62%, #315a9f 100%);
	color: #fff;
}

.dct-form-header::after {
	position: absolute;
	right: -72px;
	bottom: -82px;
	width: 260px;
	height: 150px;
	border: 24px solid rgba(244, 189, 61, .2);
	border-radius: 50%;
	content: "";
}

.dct-form-header h1 {
	position: relative;
	z-index: 1;
	margin: 8px 0 12px;
	color: #fff;
	font-size: clamp(32px, 5vw, 50px);
	font-weight: 900;
	letter-spacing: -.035em;
	line-height: 1.16;
}

.dct-form-header p { position: relative; z-index: 1; margin: 0; max-width: 760px; line-height: 1.75; opacity: .95; }
.dct-eyebrow { color: var(--dct-yellow); font-size: 13px; font-weight: 800; letter-spacing: .14em; }
.dct-header-copy { font-size: 16px; }

.dct-header-meta {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-top: 24px;
}

.dct-header-meta span {
	padding: 7px 12px;
	border: 1px solid rgba(255, 255, 255, .36);
	border-radius: 999px;
	background: rgba(10, 31, 70, .28);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.dct-onboarding-assignment {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	border-right: 1px solid var(--dct-line);
	border-left: 1px solid var(--dct-line);
	background: var(--dct-line);
}

.dct-onboarding-assignment > div { display: grid; gap: 5px; min-height: 78px; padding: 18px 22px; background: #f5f9f7; }
.dct-onboarding-assignment small { color: #61706a; font-size: 12px; font-weight: 750; }
.dct-onboarding-assignment strong { color: #155e50; font-size: 15px; line-height: 1.45; }

.dct-form-progress {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0;
	padding: 0 34px;
	border: 1px solid var(--dct-line);
	border-top: 0;
	background: #fff;
}
.dct-form-progress.is-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.dct-form-progress span {
	display: flex;
	gap: 9px;
	align-items: center;
	justify-content: center;
	min-height: 66px;
	padding: 12px 8px;
	color: var(--dct-muted);
	font-size: 13px;
	font-weight: 700;
}

.dct-form-progress strong { color: var(--dct-navy); font-size: 12px; letter-spacing: .08em; }
.dct-form-progress span + span { border-left: 1px solid var(--dct-line); }

.dct-teacher-form {
	padding: 0 50px 48px;
	border: 1px solid var(--dct-line);
	border-top: 0;
	border-radius: 0 0 24px 24px;
	background: #fff;
	box-shadow: 0 24px 60px rgba(16, 60, 134, .1);
}

.dct-form-intro {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	justify-content: space-between;
	padding: 24px 0 22px;
	border-bottom: 1px solid var(--dct-line);
	color: #46536a;
	font-size: 14px;
	line-height: 1.7;
}

.dct-form-intro p { margin: 0; }
.dct-required-note { flex: 0 0 auto; color: var(--dct-red); font-weight: 750; }

.dct-form-error-summary {
	position: sticky;
	top: 16px;
	z-index: 10;
	margin: 20px 0 0;
	padding: 16px 18px;
	border: 1px solid #e1a2a2;
	border-left: 5px solid var(--dct-red);
	border-radius: 12px;
	background: #fff2f2;
	box-shadow: 0 10px 28px rgba(132, 40, 40, .13);
	color: #842828;
	line-height: 1.65;
}
.dct-form-error-summary[hidden] { display: none; }
.dct-form-error-summary strong { display: block; margin-bottom: 4px; }
.dct-form-error-summary ul { margin: 6px 0 0 20px; }
.dct-form-error-summary li { margin: 2px 0; }

.dct-form-section { padding: 36px 0; border-bottom: 1px solid var(--dct-line); }
.dct-section-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.dct-section-title > span { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--dct-yellow); color: var(--dct-navy-dark); font-weight: 900; }
.dct-section-title h2 { margin: 2px 0 4px; color: var(--dct-navy-dark); font-size: 22px; font-weight: 850; letter-spacing: -.015em; }
.dct-section-title p { margin: 0; color: var(--dct-muted); }

.dct-field-grid, .dct-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dct-field, .dct-upload-field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; font-size: 15px; font-weight: 650; }
.dct-field-full { width: 100%; }
.dct-field input, .dct-field textarea, .dct-upload-field input {
	box-sizing: border-box;
	width: 100%;
	min-height: 50px;
	padding: 12px 14px;
	border: 1px solid #b9c4d5;
	border-radius: 12px;
	background: #fff;
	color: var(--dct-ink);
	font: inherit;
	font-weight: 400;
	transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.dct-field input:hover, .dct-field textarea:hover { border-color: #8497b4; }
.dct-field input:focus, .dct-field textarea:focus, .dct-upload-field input:focus { outline: 3px solid rgba(16, 60, 134, .13); border-color: var(--dct-navy); }
.dct-field.is-invalid input, .dct-field.is-invalid textarea, .dct-upload-field.is-invalid input { border-color: var(--dct-red); background: #fff8f8; box-shadow: 0 0 0 3px rgba(229, 36, 32, .08); }
.dct-consent.is-invalid { padding: 12px; border: 1px solid #e1a2a2; border-radius: 10px; background: #fff8f8; }
.dct-consent.is-invalid { flex-wrap: wrap; }
.dct-consent .dct-field-error { flex-basis: 100%; }
.dct-field-error { color: #a3211e !important; font-size: 13px; font-weight: 700 !important; }
.dct-field textarea { resize: vertical; }
.dct-field small, .dct-upload-field small { color: var(--dct-muted); font-weight: 400; }
.dct-upload-field { min-height: 126px; padding: 19px; border: 1px dashed #8ea3c3; border-radius: 16px; background: var(--dct-navy-soft); }
.dct-upload-label { color: var(--dct-navy-dark); }
.dct-upload-existing { color: var(--dct-navy) !important; font-weight: 700 !important; }

.dct-contract-section { --contract-green: #176b5b; }
.dct-contract-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin-bottom: 18px; border: 1px solid #cad8e8; border-radius: 14px; background: #cad8e8; }
.dct-contract-summary > div { display: grid; gap: 4px; padding: 16px 18px; background: #f4f8ff; }
.dct-contract-summary small { color: #68748a; font-size: 12px; font-weight: 700; }
.dct-contract-summary strong { color: #173f83; }
.dct-contract-assignments { display: grid; gap: 10px; padding: 20px; border: 1px solid #c9d9d2; border-radius: 16px; background: #f3faf7; }
.dct-contract-assignments h3, .dct-contract-document h3, .dct-signature-panel h3 { margin: 0; color: var(--dct-navy-dark); font-size: 18px; }
.dct-contract-rule { margin: 0 0 5px; color: #617069; font-size: 13px; }
.dct-contract-missing { padding: 12px; border: 1px solid #d99; border-radius: 9px; background: #fff1f1; color: #842828; font-weight: 700; }
.dct-contract-assignments article { display: grid; grid-template-columns: 1.05fr 1.4fr .95fr; gap: 14px; align-items: center; padding: 14px 15px; border: 1px solid #d8e3de; border-radius: 12px; background: #fff; }
.dct-contract-assignments article > div { display: grid; gap: 3px; min-width: 0; }
.dct-contract-assignments article span, .dct-contract-assignments article small { color: #68736f; font-size: 12px; }
.dct-contract-assignments article strong { color: #26323f; line-height: 1.45; }
.dct-contract-document { margin-top: 18px; padding: 20px; border: 1px solid #d9e0ea; border-radius: 16px; background: #f7f9fc; }
.dct-contract-document-heading { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 15px; }
.dct-contract-document-heading p { margin: 4px 0 0; color: var(--dct-muted); font-size: 13px; }
.dct-contract-document-heading a { flex: 0 0 auto; padding: 9px 13px; border: 1px solid #8ea8ce; border-radius: 9px; background: #fff; color: var(--dct-navy); font-weight: 750; text-decoration: none; }
.dct-contract-page-list { display: grid; gap: 16px; }
.dct-contract-page-list figure { margin: 0; overflow: hidden; border: 1px solid #cbd3df; border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(23, 32, 51, .07); }
.dct-contract-page-list img, .dct-contract-page-list canvas { display: block; width: 100%; height: auto; }
.dct-contract-page-list figcaption { padding: 8px 12px; border-top: 1px solid #dbe1ea; color: #65718a; font-size: 12px; text-align: center; }
.dct-signature-panel { position: relative; margin-top: 18px; padding: 20px; border: 1px solid #b9c9df; border-radius: 16px; background: #fff; }
.dct-signature-panel.is-invalid { border-color: var(--dct-red); background: #fff8f8; box-shadow: 0 0 0 3px rgba(229, 36, 32, .08); }
.dct-signature-validation { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.dct-signature-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 13px; }
.dct-signature-heading p { margin: 4px 0 0; color: var(--dct-muted); font-size: 13px; }
.dct-signature-heading button { padding: 8px 12px; border: 1px solid #93a7c3; border-radius: 9px; background: #fff; color: var(--dct-navy); font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; }
.dct-signature-canvas-wrap { position: relative; overflow: hidden; min-height: 170px; border: 2px dashed #8aa0be; border-radius: 12px; background: #fff; }
.dct-signature-canvas-wrap:focus-within { border-color: var(--dct-navy); box-shadow: 0 0 0 3px rgba(16, 60, 134, .1); }
.dct-signature-canvas-wrap canvas { position: relative; z-index: 2; display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; }
.dct-signature-canvas-wrap > span { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; color: #95a0b0; font-weight: 650; pointer-events: none; }
.dct-signature-canvas-wrap > span[hidden] { display: none; }
.dct-signature-status { margin: 9px 0 0; color: #7b8798; font-size: 13px; }
.dct-signature-status.is-complete { color: var(--contract-green); font-weight: 750; }
.dct-contract-consent { padding: 17px 18px; border: 1px solid #c9d9d2; border-radius: 12px; background: #f3faf7; }
.dct-contract-signed-status { display: grid; gap: 5px; padding: 22px; border: 1px solid #afd1c6; border-radius: 15px; background: #eff9f5; }
.dct-contract-signed-status strong { color: #176b5b; font-size: 19px; }
.dct-contract-signed-status span { color: #53665f; }
.dct-contract-signed-status p { margin: 5px 0 0; color: #617069; }

.dct-privacy-copy { padding: 22px 24px; border-left: 4px solid var(--dct-navy); border-radius: 14px; background: var(--dct-navy-soft); color: #46536a; font-size: 14px; line-height: 1.75; }
.dct-privacy-copy p { margin: 0 0 8px; }
.dct-consent { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; font-weight: 650; line-height: 1.65; }
.dct-consent input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 3px; accent-color: var(--dct-navy); }

.dct-form-actions { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding-top: 30px; }
.dct-form-actions p { margin: 0; color: var(--dct-muted); font-size: 14px; }
.dct-submit-button { min-height: 52px; padding: 14px 28px; border: 0; border-radius: 999px; background: var(--dct-red); color: #fff; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 9px 20px rgba(229, 36, 32, .22); transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.dct-submit-button:hover { background: var(--dct-red-dark); box-shadow: 0 12px 24px rgba(229, 36, 32, .28); transform: translateY(-1px); }
.dct-submit-button:focus-visible { outline: 3px solid rgba(229, 36, 32, .2); outline-offset: 3px; }

.dct-form-notice { margin: 18px 0; padding: 18px 20px; border-radius: 12px; line-height: 1.65; }
.dct-form-notice-success { border: 1px solid #a7c4ec; background: #eff6ff; color: #123e79; }
.dct-form-notice-warning { border: 1px solid #efcf82; background: #fff8e5; color: #735617; }
.dct-form-notice-error { border: 1px solid #e7b3b3; background: #fff2f2; color: #842828; }
.dct-honeypot { position: absolute !important; left: -99999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

@media (max-width: 860px) {
	.dct-form-progress { padding: 0 18px; }
	.dct-form-progress span { flex-direction: column; gap: 2px; text-align: center; }
}

@media (max-width: 700px) {
	.dct-teacher-form-wrap { margin: 18px auto 36px; }
	.dct-form-header { padding: 34px 24px 32px; border-radius: 18px 18px 0 0; }
	.dct-form-header h1 { font-size: clamp(30px, 10vw, 40px); }
	.dct-header-meta { gap: 7px; }
	.dct-header-meta span { padding: 6px 10px; font-size: 12px; }
	.dct-onboarding-assignment { grid-template-columns: 1fr; }
	.dct-onboarding-assignment > div { min-height: 0; padding: 14px 22px; }
	.dct-form-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px; }
	.dct-form-progress.is-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.dct-form-progress span { min-height: 54px; flex-direction: row; }
	.dct-form-progress span:nth-child(3) { border-left: 0; border-top: 1px solid var(--dct-line); }
	.dct-form-progress span:nth-child(4) { border-top: 1px solid var(--dct-line); }
	.dct-form-progress.is-five span:nth-child(5) { grid-column: 1 / -1; border-top: 1px solid var(--dct-line); border-left: 0; }
	.dct-teacher-form { padding-right: 22px; padding-left: 22px; border-radius: 0 0 18px 18px; }
	.dct-form-intro { flex-direction: column; gap: 6px; }
	.dct-field-grid, .dct-upload-grid { grid-template-columns: 1fr; gap: 0; }
	.dct-contract-summary, .dct-contract-assignments article { grid-template-columns: 1fr; }
	.dct-contract-document, .dct-signature-panel { padding: 15px; }
	.dct-contract-document-heading, .dct-signature-heading { align-items: stretch; flex-direction: column; }
	.dct-contract-document-heading a, .dct-signature-heading button { width: 100%; text-align: center; }
	.dct-signature-canvas-wrap, .dct-signature-canvas-wrap canvas { min-height: 150px; height: 150px; }
	.dct-form-actions { align-items: stretch; flex-direction: column; }
	.dct-submit-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.dct-submit-button,
	.dct-field input,
	.dct-field textarea { transition: none; }
}
