/*
 * Public House お問い合わせフォーム
 * 色は子テーマの --ph-* 変数を使います（未定義時は右側の値）。
 */
.ph-contact {
	--phc-primary: var(--ph-color-primary, #0a7ea4);
	--phc-primary-dark: var(--ph-color-primary-dark, #075a78);
	--phc-pale: var(--ph-color-primary-pale, #eaf6fa);
	--phc-text: var(--ph-color-text, #1f2a33);
	--phc-muted: var(--ph-color-muted, #5b6b77);
	--phc-border: var(--ph-color-border, #cfdbe2);
	--phc-error: #c62828;
	--phc-radius: var(--ph-radius, 12px);
	max-width: 800px;
	margin-inline: auto;
	color: var(--phc-text);
}

/* steps */
.ph-contact__steps {
	display: flex;
	gap: 8px;
	margin: 0 0 32px !important;
	padding: 0 !important;
	list-style: none;
	counter-reset: none;
}
.ph-contact__steps li {
	display: flex;
	flex: 1;
	gap: 8px;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	padding: 12px 8px !important;
	border-bottom: 3px solid var(--phc-border);
	color: var(--phc-muted);
	font-size: .875rem;
	font-weight: 600;
}
.ph-contact__steps li::before { display: none !important; }
.ph-contact__steps li.is-current { border-color: var(--phc-primary); color: var(--phc-primary-dark); }
.ph-contact__steps li.is-done { border-color: var(--phc-primary); }
.ph-contact__step-num {
	display: inline-grid;
	width: 24px;
	height: 24px;
	place-items: center;
	border-radius: 50%;
	background: var(--phc-border);
	color: #fff;
	font-size: .75rem;
}
.is-current .ph-contact__step-num, .is-done .ph-contact__step-num { background: var(--phc-primary); }

.ph-contact__lead { margin: 0 0 24px; line-height: 1.9; }

/* notices */
.ph-contact__notice, .ph-contact__summary {
	margin: 0 0 24px;
	padding: 16px 20px;
	border: 1px solid var(--phc-error);
	border-radius: var(--phc-radius);
	background: #fff5f5;
	color: var(--phc-error);
	line-height: 1.8;
}
.ph-contact__summary:focus { outline: 3px solid rgba(198, 40, 40, .25); }
.ph-contact__summary p { margin: 0 0 .5em; font-weight: 700; }
.ph-contact__summary ul { margin: 0 !important; padding-left: 1.25em !important; }
.ph-contact__summary a { color: inherit; }

/* sections */
.ph-contact__section { margin: 0 0 32px; }
.ph-contact__section[hidden] { display: none !important; }
.ph-contact__section-title {
	margin: 0 0 20px !important;
	padding: 0 0 12px !important;
	border: 0 !important;
	border-bottom: 1px solid var(--phc-border) !important;
	background: none !important;
	color: var(--phc-text) !important;
	font-size: 1.125rem !important;
}
.ph-contact__section-title::before, .ph-contact__section-title::after { display: none !important; }

/* fields */
.ph-field { margin: 0 0 24px; }
.ph-field fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.ph-field--type { margin: 0 0 32px; padding: 0; border: 0; min-width: 0; }
.ph-field__label {
	display: flex;
	gap: 8px;
	align-items: center;
	margin: 0 0 8px;
	padding: 0;
	font-weight: 700;
	line-height: 1.6;
}
.ph-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: .6875rem;
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
}
.ph-badge--required { background: var(--phc-primary); color: #fff; }
.ph-badge--optional { background: #eef2f5; color: var(--phc-muted); }
.ph-field__help { margin: -2px 0 8px; color: var(--phc-muted); font-size: .8125rem; line-height: 1.7; }

.ph-contact input[type="text"],
.ph-contact input[type="email"],
.ph-contact input[type="tel"],
.ph-contact select,
.ph-contact textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--phc-border);
	border-radius: 8px;
	background: #fff;
	color: var(--phc-text);
	font-size: 16px; /* prevents zoom on iOS */
	line-height: 1.6;
	transition: border-color .15s, box-shadow .15s;
}
.ph-contact textarea { min-height: 180px; resize: vertical; }
.ph-contact input:focus-visible,
.ph-contact select:focus-visible,
.ph-contact textarea:focus-visible {
	border-color: var(--phc-primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(10, 126, 164, .2);
}
.ph-contact ::placeholder { color: #9aa7b0; }
.ph-field.has-error input:not([type=checkbox]):not([type=radio]),
.ph-field.has-error select,
.ph-field.has-error textarea { border-color: var(--phc-error); background: #fffafa; }
.ph-field__error { margin: 6px 0 0; color: var(--phc-error); font-size: .8125rem; font-weight: 600; }
.ph-field__error:empty { display: none; }
.ph-field__counter { margin: 4px 0 0; color: var(--phc-muted); font-size: .75rem; text-align: right; }

/* inquiry type cards */
.ph-field__types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ph-type-option { position: relative; display: block; margin: 0; cursor: pointer; }
.ph-type-option input { position: absolute; opacity: 0; }
.ph-type-option span {
	display: flex;
	align-items: center;
	height: 100%;
	box-sizing: border-box;
	padding: 16px 16px 16px 48px;
	border: 1px solid var(--phc-border);
	border-radius: var(--phc-radius);
	background: #fff;
	font-weight: 600;
	line-height: 1.6;
	transition: border-color .15s, background-color .15s;
}
.ph-type-option span::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 16px;
	width: 20px;
	height: 20px;
	box-sizing: border-box;
	border: 2px solid var(--phc-border);
	border-radius: 50%;
	background: #fff;
	transform: translateY(-50%);
}
.ph-type-option:hover span { border-color: var(--phc-primary); }
.ph-type-option input:checked + span { border-color: var(--phc-primary); background: var(--phc-pale); color: var(--phc-primary-dark); }
.ph-type-option input:checked + span::before { border: 6px solid var(--phc-primary); }
.ph-type-option input:focus-visible + span { box-shadow: 0 0 0 3px rgba(10, 126, 164, .25); }
.ph-field--type.has-error .ph-type-option span { border-color: var(--phc-error); }

/* checkboxes / radios */
.ph-field__choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.ph-choice { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 6px 0; line-height: 1.6; cursor: pointer; }
.ph-choice input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--phc-primary); }
.ph-choice--agree { display: inline-flex; align-items: center; font-weight: 700; }
.ph-choice--agree input { margin: 0; }

.ph-field--agree {
	margin-top: 8px;
	padding: 20px;
	border-radius: var(--phc-radius);
	background: #f5f9fb;
}
.ph-contact__privacy-text { margin: 0 0 8px; font-size: .875rem; line-height: 1.8; }

/* honeypot */
.ph-contact__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.ph-contact__turnstile { margin: 0 0 24px; }

/* buttons */
.ph-contact__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.ph-contact__btn {
	min-width: 260px;
	padding: 16px 32px;
	border: 1px solid var(--phc-primary);
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: .04em;
	cursor: pointer;
	transition: background-color .15s, color .15s, opacity .15s;
}
.ph-contact__btn--primary { background: var(--phc-primary); color: #fff; }
.ph-contact__btn--primary:hover { background: var(--phc-primary-dark); border-color: var(--phc-primary-dark); }
.ph-contact__btn--secondary { background: #fff; color: var(--phc-primary-dark); }
.ph-contact__btn--secondary:hover { background: var(--phc-pale); }
.ph-contact__btn:disabled { opacity: .6; cursor: wait; }
.ph-contact__btn:focus-visible { outline: 3px solid rgba(10, 126, 164, .35); outline-offset: 2px; }

/* confirm */
.ph-contact__confirm { margin: 0; border-top: 1px solid var(--phc-border); }
.ph-contact__confirm-row {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid var(--phc-border);
}
.ph-contact__confirm dt { margin: 0; color: var(--phc-muted); font-size: .875rem; font-weight: 700; }
.ph-contact__confirm dd { margin: 0; line-height: 1.8; overflow-wrap: anywhere; }
.ph-contact__confirm .is-empty { color: #9aa7b0; }

/* done */
.ph-contact__done { padding: 40px 24px; border-radius: var(--phc-radius); background: var(--phc-pale); text-align: center; }
.ph-contact__done-title {
	margin: 0 0 16px !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	color: var(--phc-primary-dark) !important;
	font-size: 1.375rem !important;
}
.ph-contact__done-title::before, .ph-contact__done-title::after { display: none !important; }
.ph-contact__done p { margin: 0; line-height: 1.9; }

@media (max-width: 767px) {
	.ph-contact__steps li { flex-direction: column; gap: 4px; font-size: .75rem; }
	.ph-field__types, .ph-field__choices { grid-template-columns: 1fr; }
	.ph-contact__confirm-row { grid-template-columns: 1fr; gap: 4px; }
	.ph-contact__btn { width: 100%; min-width: 0; }
	.ph-contact__actions { flex-direction: column-reverse; }
}
