.estimate {
	margin-top: 80px;
	padding: 0 20px;
	scroll-margin-top: 100px;
}

.estimate__inner {
	width: 100%;
	max-width: 800px;
	margin: 0 auto;
}

.estimate__eyebrow {
	color: var(--red);
	text-align: center;
	font-size: 18px;
	letter-spacing: 0;
	margin-bottom: 10px;
	line-height: 1;
}

.estimate__eyebrow span {
	position: relative;
	display: inline-block;
	padding: 0 18px;
}

.estimate__eyebrow span::before,
.estimate__eyebrow span::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 12px;
	height: 1px;
	background: currentColor;
}

.estimate__eyebrow span::before {
	left: 0;
	transform: rotate(48deg);
}

.estimate__eyebrow span::after {
	right: 0;
	transform: rotate(-48deg);
}

.estimate__title {
	font-size: clamp(22px, 1.667vw, 24px);
	line-height: 1.4;
	text-align: center;
	margin-bottom: 45px;
}

.estimate-form {
	width: 100%;
}

.form-row,
.address-group {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr);
	column-gap: 20px;
	align-items: start;
	width: 100%;
	margin: 0 0 16px;
	padding: 0;
	border: 0;
	min-width: 0;
	max-width: 678px;
	margin-inline: auto;
}

.form-label,
.address-group > .form-label {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	width: 100%;
	min-width: 0;
	padding-top: 10px;
	font-size: clamp(16px, 1.389vw, 20px);
	line-height: 1.4;
	text-align: right;
}

.required {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	min-height: 30px;
	padding: 2px 7px;
	border-radius: 10px;
	color: #fff;
	background: var(--red);
	font-size: clamp(12px, 0.972vw, 14px);
	line-height: 1;
	font-weight: 600;
}

.form-control,
.address-fields {
	grid-column: 2;
	min-width: 0;
}

.estimate-form input,
.estimate-form select {
	width: 100%;
	height: 56px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: 5px;
	outline: 0;
	color: var(--text);
	background: #fff;
	font: inherit;
	font-size: clamp(16px, 1.389vw, 20px);
	font-weight: 500;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.estimate-form input::placeholder {
	color: #888;
	opacity: 1;
}

.estimate-form input:focus,
.estimate-form select:focus {
	border-color: var(--green);
	box-shadow: 0 0 0 3px rgba(58, 188, 141, 0.18);
}

.estimate-form [aria-invalid="true"] {
	border-color: var(--red);
	background: #fff8f8;
}

.estimate-form [aria-invalid="true"]:focus {
	border-color: var(--red);
	box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.14);
}

.form-error {
	display: block;
	margin-top: 6px;
	color: #b00010;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.5;
}

.estimate-form input:focus-visible,
.estimate-form select:focus-visible,
.estimate-form button:focus-visible,
.privacy-agree input:focus-visible + .required {
	outline: 3px solid rgba(58, 188, 141, 0.35);
	outline-offset: 2px;
}

.form-control--dates {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}

.date-field {
	position: relative;
	display: grid;
	grid-template-columns: 110px minmax(210px, 1fr);
	align-items: start;
	width: 100%;
	max-width: 350px;
	background: #fff;
	border-radius: 5px;
	overflow: hidden;
}

.date-field__label {
	/* 入力欄（高さ56px）の行に対して上下中央揃え。エラー文が出ても入力欄の行に揃ったままにする */
	display: flex;
	align-items: center;
	height: 56px;
	padding: 0 0 0 20px;
	font-size: 16px;
	line-height: 1;
	white-space: nowrap;
}

.date-field__control {
	display: block;
	min-width: 0;
	padding: 0 8px 0 0;
}

.date-field input {
	padding-left: 8px;
}

.date-field .form-error {
	margin: -3px 0 7px 8px;
}

.address-group {
	margin-top: 20px;
	margin-bottom: 22px;
}

