:root {
	--cw-otp-green: #0f5132;
	--cw-otp-green-dark: #0a3d27;
	--cw-otp-green-soft: #f7faf8;
	--cw-otp-border: #d8e5dc;
	--cw-otp-text: #173d2b;
	--cw-otp-muted: #738078;
	--cw-otp-error: #b34b4b;
}

/* この認証機能を置いたCF7フォームだけ、縦の余白を少し詰める */
form.cw-email-otp-form > p {
	margin-top: 0 !important;
	margin-bottom: 16px !important;
}

form.cw-email-otp-form label {
	line-height: 1.45;
}

form.cw-email-otp-form input,
form.cw-email-otp-form textarea {
	margin-top: 6px;
}

.cw-email-field-line {
	display: flex;
	align-items: center;
	gap: 9px;
	width: 100%;
}

.cw-email-field-line > .wpcf7-form-control-wrap {
	flex: 1 1 auto;
	min-width: 0;
}

.cw-email-status-badge {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

.cw-email-status-badge[hidden] {
	display: none !important;
}

.cw-email-status-badge.is-unverified {
	border: 1px solid #e2c6c6;
	background: #fff7f7;
	color: var(--cw-otp-error);
}

.cw-email-status-badge.is-verified {
	border: 1px solid #bddbc9;
	background: #eef8f2;
	color: #17653b;
}

.cw-email-otp {
	margin: -2px 0 14px;
}

.cw-email-otp[hidden],
.cw-email-otp__ready[hidden],
.cw-email-otp__verify-wrap[hidden],
.cw-email-otp__success[hidden],
.cw-email-otp__message[hidden],
.cw-email-otp__resend-wait[hidden],
.cw-email-otp__submit-note[hidden] {
	display: none !important;
}

.cw-email-otp__panel {
	padding: 14px 15px;
	border: 1px solid var(--cw-otp-border);
	border-radius: 9px;
	background: var(--cw-otp-green-soft);
	box-shadow: 0 6px 18px rgba(15, 81, 50, 0.035);
}

.cw-email-otp__ready {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
}

.cw-email-otp__copy {
	min-width: 0;
}

.cw-email-otp__title {
	margin: 0 0 2px !important;
	color: var(--cw-otp-text);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.45;
}

.cw-email-otp__guide {
	margin: 0 !important;
	color: #59685f;
	font-size: 12px;
	line-height: 1.6;
}

.cw-email-otp__send,
.cw-email-otp__verify {
	display: inline-flex !important;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 9px 16px !important;
	border: 1px solid var(--cw-otp-green) !important;
	border-radius: 7px !important;
	background: var(--cw-otp-green) !important;
	color: #ffffff !important;
	-webkit-text-fill-color: #ffffff !important;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.cw-email-otp__send:hover,
.cw-email-otp__verify:hover {
	background: var(--cw-otp-green-dark) !important;
	color: #ffffff !important;
	-webkit-text-fill-color: #ffffff !important;
	transform: translateY(-1px);
}

.cw-email-otp__send:disabled,
.cw-email-otp__verify:disabled {
	opacity: 0.55;
	cursor: wait;
	transform: none;
}

.cw-email-otp__verify-wrap {
	display: grid;
	gap: 10px;
}

.cw-email-otp__verify-row {
	display: flex;
	align-items: stretch;
	gap: 8px;
	max-width: 430px;
}

.cw-email-otp__code {
	flex: 1 1 auto;
	min-width: 0;
	margin-top: 0 !important;
	padding: 9px 11px !important;
	border: 1px solid #bdcbc2 !important;
	border-radius: 7px !important;
	background: #ffffff !important;
	color: #10251b !important;
	font: inherit;
	font-size: 14px;
	letter-spacing: 0.1em;
}

.cw-email-otp__code:focus {
	border-color: #2f7657 !important;
	outline: 2px solid rgba(47, 118, 87, 0.13);
	outline-offset: 1px;
}

.cw-email-otp__resend-area {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 5px 10px;
}

.cw-email-otp__resend-note {
	color: #6a766f;
	font-size: 11px;
	line-height: 1.5;
}

.cw-email-otp__resend {
	display: inline-flex;
	align-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--cw-otp-green);
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.cw-email-otp__resend:disabled {
	color: #9aa39d;
	text-decoration: none;
	cursor: not-allowed;
}

.cw-email-otp__resend-wait {
	color: #8b958f;
	font-size: 11px;
}

.cw-email-otp__success {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #17653b;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.5;
}

.cw-email-otp__success-icon {
	display: inline-grid;
	place-items: center;
	width: 21px;
	height: 21px;
	border-radius: 50%;
	background: #17653b;
	color: #ffffff;
	font-size: 12px;
}

.cw-email-otp__message {
	margin: 9px 0 0 !important;
	padding-top: 9px;
	border-top: 1px solid var(--cw-otp-border);
	font-size: 11px;
	line-height: 1.55;
}

.cw-email-otp__message.is-error {
	color: var(--cw-otp-error);
}

.cw-email-otp__message.is-success {
	color: #17653b;
}

.cw-email-otp__message.is-info {
	color: var(--cw-otp-muted);
}

.cw-email-otp__submit-note {
	margin: 3px 0 0 !important;
	color: #8a948e;
	font-size: 11px;
	line-height: 1.45;
	text-align: center;
}

.wpcf7 input[type="submit"].cw-otp-submit-disabled,
.wpcf7 button[type="submit"].cw-otp-submit-disabled {
	opacity: 0.4 !important;
	cursor: not-allowed !important;
	filter: grayscale(0.3);
	pointer-events: none;
}

@media (max-width: 640px) {
	form.cw-email-otp-form > p {
		margin-bottom: 14px !important;
	}

	.cw-email-field-line {
		align-items: flex-start;
		flex-wrap: wrap;
	}

	.cw-email-status-badge {
		margin-top: -1px;
	}

	.cw-email-otp__panel {
		padding: 13px;
	}

	.cw-email-otp__ready {
		align-items: flex-start;
		flex-direction: column;
		gap: 10px;
	}

	.cw-email-otp__send {
		width: 100%;
	}

	.cw-email-otp__verify-row {
		flex-direction: column;
	}

	.cw-email-otp__verify {
		width: 100%;
	}
}

/* Turnstileは通常非表示。追加操作が必要な場合のみ、この位置に表示されます。 */
.cw-email-otp__turnstile {
	width: 100%;
	min-height: 0;
}

.cw-email-otp__turnstile iframe {
	max-width: 100%;
}
