/* 반드시 CLAUDE.md의 절대원칙을 읽고 따를 것 */
/* 상담예약 섹션 CSS */
/* HTML: layouts/ncrom_layout/sections/html/consultation.html */
/* CSS: layouts/ncrom_layout/sections/styles/consultation.css (이 파일) */
/* JS: layouts/ncrom_layout/sections/scripts/consultation.js */
/*
/* 📚 관련 문서:
/* - docs/CONSULTATION_BOOKING_GUIDE.md (상담예약 전체 가이드)
/* - docs/REGION_SELECTION_SYSTEM.md (거주지역 선택 시스템 완벽 가이드)
/* - docs/FRONTEND_FLATPICKR_CALENDAR.md (Flatpickr 달력 시스템 완벽 가이드)
/*

/* ===== 1. 상담예약 섹션 컨테이너 ===== */
.consultation-section {
	width: 100%;
	min-height: 100vh;
	padding: 120px 0 80px;
	background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
	position: relative;
	overflow: hidden;
}

.consultation-section::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -10%;
	width: 600px;
	height: 600px;
	background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
	border-radius: 50%;
	z-index: 0;
}

.consultation-section::after {
	content: '';
	position: absolute;
	bottom: -30%;
	left: -10%;
	width: 500px;
	height: 500px;
	background: radial-gradient(circle, rgba(102, 126, 234, 0.08) 0%, transparent 70%);
	border-radius: 50%;
	z-index: 0;
}

.consultation-container {
	max-width: 1000px;
	margin: 0 auto;
	padding: 0 20px;
	position: relative;
	z-index: 1;
}

/* ===== 2. 섹션 헤더 ===== */
.section-header {
	text-align: center;
	margin-bottom: 50px;
}

.section-title {
	font-size: 36px;
	font-weight: 700;
	color: #2c3e50;
	margin-bottom: 15px;
	letter-spacing: -0.5px;
}

.section-subtitle {
	font-size: 18px;
	color: #7f8c8d;
	line-height: 1.6;
}

/* ===== 3. 폼 컨테이너 ===== */
.consultation-form {
	background: white;
	border-radius: 20px;
	padding: 50px 40px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
	position: relative;
}

/* ===== 4. 폼 행 (2열 레이아웃) ===== */
.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
	margin-bottom: 15px;
}

/* ===== 5. 폼 그룹 ===== */
.form-group {
	margin-bottom: 0;
}

.form-row .form-group {
	margin-bottom: 0;
}

.form-label {
	display: block;
	font-size: 16px;
	font-weight: 600;
	color: #34495e;
	margin-bottom: 10px;
}

.required-mark {
	color: #e74c3c;
	margin-left: 4px;
	font-weight: bold;
}

.form-hint {
	font-size: 13px;
	color: #95a5a6;
	font-weight: 400;
	margin-left: 8px;
}

/* ===== 5. 입력 필드 공통 스타일 ===== */
.form-input,
.form-select {
	width: 100%;
	padding: 15px 20px;
	font-size: 15px;
	color: #2c3e50;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	transition: all 0.3s ease;
	background: white;
	font-family: inherit;
	/* 브라우저 네이티브 검증 스크롤 시 화면 중앙 정렬 */
	/* 헤더(80px) + 가시영역 절반 - 요소 절반 + 실측보정(135px) */
	scroll-margin-top: calc(80px + (100vh - 80px) / 2 + 107.5px);
}

.form-input:focus,
.form-select:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
	color: #bdc3c7;
}

/* ===== 6. 연락처 입력 필드 ===== */
.phone-input-group {
	display: flex;
	align-items: center;
	gap: 10px;
}

.phone-input {
	flex: 1;
	text-align: center;
	font-weight: 500;
}

.phone-input[readonly] {
	background: #f8f9fa;
	cursor: not-allowed;
	color: #7f8c8d;
}

.phone-separator {
	font-size: 18px;
	font-weight: bold;
	color: #95a5a6;
}

