/* WP Shed Form - v0.6.0 */

.shedform-form-wrap {
	max-width: 800px;
	margin: 0 auto;
	padding: 0;
	overflow-x: hidden;
}

/* 列構成グリッド */
.shedform-cols { display: grid; gap: 8px; }
.shedform-cols-full        { grid-template-columns: 1fr; }
.shedform-cols-half        { grid-template-columns: 1fr 1fr; }
.shedform-cols-third       { grid-template-columns: 1fr 1fr 1fr; }
.shedform-cols-quarter     { grid-template-columns: 1fr 1fr 1fr 1fr; }
.shedform-cols-two-one     { grid-template-columns: 2fr 1fr; }
.shedform-cols-one-two     { grid-template-columns: 1fr 2fr; }
.shedform-cols-one-one-two { grid-template-columns: 1fr 1fr 2fr; }
.shedform-cols-three-one   { grid-template-columns: 3fr 1fr; }
.shedform-cols-one-three   { grid-template-columns: 1fr 3fr; }

/* テーブル型レイアウト */
.shedform-form-table {
	width: 100%;
	border-collapse: collapse;
}

.shedform-form-table .shedform-row > th,
.shedform-form-table .shedform-row > td {
	padding: 0.8em 1em;
	border-bottom: 1px solid #ddd;
	vertical-align: top;
}

.shedform-form-table .shedform-label-cell {
	display: table-cell;
}

.shedform-form-table .shedform-label-cell > .shedform-label-inner {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
}

.shedform-label-cell {
	font-weight: 600;
	background: #f7f8f9;
	white-space: nowrap;
	font-size: 0.95em;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}

.shedform-field-cell {
	text-align: left;
}

/* スタック型レイアウト */
.shedform-form-stacked .shedform-row {
	margin-bottom: 1.5em;
}

/* インライン型レイアウト */
.shedform-form-inline .shedform-row {
	display: flex;
	align-items: flex-start;
	margin-bottom: 1.5em;
}

.shedform-inline-label {
	font-weight: 600;
	font-size: 0.95em;
	padding-top: 0.6em;
	flex-shrink: 0;
}

.shedform-inline-field {
	flex: 1;
	min-width: 0;
}

/* DL型フォーム */
.shedform-form-dl {
	margin: 0;
	padding: 0;
}

/* 行ラッパー：borderはdt・ddに持たせる（rowには持たせない） */
.shedform-form-dl .shedform-row {
	display: flex;
}