.address-fields {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.address-field {
	position: relative;
	min-width: 0;
}

.address-field__required {
	position: absolute;
	top: 14px;
	right: calc(100% + 20px);
}

/* 〒・入力欄・ボタンは列を明示指定する。
   自動配置のままだと、パスワード管理/自動入力系の拡張機能などが入力欄の横に要素を差し込んだ際、
   その要素が3列目を占有してボタンが2行目の〒列（20px幅）に押し出され、縦書き状に潰れるため */
.postcode-row {
	display: grid;
	grid-template-columns: 20px 205px 125px;
	grid-template-rows: auto;
	align-items: center;
	column-gap: 10px;
	row-gap: 0;
	justify-content: start;
}
.postcode-row > span[aria-hidden] {
	grid-area: 1 / 1;
}
/* 入力欄は枠で包み、拡張機能が入力欄の隣に差し込む要素も枠内に収める */
.postcode-row__field {
	grid-area: 1 / 2;
	position: relative;
	display: block;
	min-width: 0;
}
.postcode-row > .address-search {
	grid-area: 1 / 3;
	white-space: nowrap;
}

.postcode-row > span[aria-hidden] {
	font-size: 18px;
}

.postcode-row + .form-error {
	margin-left: 30px;
}

.address-search {
	height: 60px;
	padding: 0 14px;
	border: 0;
	border-radius: 5px;
	color: #fff;
	background: var(--red);
	font: inherit;
	font-size: clamp(16px, 1.389vw, 20px);
	cursor: pointer;
	transition: opacity 0.2s;
}

.address-search:hover {
	opacity: 0.82;
}

.address-search:disabled {
	cursor: wait;
	opacity: 0.65;
}

.address-search__message {
	min-height: 0;
	color: var(--green);
	font-size: 13px;
	font-weight: 500;
}

.address-search__message:empty {
	display: none;
}

.address-search__message.is-error {
	color: var(--red);
}

.privacy-box {
	max-height: 300px;
	margin-top: 40px;
	padding: clamp(30px, 3.472vw, 50px);
	border: 1px solid #707070;
	overflow-y: auto;
	background: rgba(255, 255, 255, 0.18);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.75;
}

.privacy-box h3,
.privacy-box h4 {
	font-size: 14px;
	margin: 0 0 14px;
}

.privacy-box h4 {
	margin-top: 14px;
	margin-bottom: 10px;
}

.privacy-box a {
	color: var(--red);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.privacy-box a:hover,
.privacy-box a:focus-visible {
	text-decoration-thickness: 2px;
}

.privacy-box a[href^="tel:"] {
	color: inherit;
	text-decoration: none;
}

.privacy-agree {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 35px;
	font-size: 17px;
	cursor: pointer;
}

.privacy-agree input {
	width: 40px;
	height: auto;
	aspect-ratio: 1 / 1;
	margin: 0;
	padding: 0;
	accent-color: var(--red);
	cursor: pointer;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
}

.privacy-agree-error {
	text-align: center;
}

.form-submit {
	display: flex;
	justify-content: center;
	margin-top: 70px;
}

.form-submit button,
.confirm-actions__send,
.thanks-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 280px;
	max-width: 100%;
	min-height: 50px;
	padding: 12px 24px;
	border: 0;
	border-radius: 999px;
	color: #fff;
	background: var(--red);
	font: inherit;
	font-size: clamp(14px, 1.111vw, 16px);
	cursor: pointer;
	transition: opacity 0.2s, transform 0.2s;
}

.form-submit button:hover,
.confirm-actions__send:hover,
.thanks-button:hover {
	opacity: 0.85;
	transform: translateY(-2px);
}

.form-trap {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.form-alert {
	margin: 0 0 28px;
	padding: 18px 22px;
	border: 1px solid var(--red);
	border-radius: 8px;
	color: #b00010;
	background: #fff5f6;
	font-size: 14px;
}

.form-alert p {
	margin-bottom: 5px;
}

.form-alert ul {
	list-style: disc;
	padding-left: 1.4em;
}

/* 確認・完了ページ */
.form-page {
	min-height: 100vh;
	padding-bottom: 0;
}

.form-page-main {
	padding: 76px 20px 87px;
}

.form-page-panel {
	width: 100%;
	max-width: 600px;
	margin: 0 auto;
}

.form-page-title {
	margin: 0;
	font-size: 24px;
	line-height: 1.5;
	text-align: center;
}

.confirm-list {
	margin: 46px 0 0;
}

.confirm-list__row {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr);
	border-bottom: 1px solid #999;
}

.confirm-list dt,
.confirm-list dd {
	margin: 0;
	padding: 14px 0;
	font-size: clamp(16px, 1.389vw, 20px);
	line-height: 2;
}

.confirm-list dt {
	padding-right: 28px;
	text-align: right;
}

.confirm-list dd {
	font-weight: 500;
	overflow-wrap: anywhere;
}

.confirm-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	margin-top: 70px;
}

.confirm-actions form {
	margin: 0;
}

.confirm-actions__back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--red);
	border-radius: 999px;
	color: var(--red);
	background: #fff;
	width: 280px;
	max-width: 100%;
	min-height: 50px;
	padding: 12px 24px;
	font-size: clamp(14px, 1.111vw, 16px);
	cursor: pointer;
	transition: opacity 0.2s, transform 0.2s;
}

.confirm-actions__back:hover {
	opacity: 0.85;
	transform: translateY(-2px);
}

.form-page .footer {
	margin-top: 0;
}

