/* ═══════════════════════════════════════
 *  RS Zemeeiform — Frontend Styles
 *  Design spec: Noto Sans CJK TC,
 *  underline inputs, custom checkboxes,
 *  pill submit button with slide animation.
 * ═══════════════════════════════════════ */

/* ── Reset & Base ── */

.rszm-form-wrap {
	max-width: 1216px;
	margin: 0 auto;
	font-family: 'Noto Sans CJK TC', sans-serif;
}

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

/* ── Two-column grid ── */

.rszm-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 96px;
}

/* ── Field group ── */

.rszm-field {
	margin-bottom: 32px;
}

/* ── Labels ── */

.rszm-label {
	display: block;
	font-size: 18px;
	font-weight: 400;
	color: #222;
	margin-bottom: 8px;
	cursor: default;
}

.rszm-required {
	color: #FF3702;
	margin-left: 0;
}

.rszm-hint {
	color: #808080;
}

/* ── Text inputs (underline style) ── */

.rszm-form .rszm-input {
	display: block;
	width: 100%;
	height: 44px;
	padding: 8px 12px;
	font-size: 16px;
	font-family: 'Noto Sans CJK TC', sans-serif;
	color: #222;
	background: transparent;
	border: none;
	border-bottom: 1px solid #CACACA;
	border-radius: 0;
	outline: none;
	transition: border-color 0.2s;
	-webkit-appearance: none;
	appearance: none;
}

.rszm-form .rszm-input:focus {
	border-bottom-color: #222;
}

/* ── Textarea ── */

.rszm-form .rszm-textarea {
	display: block;
	width: 100%;
	min-height: 224px;
	padding: 24px;
	font-size: 16px;
	font-family: 'Noto Sans CJK TC', sans-serif;
	color: #222;
	background: transparent;
	border: 1px solid #CACACA;
	border-radius: 0;
	outline: none;
	resize: vertical;
	transition: border-color 0.2s;
	-webkit-appearance: none;
	appearance: none;
}

.rszm-form .rszm-textarea:focus {
	border-color: #222;
}

/* ── Checkbox grid ── */

.rszm-checkbox-grid {
	display: grid;
	gap: 8px 8px;
}

.rszm-cols-2 {
	grid-template-columns: 1fr 1fr;
}

/* ── Custom checkbox ── */

.rszm-checkbox-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 4px 0;
	cursor: pointer;
	font-size: 16px;
	color: #222;
	line-height: 1;
	user-select: none;
}

/* Hide native checkbox */
.rszm-checkbox-item input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* Custom checkmark box */
.rszm-checkmark {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	background: #fff;
	border: 1px solid #CACACA;
	border-radius: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, border-color 0.15s;
}

/* Checked state */
.rszm-checkbox-item input[type="checkbox"]:checked + .rszm-checkmark {
	background: #FF3702;
	border-color: #FF3702;
}

/* Checkmark icon */
.rszm-checkbox-item input[type="checkbox"]:checked + .rszm-checkmark::after {
	content: '';
	display: block;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 1.5px 1.5px 0;
	transform: rotate(45deg) translateY(-1px);
}

/* Focus ring for accessibility */
.rszm-checkbox-item input[type="checkbox"]:focus-visible + .rszm-checkmark {
	outline: 2px solid #FF3702;
	outline-offset: 2px;
}

.rszm-checkbox-label {
	flex: 1;
}

/* ── "其他" inline input ── */

.rszm-other-item {
	flex-wrap: nowrap;
}

.rszm-other-item .rszm-checkbox-label {
	flex: 0 0 auto;
	white-space: nowrap;
}

.rszm-form .rszm-other-item .rszm-inline-input {
	flex: 1 1 0;
	min-width: 80px;
	max-width: 200px;
	height: 18px;
	padding: 0 12px;
	font-size: 14px;
	font-family: 'Noto Sans CJK TC', sans-serif;
	color: #222;
	background: transparent;
	border: none;
	border-bottom: 1px solid #CACACA;
	border-radius: 0;
	outline: none;
	transition: border-color 0.2s;
	-webkit-appearance: none;
	appearance: none;
}

.rszm-form .rszm-other-item .rszm-inline-input:focus {
	border-bottom-color: #222;
}

/* ── Subscribe field ── */

.rszm-subscribe-field {
	padding-top: 16px;
}

/* ── Honeypot (invisible to humans) ── */

.rszm-hp {
	position: absolute;
	left: -9999px;
	top: -9999px;
	opacity: 0;
	height: 0;
	overflow: hidden;
}

/* ── Submit button ── */

.rszm-submit-wrap {
	display: flex;
	justify-content: center;
	margin-top: 69px;
}

.rszm-form .rszm-submit-btn {
	position: relative;
	width: 211px;
	height: 60px;
	background: #f0f0f0;
	border: 1px solid #CACACA;
	border-radius: 36px;
	overflow: hidden;
	cursor: pointer;
	outline: none;
	padding: 0;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}

.rszm-form .rszm-submit-btn:hover,
.rszm-form .rszm-submit-btn:focus,
.rszm-form .rszm-submit-btn:focus-visible,
.rszm-form .rszm-submit-btn:active {
	background: #f0f0f0;
	outline: none;
	box-shadow: none;
	border-color: #CACACA;
}

/* Slide-in background */
.rszm-btn-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #FF3702;
	border-radius: 36px;
	transform: translateX(-100%);
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

.rszm-form .rszm-submit-btn:hover .rszm-btn-bg {
	transform: translateX(0);
}

/* Button text */
.rszm-btn-text {
	position: relative;
	z-index: 1;
	font-size: 18px;
	font-family: 'Gill Sans MT', 'Gill Sans', sans-serif;
	font-weight: 400;
	text-transform: capitalize;
	color: #1C1D20;
	line-height: 60px;
	transition: color 0.3s;
	pointer-events: none;
}

.rszm-form .rszm-submit-btn:hover .rszm-btn-text {
	color: #fff;
}

/* Loading state */
.rszm-submit-btn.is-loading {
	pointer-events: none;
	opacity: 0.7;
}

.rszm-submit-btn.is-loading .rszm-btn-text::after {
	content: '...';
}

/* ── Messages ── */

.rszm-message {
	text-align: center;
	margin-top: 24px;
	font-size: 16px;
	min-height: 24px;
}

.rszm-message.is-success {
	color: #222;
}

.rszm-message.is-error {
	color: #FF3702;
}

/* ── Validation error on field ── */

.rszm-field.has-error .rszm-input,
.rszm-field.has-error .rszm-textarea {
	border-bottom-color: #FF3702;
}

.rszm-field.has-error .rszm-input {
	border-bottom-color: #FF3702;
}

.rszm-field-error {
	font-size: 13px;
	color: #FF3702;
	margin-top: 4px;
}

/* ── Responsive ── */

/* Below 1280px: shrink gap progressively */
@media (max-width: 1280px) {
	.rszm-form-grid {
		gap: 48px;
	}
}

@media (max-width: 1024px) {
	.rszm-form-grid {
		gap: 32px;
	}
}

/* Tablet: stack to single column */
@media (max-width: 768px) {
	.rszm-form-grid {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.rszm-cols-2 {
		grid-template-columns: 1fr 1fr;
	}
}

/* Mobile */
@media (max-width: 480px) {
	.rszm-cols-2 {
		grid-template-columns: 1fr;
	}

	.rszm-inline-input {
		width: 140px;
	}

	.rszm-submit-btn {
		width: 100%;
		max-width: 280px;
	}
}