/* ===== 거주지역 입력 필드 ===== */
.residence-group {
	grid-column: 1 / -1; /* 전체 너비 사용 */
}

.residence-select-group {
	display: flex;
	align-items: center;
	gap: 15px;
}

.residence-select {
	flex: 1;
	min-width: 0; /* flex 아이템이 축소될 수 있도록 */
}

.residence-select:disabled {
	background: #f8f9fa;
	cursor: not-allowed;
	color: #95a5a6;
}

/* ===== 6-1. 관심타입 체크박스 ===== */
.interest-type-group {
	margin-bottom: 25px;
}

.checkbox-group {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.checkbox-group .checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ===== 6-2. 상담전 사전질문 메모 입력 ===== */
.memo-group {
	margin-bottom: 25px;
}

.form-textarea {
	width: 100%;
	padding: 15px;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	font-size: 15px;
	font-family: inherit;
	line-height: 1.6;
	resize: vertical;
	min-height: 120px;
	transition: all 0.3s ease;
}

.form-textarea:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea::placeholder {
	color: #95a5a6;
}

.char-counter {
	text-align: right;
	margin-top: 8px;
	font-size: 13px;
	color: #6c757d;
}

.char-counter #charCount {
	font-weight: 600;
	color: #667eea;
}

/* ===== 7. 날짜 입력 필드 ===== */
.date-input {
	cursor: pointer;
	position: relative;
	/* 달력 아이콘을 배경으로 표시 */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23667eea'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 15px center;
	background-size: 18px;
}

/* 날짜 입력 필드의 flatpickr wrapper */
.flatpickr-wrapper {
	display: block;
	width: 100%;
}

/* ===== Flatpickr 달력 커스터마이징 ===== */
.flatpickr-calendar {
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	/* 애니메이션 효과 제거 */
	animation: none !important;
	/* 크기 조정 */
	font-size: 15px;
	width: 350px !important;
	/* 입력 필드 아래 정확한 위치 */
	margin-top: 5px !important;
}

/* form-row 내부의 달력 위치 조정 */
.form-row .flatpickr-calendar {
	/* 달력을 입력 필드의 좌측 라인과 정확히 맞춤 */
	position: absolute !important;
	/* 왼쪽 여백 조정 (입력 필드의 border 두께 + padding 고려) */
	transform: translateX(0) !important;
}

/* 날짜 입력 필드가 포함된 form-group에 상대 위치 지정 */
.form-row .form-group {
	position: relative;
}

/* 달력이 열릴 때 애니메이션 제거 */
.flatpickr-calendar.open {
	animation: none !important;
}

/* 달력 헤더 스타일 - 깔끔한 흰색 */
.flatpickr-months {
	background: white;
	border-radius: 10px 10px 0 0;
	padding: 10px 0;
	border-bottom: 1px solid #e0e0e0;
	display: flex;
	justify-content: center;
	align-items: center;
}

.flatpickr-current-month {
	color: #2c3e50;
	font-weight: 700;
	text-align: center;
}

/* 달력 본문 중앙정렬 */
.flatpickr-innerContainer {
	display: flex;
	justify-content: center;
}

.flatpickr-rContainer {
	display: flex;
	justify-content: center;
}

.flatpickr-days {
	display: flex;
	justify-content: center;
}

.flatpickr-prev-month,
.flatpickr-next-month {
	color: #7f8c8d;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
	color: #2c3e50;
}

/* 요일 헤더 */
.flatpickr-weekday {
	color: #7f8c8d;
	font-weight: 600;
}

/* 날짜 셀 */
.flatpickr-day {
	border-radius: 6px;
	color: #2c3e50;
	transition: all 0.2s ease;
}

.flatpickr-day:hover {
	background: #f5f7fa;
	color: #2c3e50;
	border-color: #e0e0e0;
}

.flatpickr-day.selected {
	background: #667eea;
	color: white;
	border-color: #667eea;
}

.flatpickr-day.today {
	border-color: #667eea;
	color: #667eea;
	font-weight: 700;
}