/* ラベル列：背景を連続させるためborderをここに持つ */
.shedform-form-dl .shedform-dt {
	background: var(--shedform-label-bg, #f5f5f5);
	padding: 12px 16px;
	width: var(--shedform-label-width, 30%);
	flex-shrink: 0;
	font-weight: 500;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: 8px;
	border-bottom: 1px solid var(--shedform-border, #ddd);
	border-right: 1px solid var(--shedform-border, #ddd);
}

/* フィールド列 */
.shedform-form-dl .shedform-dd {
	padding: 12px 16px;
	flex: 1;
	min-width: 0;
	margin: 0;
	border-bottom: 1px solid var(--shedform-border, #ddd);
	display: flex;
	align-items: center;
}

/* 最初の行のみ上ボーダーを追加 */
.shedform-form-dl .shedform-row:first-child .shedform-dt,
.shedform-form-dl .shedform-row:first-child .shedform-dd {
	border-top: 1px solid var(--shedform-border, #ddd);
}

.shedform-form-dl .shedform-dd .shedform-cols {
	width: 100%;
}

/* 必須・任意バッジ */
.shedform-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	padding: 3px 6px;
	border-radius: 2px;
	margin-left: auto;
	vertical-align: middle;
	white-space: nowrap;
	flex-shrink: 0;
}

.shedform-badge-required {
	background: #e74c3c;
	color: #fff;
}

.shedform-badge-optional {
	background: #95a5a6;
	color: #fff;
}

.shedform-text-required {
	color: #e74c3c;
	font-size: 10px;
	margin-left: auto;
	white-space: nowrap;
	flex-shrink: 0;
}

.shedform-text-optional {
	color: #95a5a6;
	font-size: 10px;
	margin-left: auto;
	white-space: nowrap;
	flex-shrink: 0;
}

.shedform-asterisk {
	color: #e74c3c;
	font-weight: bold;
	font-size: 14px;
	margin-left: auto;
	flex-shrink: 0;
}

/* フィールド */
.shedform-field {
	margin-bottom: 1.5em;
}

.shedform-label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.4em;
	font-size: 0.95em;
}


.shedform-input,
.shedform-textarea {
	display: block;
	width: 100%;
	padding: 0.6em 0.8em;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1em;
	font-family: inherit;
	box-sizing: border-box;
	transition: border-color 0.2s;
}

.shedform-input:focus,
.shedform-textarea:focus {
	border-color: #2980b9;
	outline: none;
	box-shadow: 0 0 0 2px rgba(41, 128, 185, 0.15);
}

.shedform-textarea {
	resize: vertical;
	min-height: 160px;
}

/* エラー */
.shedform-has-error .shedform-input,
.shedform-has-error .shedform-textarea {
	border-color: #e74c3c;
}

/* 補足説明 */
.shedform-field-description {
	font-size: 0.8125rem;
	color: #666;
	margin: 4px 0 0;
	line-height: 1.6;
}

/* エラーメッセージ共通：赤文字のみ・背景・枠なし */
.shedform-error-msg {
	display: block;
	font-size: 0.875rem;
	color: #c0392b;
	background: none;
	border: none;
	padding: 1px 0;
	margin: 0;
}

/* 個別エラー（フィールド真下） */
.shedform-col .shedform-error-msg,
.shedform-field .shedform-error-msg {
	margin-top: 3px;
}

/* エラー表示ポジション（セクション35） */
.shedform-row-wrap {
	display: flex;
	flex-direction: column;
	width: 100%;
}

/* 行まとめエラーラッパー */
.shedform-row-errors {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 4px;
	padding: 0;
	background: none;
}

.shedform-form-table .shedform-row-errors {
	padding: 0 10px 8px 10px;
}

.shedform-form-dl .shedform-row-dl-inner {
	display: flex;
	flex: 1;
	min-width: 0;
}

.shedform-error-general {
	background: #fdf2f2;
	border: 1px solid #e74c3c;
	border-radius: 4px;
	padding: 0.8em 1em;
	margin-bottom: 1.5em;
	color: #c0392b;
	font-size: 0.9em;
}

.shedform-error-general p {
	margin: 0;
}

/* ボタン */
.shedform-actions {
	display: flex;
	gap: 1em;
	align-items: center;
	justify-content: center;
	margin-top: 2em;
}

.shedform-btn {
	display: inline-block;
	padding: 0.7em 2em;
	font-size: 1em;
	font-weight: 600;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-family: inherit;
	transition: opacity 0.2s;
	line-height: 1.4;
}

.shedform-btn:hover {
	opacity: 0.85;
}

.shedform-btn-primary {
	background: #2980b9;
	color: #fff;
}

.shedform-btn-secondary {
	background: #95a5a6;
	color: #fff;
}

/* 確認画面 */
.shedform-confirm-lead {
	font-size: 1em;
	margin-bottom: 1.5em;
}

.shedform-confirm-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1em;
}

.shedform-confirm-table th,
.shedform-confirm-table td {
	padding: 0.8em 1em;
	border-bottom: 1px solid #ddd;
	text-align: left;
	vertical-align: top;
}

.shedform-confirm-label {
	font-weight: 600;
	width: 30%;
	background: #f7f8f9;
	white-space: nowrap;
}

.shedform-confirm-value {
	word-break: break-word;
}

.shedform-action-back,
.shedform-action-submit {
	display: inline-block;
	margin: 0;
	padding: 0;
}

/* 完了画面 */
.shedform-complete-msg {
	padding: 2em 0;
	text-align: center;
}

.shedform-complete-msg p {
	margin: 0.5em 0;
	font-size: 1em;
}

.shedform-serial-number {
	margin-top: 16px;
	font-size: 1rem;
	color: #555;
}

.shedform-serial-number strong {
	font-family: monospace;
	font-size: 1.1em;
	color: #333;
	letter-spacing: 0.05em;
}

/* ラジオボタン */
.shedform-radio-group {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
}

.shedform-radio-label {
	display: flex;
	align-items: center;
	gap: 0.4em;
	cursor: pointer;
	font-size: 0.95em;
}

.shedform-radio-label input {
	margin: 0;
}

/* チェックボックスグループ */
.shedform-checkbox-group {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.shedform-checkbox-label {
	display: flex;
	align-items: center;
	gap: 0.4em;
	cursor: pointer;
	font-size: 0.95em;
}

.shedform-checkbox-input {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	cursor: pointer;
	accent-color: var(--shedform-primary, #2c3e50);
}

/* 同意フィールド */
.shedform-field-consent {
	margin: 16px 0;
	padding: 16px;
	background: var(--shedform-consent-bg, #f8f9fa);
	border: 1px solid var(--shedform-border, #ddd);
	border-radius: 4px;
}

.shedform-consent-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.6;
}

.shedform-consent-input {
	margin-top: 3px;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	cursor: pointer;
	accent-color: var(--shedform-primary, #2c3e50);
}

.shedform-consent-link {
	color: var(--shedform-link, #2980b9);
	text-decoration: underline;
}

.shedform-consent-link:hover {
	opacity: 0.8;
}

.shedform-consent-scroll-box {
	height: 150px;
	overflow-y: scroll;
	border: 1px solid var(--shedform-border, #ddd);
	border-radius: 4px;
	padding: 12px;
	margin-bottom: 8px;
	background: #fff;
	font-size: 13px;
	line-height: 1.7;
}

.shedform-consent-scroll-notice {
	font-size: 12px;
	color: var(--shedform-muted, #666);
	margin: 4px 0 10px;
}

.shedform-consent-input:disabled + .shedform-consent-text {
	color: var(--shedform-muted, #999);
}

.shedform-field-consent + .shedform-field-consent {
	margin-top: -8px;
	border-top: none;
	border-radius: 0 0 4px 4px;
}

.shedform-field-consent:has(+ .shedform-field-consent) {
	border-radius: 4px 4px 0 0;
	border-bottom: none;
}

/* 確認画面の同意表示 */
.shedform-confirm-consent {
	font-size: inherit;
	color: inherit;
}

/* select */
.shedform-field select.shedform-input {
	appearance: auto;
}

/* 確認画面（スタック型・インライン型） */
.shedform-confirm-stacked .shedform-confirm-item,
.shedform-confirm-inline .shedform-row {
	margin-bottom: 1em;
}

.shedform-confirm-stacked .shedform-confirm-label,
.shedform-confirm-inline .shedform-inline-label {
	font-weight: 600;
	font-size: 0.9em;
	color: #555;
	margin-bottom: 0.2em;
}

.shedform-confirm-inline .shedform-row {
	display: flex;
	align-items: flex-start;
}

.shedform-confirm-inline .shedform-inline-label {
	flex-shrink: 0;
	padding-top: 0.2em;
}

.shedform-confirm-inline .shedform-inline-field {
	flex: 1;
	min-width: 0;
}

/* レスポンシブ */
@media (max-width: 640px) {
	.shedform-cols { grid-template-columns: 1fr !important; }

	.shedform-form-table,
	.shedform-confirm-table { display: block; }

	.shedform-form-table tr,
	.shedform-form-table th,
	.shedform-form-table td,
	.shedform-confirm-table tr,
	.shedform-confirm-table th,
	.shedform-confirm-table td { display: block; width: 100% !important; }

	.shedform-form-table th,
	.shedform-confirm-table th {
		border-bottom: none;
		padding-bottom: 0.3em;
	}

	.shedform-form-inline .shedform-row,
	.shedform-confirm-inline .shedform-row {
		flex-direction: column;
	}

	.shedform-inline-label,
	.shedform-confirm-inline .shedform-inline-label {
		width: 100% !important;
		margin-bottom: 0.3em;
	}

	.shedform-form-dl .shedform-row { flex-direction: column; }
	.shedform-form-dl .shedform-row-dl-inner { flex-direction: column; }
	.shedform-form-dl .shedform-dt  {
		width: 100% !important;
		border-right: none;
		border-bottom: none;
	}
	.shedform-form-dl .shedform-dd  { width: 100%; }
	.shedform-form-dl .shedform-dd .shedform-input,
	.shedform-form-dl .shedform-dd .shedform-textarea { max-width: 100%; }
}

/* ファイル添付 */
.shedform-file-field { margin-bottom: 8px; }
.shedform-file-hint { font-size: 12px; color: #666; margin: 4px 0 0; }
.shedform-file-preview { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.shedform-file-name { font-size: 13px; }

/* フォーム説明文 */
.shedform-form-description {
	margin-bottom: 24px;
	padding: 16px 20px;
	background: #f8f9fa;
	border-radius: 4px;
	font-size: 0.95rem;
	line-height: 1.8;
}

.shedform-form-description p:last-child {
	margin-bottom: 0;
}

.shedform-form-description ul,
.shedform-form-description ol {
	padding-left: 1.5em;
	margin: 8px 0;
}

.shedform-form-description li {
	margin-bottom: 4px;
}

.shedform-form-description a {
	color: var(--shedform-color-primary, #3498db);
}

.shedform-form-description strong {
	font-weight: 600;
}

/* Turnstile ウィジェット */
.shedform-turnstile {
	margin: 12px 0;
}

/* クレジット表示 */
.shedform-credit,
.wpshed-credit {
	text-align: right;
	margin-top: 8px;
	font-size: 11px;
	opacity: 0.6;
}

.shedform-credit a,
.wpshed-credit a {
	color: inherit;
	text-decoration: none;
}

.shedform-credit a:hover,
.wpshed-credit a:hover {
	opacity: 0.8;
	text-decoration: underline;
}

/* Expiry message */
.shedform-expiry-message {
	max-width: 800px;
	margin: 2em auto;
	padding: 1.5em;
	background: #f8f8f8;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-align: center;
	color: #555;
}
