﻿/* ================================
   레이어 팝업 - 깔끔/모던 (전체)
   - 바깥 스크롤 X
   - 내부(.popup-contents)만 스크롤 O
   - 가로/세로 최대값 + 화면 비율(vw/vh)로 크기 결정
================================ */

/* 1) 오버레이(배경) */
.modal-wrap{
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;

	/* ✅ 화면 비율 기반 여백(최소/최대 제한) */
	/* 상하 여백: 6vh (최소 24px, 최대 72px) */
	/* 좌우 여백: 4vw (최소 16px, 최대 32px) */
	padding: clamp(24px, 6vh, 72px) clamp(16px, 4vw, 32px);

	background: rgba(0,0,0,0.55);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);

	/* ✅ 바깥 스크롤 제거(팝업 스크롤만) */
	overflow: hidden;
}

/* 2) 팝업 박스(컨테이너) */
.modal-contents{
	width: min(560px, 80vw);
	height: min(760px, 70vh);

	background: #fff;
	border-radius: 18px;
	box-shadow: 0 18px 60px rgba(0,0,0,0.35);

	/* ✅ 라운드 유지 핵심 */
	overflow: hidden;

	display: flex;
	flex-direction: column;
}

/* 3) 실제 스크롤 영역(폼 전체) */
.popup-contents{
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;

	padding: 22px 22px 18px 22px;
	line-height: 1.55;
	box-sizing: border-box;
}

/* 스크롤바(크롬/엣지) */
.popup-contents::-webkit-scrollbar{
	width: 8px;
}
.popup-contents::-webkit-scrollbar-track{
	background: transparent;
}
.popup-contents::-webkit-scrollbar-thumb{
	background: rgba(0,0,0,0.25);
	border-radius: 999px;
}
.popup-contents::-webkit-scrollbar-thumb:hover{
	background: rgba(0,0,0,0.35);
}

/* 4) 입력 블록 */
.popup-contents .required{
	margin-bottom: 10px;
}

.popup-contents .input_box{
	margin: 12px 0;
}

.popup-contents .sub_tit{
	display: block;
	margin: 0 0 8px 0;
	font-size: 14px;
	font-weight: 700;
	color: #222;
	letter-spacing: -0.2px;
}

/* 5) 인풋/셀렉트/텍스트영역 */
.popup-contents .ctn input[type="text"],
.popup-contents .ctn select,
.popup-contents .ctn textarea{
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #e6e8ef;
	background: #fafbff;
	border-radius: 12px;
	padding: 12px 12px;
	font-size: 14px;
	color: #111;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.popup-contents .ctn textarea{
	min-height: 92px;
	resize: vertical;
	line-height: 1.5;
}

.popup-contents .ctn input::placeholder{
	color: #9aa3b2;
}

.popup-contents .ctn input[type="text"]:focus,
.popup-contents .ctn select:focus,
.popup-contents .ctn textarea:focus{
	border-color: #8aa6ff;
	background: #ffffff;
	box-shadow: 0 0 0 4px rgba(138,166,255,0.18);
}

/* 셀렉트 화살표 */
.popup-contents .ctn select{
	appearance: none;
	-webkit-appearance: none;
	padding-right: 40px;
	background-image:
		linear-gradient(45deg, transparent 50%, #6b7485 50%),
		linear-gradient(135deg, #6b7485 50%, transparent 50%),
		linear-gradient(to right, transparent, transparent);
	background-position:
		calc(100% - 18px) calc(50% - 2px),
		calc(100% - 12px) calc(50% - 2px),
		0 0;
	background-size:
		6px 6px,
		6px 6px,
		100% 100%;
	background-repeat: no-repeat;
}

/* 6) 체크박스 칩 */
.popup-contents .input_box .ctn{
	position: relative;
}

.popup-contents .input_box:last-of-type .ctn{
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* 체크박스 숨기기 */
.popup-contents .ctn input[type="checkbox"]{
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

/* 칩(라벨) */
.popup-contents .ctn label{
	display: inline-flex;
	align-items: center;
	justify-content: center;

	padding: 10px 12px;
	border-radius: 999px;
	border: 1px solid #e6e8ef;
	background: #fff;

	font-size: 13px;
	color: #333;
	cursor: pointer;
	user-select: none;

	transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}

/* 체크 스타일: checkbox(checked) + hidden + label */
.popup-contents .ctn input[type="checkbox"]:checked + input[type="hidden"] + label{
	border-color: #8aa6ff;
	background: rgba(138,166,255,0.12);
	box-shadow: 0 6px 18px rgba(138,166,255,0.20);
}

.popup-contents .ctn label:active{
	transform: scale(0.98);
}

/* 7) reCAPTCHA 안내 */
.recaptcha-notice{
	margin-top: 10px;
	font-size: 12.5px;
	color: #444;
}

.recaptcha-notice a{
	color: #3a63ff;
	text-decoration: none;
	font-weight: 700;
}

.recaptcha-notice a:hover{
	text-decoration: underline;
}

/* 8) 버튼 영역(하단 고정) */
.popup-contents .modal-btn-wrap{
	display: flex;
	gap: 10px;

	margin-top: 16px;
	padding: 14px 0 0 0;
	border-top: 1px solid #eef0f6;

	/* ✅ 스크롤 내려도 버튼은 아래에 붙어있게 */
	position: sticky;
	bottom: 0;
	background: #fff;

	/* ✅ iOS에서 바닥 답답함 방지(버튼 아래 살짝 공간) */
	padding-bottom: 10px;
}

.modal-btn-wrap .modal-btn{
	flex: 1;
	height: 44px;
	border-radius: 12px;
	border: 1px solid #e6e8ef;
	background: #fff;

	font-size: 14px;
	font-weight: 800;
	color: #222;

	cursor: pointer;
	transition: transform .1s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}

.modal-btn-wrap .modal-btn.submit{
	border-color: transparent;
	background: linear-gradient(135deg, #3a63ff, #7b61ff);
	color: #fff;
	box-shadow: 0 10px 24px rgba(58,99,255,0.28);
}

.modal-btn-wrap .modal-btn:hover{
	box-shadow: 0 10px 26px rgba(0,0,0,0.10);
}

.modal-btn-wrap .modal-btn.submit:hover{
	box-shadow: 0 14px 30px rgba(58,99,255,0.32);
}

.modal-btn-wrap .modal-btn:active{
	transform: translateY(1px);
}

/* 9) 모바일(세로) - 여백/패딩 좀 더 확보 */
@media (max-width: 420px){
	.modal-contents{
		/* ✅ 모바일은 살짝 더 낮게: 위아래 여백 체감 증가 */
		height: min(740px, 84vh);
		border-radius: 16px;
	}

	.popup-contents{
		padding: 20px 16px 18px 16px;
	}

	.popup-contents .input_box{
		margin: 10px 0;
	}

	.popup-contents .ctn label{
		padding: 9px 10px;
		font-size: 12.5px;
	}
}

/* 10) 가로모드(높이 낮은 환경) - 더 낮게 잡아서 버튼 안 잘리게 */
@media (max-height: 560px){
	.modal-contents{
		height: min(680px, 82vh);
	}
	.popup-contents .ctn textarea{
		min-height: 72px;
	}
}

/* 11) 모션 최소화 설정 */
@media (prefers-reduced-motion: reduce){
	*{
		transition: none !important;
	}
}