/* 이전달/다음달 날짜 - 완전히 숨김 */
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
	visibility: hidden; /* 완전히 숨김 */
	pointer-events: none; /* 클릭 방지 */
}

/* 비활성화된 날짜 (과거) - 현재 월에 속하면 진하게 표시 */
.flatpickr-day.disabled:not(.prevMonthDay):not(.nextMonthDay) {
	color: #2c3e50; /* 진한 색상 */
	font-weight: 600;
	cursor: not-allowed;
	opacity: 1;
}

/* ===== 8. 선택 필드 (select) ===== */
.form-select {
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 20px center;
	background-size: 12px;
	padding-right: 50px;
}

/* ===== 9. 개인정보 동의 영역 ===== */
.privacy-group {
	margin-top: 40px;
	padding-top: 30px;
	border-top: 2px solid #ecf0f1;
}

.privacy-box {
	background: #f8f9fa;
	border: 2px solid #e0e0e0;
	border-radius: 10px;
	padding: 20px;
	margin-bottom: 20px;
	max-height: 150px; /* 40% 축소 (250px → 150px) */
	overflow-y: auto;
}

.privacy-box::-webkit-scrollbar {
	width: 8px;
}

.privacy-box::-webkit-scrollbar-track {
	background: #ecf0f1;
	border-radius: 10px;
}

.privacy-box::-webkit-scrollbar-thumb {
	background: #bdc3c7;
	border-radius: 10px;
}

.privacy-box::-webkit-scrollbar-thumb:hover {
	background: #95a5a6;
}

.privacy-content {
	font-size: 14px;
	line-height: 1.8;
	color: #555;
}

.privacy-section-title {
	font-size: 15px;
	font-weight: 700;
	color: #2c3e50;
	margin: 20px 0 10px;
}

.privacy-section-title:first-child {
	margin-top: 0;
}

.privacy-list {
	margin: 10px 0;
	padding-left: 20px;
}

.privacy-list li {
	margin-bottom: 8px;
}

.privacy-list strong {
	color: #2c3e50;
	font-weight: 600;
}

