/* 基本樣式 */
body {
	margin: 0;
	font-family: "Microsoft JhengHei", Helvetica, Arial, sans-serif;
}

.container_form {
	max-width: 800px;
	min-height: 400px;
	padding: 20px;
	margin: auto;
}

h2 {
	font-size: 32px;
	text-align: center;
	color: #b8345a;
	padding: 30px 0;
	margin: 0;
}

.titleword {
	margin-top: 30px;
	margin-bottom: 10px;
	padding-top: 5px;
	text-align: center;
	display: table;
	margin: 10px auto;
}
.titleword h1 {
	font-size: 36px;
	font-weight: 900;
	color: #b8345a;
	line-height: 1.4;
	padding: 0 30px;
}
.titleword .pink_hr {
	border: 0;
	border-top: 2px solid #b8345a;
	margin-top: 3px;
	text-align: center;
}

h3 {
	font-size: 21px;
	padding: 10px 0;
	margin: 30px 0;
	text-align: center;
	border-bottom: 2px solid #b8345a;
	color: #b8345a;
	background: linear-gradient(to bottom, #fef6f8, #ffffff);
}


.form-group {
	display: flex;
	flex-wrap: wrap;
	margin-bottom: 30px;
}

.form-label {
	width: 100%;
	font-weight: bold;
	margin-bottom: 5px;
}
.form-label.required::after {
	content: " ＊";
	color: #dc3545;
	font-weight: bold;
}

.form-input {
	flex: auto;
	width: 100%;
	padding: 8px;
	border-radius: 5px;
	border: 1px solid #ccc;
	font-size: 16px;
}

.hidden {
	display: none;
}

/* ---- RWD 設計 ---- */
.form-row {
	display: flex;
	gap: 30px;
}
@media (max-width: 600px) {
	.form-row {
		gap: 0;
	}
}

.form-row .form-group {
	width: 50%;
}
@media (max-width: 600px) {
	.form-row .form-group {
		width: 100%;
	}
}

/* 移動端變單欄 */
@media (max-width: 600px) {
	.form-row {
		flex-direction: column;
	}
}

/* 提交按鈕 */
button {
	width: 100%;
	padding: 15px;
	margin-bottom: 60px;
	background-color: #b8345a;
	border: none;
	color: white;
	font-size: 18px;
	border-radius: 5px;
	cursor: pointer;
}
button:hover {
	background-color: #b8345a;
}

/* 提交中按鈕狀態 */
button.submitting {
	background-color: #b8345a;
	opacity: 0.8;
	cursor: wait;
	position: relative;
}

button.submitting::after {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #fff;
	animation: spin 1s infinite linear;
	margin-left: 10px;
	vertical-align: middle;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* 禁用狀態 */
button:disabled {
	background-color: #ccc;
	cursor: not-allowed;
}

/* Choices.js 樣式調整 */
.choices {
	width: 100%;
}
.choices__list--single {
	padding: 0;
}

.choices[data-type*="select-one"] .choices__inner {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	background-color: #fff;
	border: 1px solid #ccc;
	padding: 0;
	border-radius: 5px;
	font-size: 16px;
	min-height: 36px;
}
.choices__placeholder,
.choices__list--single .choices__item {
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 8px 28px 8px 8px;
	box-sizing: border-box;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
	background-color: #1967d2;
	color: #fff;
}

/* Choices.js 下拉選單樣式 */
.choices__list--dropdown {
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 4px;
	background-color: #fff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
	margin-top: 4px;
}

/* 讓單選選項橫向排列 */
.form-radio {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
}

/* 讓多選選項橫向排列 */
.form-checkbox {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	border: 2px solid transparent;
	border-radius: 5px;
	padding: 5px;
	transition: all 0.3s ease;
}

/* 基本按鈕樣式 */
.form-checkbox label {
	display: flex;
	padding: 15px;
	background: #f5f5f5;
	border-radius: 5px;
	font-size: 15px;
	cursor: pointer;
	transition: all 0.3s ease-in-out;
	min-width: 180px;
	user-select: none;
	flex: 1;
	justify-content: center;
	align-items: center;
	word-break: break-word;
	text-align: center;
}

/* 隱藏 checkbox (但不影響可選中) */
.form-checkbox input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

/* 選中時，標籤變色變字體 */
.form-checkbox input[type="checkbox"]:hover + label {
	background: #999;
	color: #fff;
}
.form-checkbox input[type="checkbox"]:checked + label {
	background: #b8345a;
	color: #fff;
}

/* 讓「其他」輸入框默認隱藏 */
.hidden {
	display: none;
}

/* 當「其他」輸入框顯示時的邊距 */
#rank_other.form-input,
#job_other.form-input {
	margin: 2px 0 0;
}

/* CSS for form validation */
.error,
input.error,
select.error,
textarea.error {
	border: 2px solid red;
}

/* 多選框錯誤樣式優化 */
.form-checkbox.error {
	border: 2px solid red;
	border-radius: 5px;
	padding: 5px;
	background-color: rgba(255, 0, 0, 0.05);
}

/* 當輸入有值時清除錯誤樣式的過渡效果 */
input:not(.error),
select:not(.error),
textarea:not(.error),
.form-checkbox:not(.error) {
	transition: border-color 0.3s ease;
}

.form-checkbox-item {
	display: flex;
}

/* 一般民眾選項預設隱藏 */
.public-option {
	display: none;
}

/* 確保隱藏的選項不會影響排版 */
.form-checkbox input[type="checkbox"][style*="display: none"] + label,
.form-checkbox label[style*="display: none"] {
	display: none !important;
}

/* 預設隱藏所有特定類型選項 */
.business-option,
.public-option {
	display: none;
}

/* 控制選項顯示與隱藏 */
.form-checkbox input[type="checkbox"][style*="display: none"] + label,
.form-checkbox label[style*="display: none"] {
	display: none !important;
}

.form-checkbox input[type="checkbox"]:not([style*="display: none"]) + label {
	display: flex;
}

/* 選項顯示控制 */
.business-option,
.public-option {
	/* 改用 display: none 確保完全隱藏 */
	display: none !important;
}

/* 當選項應該顯示時的樣式 */
.business-option.show,
.public-option.show {
	display: flex !important;
}

/* 確保創業需求選項的顯示控制 */
#startup,
label[for="startup"] {
	display: none !important;
}

#startup.show,
label[for="startup"].show {
	display: flex !important;
}

/* 錯誤狀態樣式 */
.error {
	border-color: #dc3545 !important;
}

/* 清理後效果 */
.sanitized {
	animation: sanitizedFlash 1s ease-out;
}

/* 動畫效果 */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes sanitizedFlash {
	0% {
		background-color: rgba(76, 175, 80, 0.3);
	}
	100% {
		background-color: transparent;
	}
}
