/* TTG Webフォーム（CF7）— 旧Pardotフォームの見た目に合わせる */

.ttg-form {
	font-family: 'Noto Sans JP', sans-serif;
	color: #444;
	background: #fff;
	padding: 28px 24px;
	text-align: left;
	box-sizing: border-box;
}

.ttg-form *,
.ttg-form *::before,
.ttg-form *::after {
	box-sizing: border-box;
}

.ttg-form .wpcf7 {
	margin: 0;
}

.ttg-form__row {
	display: block;
	margin: 0 0 18px;
}

.ttg-form__note {
	display: block;
}

.ttg-form__label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 700;
	color: #000;
	line-height: 1.5;
}

.ttg-form__badge {
	display: inline-block;
	flex-shrink: 0;
	padding: 0.15em 0.4em;
	border: 1px solid #999;
	color: #999;
	font-size: 12px;
	font-weight: 400;
	line-height: 1;
}

.ttg-form__badge--required {
	border-color: #c0392b;
	color: #c0392b;
}

.ttg-form__name {
	display: flex;
	gap: 12px;
}

.ttg-form__name > span {
	flex: 1;
}

.ttg-form .wpcf7 input[type='text'],
.ttg-form .wpcf7 input[type='email'],
.ttg-form .wpcf7 input[type='tel'],
.ttg-form .wpcf7 input[type='url'],
.ttg-form .wpcf7 select,
.ttg-form .wpcf7 textarea {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 0;
	background: #fff;
	font-family: inherit;
	font-size: 16px;
	color: #222;
	line-height: 1.5;
	-webkit-appearance: none;
	appearance: none;
}

.ttg-form .wpcf7 select {
	padding-right: 36px;
	background-image: linear-gradient(45deg, transparent 50%, #666 50%), linear-gradient(135deg, #666 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
	background-size: 5px 5px;
	background-repeat: no-repeat;
}

.ttg-form .wpcf7 textarea {
	height: 10em;
	resize: vertical;
}

.ttg-form input:focus,
.ttg-form select:focus,
.ttg-form textarea:focus {
	outline: 2px solid #c0cd34;
	outline-offset: 0;
	border-color: #c0cd34;
}

.ttg-form__note {
	margin: 6px 0 0;
	font-size: 13px;
	color: #777;
}

.ttg-form__privacy {
	margin: 8px 0 24px;
	font-size: 13px;
	color: #555;
	line-height: 1.7;
}

.ttg-form__privacy a {
	color: inherit;
	text-decoration: underline;
}

.ttg-form__submit {
	text-align: center;
}

.ttg-form input[type='submit'] {
	display: inline-block;
	width: 100%;
	max-width: 360px;
	padding: 16px 24px;
	border: 1px solid #c0cd34;
	border-radius: 0;
	background: #c0cd34;
	color: #000;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.5em;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: opacity 0.2s;
}

.ttg-form input[type='submit']:hover,
.ttg-form input[type='submit']:focus {
	opacity: 0.8;
}

.ttg-form input[type='submit']:disabled {
	opacity: 0.5;
	cursor: wait;
}

.ttg-form .wpcf7-spinner {
	display: block;
	margin: 12px auto 0;
}

.ttg-form .wpcf7-not-valid-tip {
	margin-top: 6px;
	font-size: 13px;
	color: #c0392b;
}

.ttg-form .wpcf7 form .wpcf7-response-output {
	margin: 20px 0 0;
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.6;
}

.ttg-form .wpcf7 form.sent .wpcf7-response-output {
	border-color: #c0cd34;
	background: #f7f9e6;
	color: #333;
}

/*
 * 旧Pardot iframe の上下余白を隠すために、テーマ側でマイナスの余白を付けている。
 * CF7 フォームが入っている枠ではそれを打ち消す。
 */
:has(.ttg-form) > :is(.download-right-upper, .download-right-bottom, .contactInner-upper, .contactInner-bottom, .webinarFormBottom, .download-form-bottom) {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* FV（TOP・LP）の見出しも同じくマイナス余白でiframeに重ねている */
.fv-form-header:has(+ .ttg-form) {
	position: relative !important;
	margin-bottom: 12px !important;
}

/* lp-hello の FV 枠は内側の余白が無い（見出しを absolute で重ねる作り） */
.fv-form > .ttg-form.ttg-form--hello {
	padding: 0 16px 20px;
}

/* FV の枠は自前で余白を持っているので、フォーム側の余白と背景は外す */
.fv-form > .ttg-form {
	padding: 0;
	background: transparent;
}

/* LP のフォーム枠（高さ固定・スクロール）は中身の高さに合わせる */
.c-form .download-right:has(.ttg-form) {
	height: auto;
	overflow: visible;
}

@media (max-width: 767px) {
	.ttg-form {
		padding: 24px 16px;
	}

	.ttg-form__name {
		flex-direction: column;
		gap: 10px;
	}
}
