/**
 * バリデーション用のスタイル
 */

/* エラー状態のフィールド */
.error {
	border-color: #dc3545 !important;
	box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
	background-color: #fff5f5 !important;
}

/* エラーメッセージ */
.validation-error-message {
	color: #dc3545;
	font-size: 10px;
	margin-top: 0.25rem;
	display: block;
	font-weight: 500;
}

/* エラーサマリーブロック */
.validation-error-summary {
	top: 20px;
	z-index: 1000;
	margin-bottom: 20px;
	border: 2px solid rgb(220, 53, 69);
	background: rgb(248, 215, 218);
	color: rgb(114, 28, 36);
	padding: 15px;
	border-radius: 8px;
	font-weight: bold;
}

/* フォーム全体のエラー */
.form-errors {
	background-color: #f8d7da;
	border: 1px solid #f5c6cb;
	border-radius: 0.375rem;
	padding: 1rem;
	margin-bottom: 1.5rem;
}

.form-error {
	color: #721c24;
	margin-bottom: 0.5rem;
	font-weight: 500;
}

.form-error:last-child {
	margin-bottom: 0;
}

/* 情報メッセージ */
.validation-info {
	position: fixed;
	top: 20px;
	right: 20px;
	background-color: #d1ecf1;
	border: 1px solid #bee5eb;
	border-radius: 0.375rem;
	padding: 1rem;
	color: #0c5460;
	font-weight: 500;
	z-index: 1050;
	max-width: 300px;
	box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
	animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

/* 成功状態のフィールド */
.valid {
	border-color: #28a745 !important;
	box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
	background-color: #f8fff9 !important;
}

/* 必須項目のマーク */
.required::after {
	content: " *";
	color: #dc3545;
	font-weight: bold;
}

/* フィールドグループ */
.field-group {
	margin-bottom: 1.5rem;
	position: relative;
}

.field-group label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: #495057;
}

/* パーツごとのスタイル */
.part-section {
	border: 1px solid #e9ecef;
	border-radius: 0.375rem;
	padding: 1.5rem;
	margin-bottom: 2rem;
	background-color: #f8f9fa;
}

.part-section.required {
	border-left: 4px solid #007bff;
}

.part-section.optional {
	border-left: 4px solid #6c757d;
}

.part-title {
	font-size: 1.125rem;
	font-weight: 700;
	margin-bottom: 1rem;
	color: #212529;
}

.part-title.required::before {
	content: "必須 ";
	background-color: #dc3545;
	color: white;
	font-size: 0.75rem;
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	margin-right: 0.5rem;
	font-weight: 600;
}

.part-title.optional::before {
	content: "任意 ";
	background-color: #6c757d;
	color: white;
	font-size: 0.75rem;
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	margin-right: 0.5rem;
	font-weight: 600;
}

/* 選択フィールドのスタイル */
.select-field {
	margin-bottom: 1rem;
}

.select-field select {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid #ced4da;
	border-radius: 0.375rem;
	font-size: 1rem;
	transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select-field select:focus {
	outline: none;
	border-color: #80bdff;
	box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* チェックボックススタイル */
.checkbox-group {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.checkbox-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
	width: 1.25rem;
	height: 1.25rem;
	accent-color: #007bff;
}

/* 数量入力フィールド */
.quantity-field {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.quantity-field input {
	width: 120px;
	padding: 0.75rem;
	border: 1px solid #ced4da;
	border-radius: 0.375rem;
	text-align: right;
	font-size: 1rem;
}

.quantity-unit {
	font-weight: 600;
	color: #6c757d;
}

/* 日付入力フィールド */
.date-field input {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid #ced4da;
	border-radius: 0.375rem;
	font-size: 1rem;
}

/* ページ数入力フィールド（製本の場合） */
.page-count-field {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.page-count-field input {
	width: 100px;
	padding: 0.75rem;
	border: 1px solid #ced4da;
	border-radius: 0.375rem;
	text-align: right;
	font-size: 1rem;
}

/* バリデーション進行状況 */
.validation-progress {
	margin-bottom: 2rem;
}

.progress-bar {
	background-color: #e9ecef;
	border-radius: 0.5rem;
	height: 8px;
	overflow: hidden;
}

.progress-fill {
	background-color: #007bff;
	height: 100%;
	transition: width 0.3s ease;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
	.part-section {
		padding: 1rem;
		margin-bottom: 1.5rem;
	}

	.checkbox-group {
		flex-direction: column;
		gap: 0.75rem;
	}

	.quantity-field,
	.page-count-field {
		flex-direction: column;
		align-items: flex-start;
	}

	.validation-info {
		position: fixed;
		top: 10px;
		left: 10px;
		right: 10px;
		max-width: none;
	}
}

/* アニメーション */
.field-group {
	transition: all 0.3s ease;
}

.field-group.show {
	opacity: 1;
	transform: translateY(0);
}

.field-group.hide {
	opacity: 0;
	transform: translateY(-10px);
	margin-bottom: 0;
	overflow: hidden;
	max-height: 0;
}

/* ツールチップ */
.tooltip {
	position: relative;
	display: inline-block;
	cursor: help;
}

.tooltip .tooltiptext {
	visibility: hidden;
	width: 200px;
	background-color: #555;
	color: white;
	text-align: center;
	border-radius: 6px;
	padding: 5px;
	position: absolute;
	z-index: 1;
	bottom: 125%;
	left: 50%;
	margin-left: -100px;
	opacity: 0;
	transition: opacity 0.3s;
	font-size: 0.875rem;
}

.tooltip:hover .tooltiptext {
	visibility: visible;
	opacity: 1;
}