/* ===== 10. 동의 체크박스 ===== */
.privacy-agree {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.checkbox-label {
	display: flex;
	align-items: center;
	cursor: pointer;
	user-select: none;
}

.form-checkbox {
	width: 22px;
	height: 22px;
	margin-right: 10px;
	cursor: pointer;
	accent-color: #667eea;
}

.checkbox-text {
	font-size: 15px;
	color: #2c3e50;
	font-weight: 500;
}

/* ===== 11. 에러 메시지 ===== */
.error-message {
	display: block;
	font-size: 13px;
	color: #e74c3c;
	margin-top: 8px;
	min-height: 18px;
	font-weight: 500;
}

.form-input.error,
.form-select.error {
	border-color: #e74c3c;
	background: #fef5f5;
}

.form-input.error:focus,
.form-select.error:focus {
	box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

/* ===== 12. Honeypot (스팸 방지) ===== */
.honeypot-field {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

/* ===== 13. 신청하기 버튼 ===== */
.submit-btn {
	width: 100%;
	padding: 18px 30px;
	font-size: 18px;
	font-weight: 700;
	color: white;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.3s ease;
	margin-top: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.submit-btn:active {
	transform: translateY(0);
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
	background: #bdc3c7;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.submit-btn i {
	font-size: 18px;
}

/* ===== 14. 로딩 오버레이 ===== */
.loading-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 10;
}

.loading-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid #ecf0f1;
	border-top-color: #667eea;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.loading-overlay p {
	margin-top: 20px;
	font-size: 16px;
	color: #7f8c8d;
	font-weight: 500;
}

/* ===== 15. 성공 메시지 ===== */
.success-message {
	background: white;
	border-radius: 20px;
	padding: 60px 40px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
	text-align: center;
}

.success-icon {
	font-size: 80px;
	color: #27ae60;
	margin-bottom: 25px;
	animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
	from {
		transform: scale(0);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

.success-message h3 {
	font-size: 28px;
	font-weight: 700;
	color: #2c3e50;
	margin-bottom: 15px;
}

.success-message p {
	font-size: 16px;
	color: #7f8c8d;
	margin-bottom: 30px;
}

.btn-secondary {
	padding: 12px 30px;
	font-size: 16px;
	font-weight: 600;
	color: #667eea;
	background: white;
	border: 2px solid #667eea;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.btn-secondary:hover {
	background: #667eea;
	color: white;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

/* ===== 16. 반응형 디자인 ===== */

/* 태블릿 (768px ~ 1024px) */
@media (max-width: 1024px) {
	.consultation-container {
		max-width: 700px;
	}

	.section-title {
		font-size: 32px;
	}

	.consultation-form {
		padding: 40px 30px;
	}
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
	.consultation-section {
		padding: 100px 0 60px;
	}

	.consultation-container {
		padding: 0 15px;
	}

	.section-title {
		font-size: 28px;
	}

	.section-subtitle {
		font-size: 14px;
	}

	.consultation-form {
		padding: 30px 20px;
		border-radius: 15px;
	}

	/* 모바일에서는 폼 필드를 세로로 배치 */
	.form-row {
		grid-template-columns: 1fr;
		gap: 10px; /* 여백 50% 축소 (20px → 10px) */
	}

	.form-label {
		font-size: 15px;
		margin-bottom: 5px; /* 라벨 하단 여백 50% 축소 (10px → 5px) */
	}

	.error-message {
		margin-top: 4px; /* 에러 메시지 상단 여백 50% 축소 (8px → 4px) */
		font-size: 12px; /* 폰트 크기 축소 */
	}

	.form-input,
	.form-select {
		padding: 12px 15px;
		font-size: 14px;
		scroll-margin-top: 120px; /* 헤더 높이만큼 여백 확보 */
	}

	/* iOS Safari 자동 스크롤 방지 */
	.consultation-section {
		scroll-padding-top: 120px; /* 헤더 높이 고려 */
	}

	.phone-input-group {
		gap: 5px;
	}

	.phone-separator {
		font-size: 16px;
	}

	/* 거주지역 모바일 반응형 */
	.residence-select-group {
		flex-direction: column;
		gap: 10px;
	}

	.privacy-box {
		padding: 15px;
		max-height: 100px; /* 50% 축소 (200px → 100px) */
	}

	.privacy-content {
		font-size: 13px;
	}

	.submit-btn {
		padding: 15px 25px;
		font-size: 16px;
	}

	.success-message {
		padding: 40px 25px;
	}

	.success-icon {
		font-size: 60px;
	}

	.success-message h3 {
		font-size: 24px;
	}

	.success-message p {
		font-size: 14px;
	}
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
	.section-title {
		font-size: 24px;
	}

	.consultation-form {
		padding: 25px 15px;
	}

	/* 폼 필드 간격 더 축소 */
	.form-row {
		gap: 8px; /* 여백 더 축소 (10px → 8px) */
	}

	.form-label {
		font-size: 14px;
		margin-bottom: 4px; /* 라벨 하단 여백 더 축소 (5px → 4px) */
	}

	.error-message {
		margin-top: 3px; /* 에러 메시지 상단 여백 더 축소 (4px → 3px) */
		font-size: 11px; /* 폰트 크기 더 축소 */
	}

	.form-input,
	.form-select {
		padding: 10px 12px;
		scroll-margin-top: 100px; /* 헤더 높이만큼 여백 확보 */
	}

	/* iOS Safari 자동 스크롤 방지 */
	.consultation-section {
		scroll-padding-top: 100px; /* 헤더 높이 고려 */
	}

	.phone-input {
		font-size: 13px;
	}

	.privacy-box {
		max-height: 90px; /* 50% 축소 (180px → 90px) */
		padding: 12px;
	}

	.submit-btn {
		padding: 12px 20px;
		font-size: 15px;
	}
}