.form-page .footer__banner,
.form-page .side-cta {
	display: none;
}

.form-page-panel--thanks {
	max-width: 1100px;
	text-align: center;
}

.form-page-panel--thanks .form-page-title {
	margin-top: 24px;
}

.form-page-panel--thanks .thanks-message {
	margin: 58px 0 79px;
	font-size: clamp(16px, 1.389vw, 20px);
	font-weight: 500;
	line-height: 1.8;
	text-align: center;
}

.form-page-panel--thanks .thanks-message p + p {
	margin-top: 32px;
}

/* ============ 404ページ（完了ページのスタイルをベースに上書き） ============ */
.form-page-main--notfound {
	padding-top: 125px; /* デザイン：「404」の上端が y242（ヘッダー下から125px） */
	padding-bottom: 100px;
}
.notfound-code {
	margin: 0;
	color: var(--red);
	font-size: 180px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
}
.form-page-panel--notfound .form-page-title {
	margin-top: 50px;
	color: var(--red);
	line-height: 1;
}
.form-page-panel--notfound .thanks-message {
	margin: 65px 0 80px;
	color: #000;
}

@media (max-width: 900px) {
	.estimate {
		margin-top: 55px;
		padding: 0 20px;
		scroll-margin-top: 80px;
	}

	.estimate__title {
		margin-bottom: 36px;
	}

	.form-row,
	.address-group {
		display: block;
		margin-bottom: 20px;
	}

	.form-label,
	.address-group > .form-label {
		justify-content: flex-start;
		width: 100%;
		margin-bottom: 9px;
		padding-top: 0;
		font-size: 16px;
		text-align: left;
	}

	.form-control,
	.address-fields {
		width: 100%;
	}

	.estimate-form input,
	.estimate-form select {
		height: 54px;
		padding: 0 16px;
		font-size: 16px;
	}

	.date-field {
		grid-template-columns: 102px minmax(0, 1fr);
		max-width: none;
	}

	.date-field__label {
		height: 54px;
		padding-left: 16px;
		font-size: 15px;
	}

	.address-group {
		margin-top: 32px;
		margin-bottom: 32px;
	}

	.address-field {
		margin-left: 50px;
	}

	.address-field__required {
		right: calc(100% + 10px);
	}

	.postcode-row {
		grid-template-columns: auto minmax(0, 1fr) 105px;
		column-gap: 8px;
	}

	.address-search {
		height: 54px;
		padding: 0 10px;
		font-size: 14px;
	}

	.privacy-box {
		max-height: 280px;
		margin-top: 42px;
		padding: 22px 20px;
		font-size: 12px;
	}

	.privacy-agree {
		align-items: flex-start;
		justify-content: flex-start;
		flex-wrap: wrap;
		margin-top: 28px;
		font-size: 15px;
	}

	.privacy-agree input {
		width: 32px;
		height: 32px;
	}

	.privacy-agree > span:last-child {
		flex: 1;
		padding-top: 4px;
	}

	.privacy-agree-error {
		text-align: left;
	}

	.form-submit {
		margin-top: 45px;
	}

	.form-page-main {
		padding: 50px 20px 65px;
	}

	.form-page-panel {
		max-width: 600px;
	}

	.confirm-list {
		margin-top: 36px;
	}

	.confirm-list__row {
		display: block;
	}

	.confirm-list dt,
	.confirm-list dd {
		padding: 10px 0;
	}

	.confirm-list dt {
		padding-bottom: 0;
		text-align: left;
	}

	.confirm-list dd {
		padding-top: 0;
		padding-bottom: 12px;
	}

	.confirm-actions {
		flex-direction: column-reverse;
		gap: 14px;
		margin-top: 38px;
	}

	.confirm-actions form,
	.confirm-actions__back,
	.confirm-actions__send {
		width: 100%;
	}

	.form-page-panel--thanks .form-page-title {
		margin-top: 0;
	}

	.form-page-panel--thanks .thanks-message {
		margin: 38px 0 50px;
		line-height: 1.9;
		text-align: left;
	}

	.form-page-panel--thanks .thanks-message br {
		display: none;
	}

	.form-page-panel--thanks .thanks-message p + p {
		margin-top: 24px;
	}
	/* 404（SP） */
	.form-page-main--notfound {
		padding-bottom: 65px;
	}
	.notfound-code {
		font-size: 100px;
	}
	.form-page-panel--notfound .form-page-title {
		margin-top: 30px;
		line-height: 1.5;
	}
}

@media (max-width: 400px) {
	.estimate {
		padding: 0 15px;
	}

	.postcode-row {
		grid-template-columns: 18px minmax(0, 1fr) 96px;
		column-gap: 6px;
	}
}
