/* ================================================================
   Contact 페이지 레이아웃
   ================================================================ */
#page-contact .snap-section {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important; 
    align-items: center !important;     
    min-height: 100vh !important;
    padding-top: 0 !important;          
    padding-bottom: 0 !important;
    box-sizing: border-box;
}

#page-contact .sub-header {
    padding-bottom: 20px; 
    margin-top: -40px; 
}
#page-contact .sub-header h1 {
    margin-bottom: 5px; 
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.contact-box {
    background: transparent !important;
    padding: 20px 0; 
    border-radius: 0;
    border: none !important;
    width: 100%;
}

/* ================================================================
   입력 그룹 설정
   ================================================================ */
.input-group {
    display: flex;
    flex-direction: row;
    align-items: center; 
    margin-bottom: 30px; 
    text-align: left;
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px 40px; 
    margin-bottom: 30px; 
}

.form-grid .input-group {
    margin-bottom: 0; 
}

.input-group label {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    width: auto; 
    min-width: 65px; 
    margin-right: 15px; 
    flex-shrink: 0;
    margin-bottom: 0;
    white-space: nowrap;
    line-height: 1.4;
}

.input-group label.req-label::after {
    content: '*';
    color: #ff2c2c;
    font-size: 14px;
    vertical-align: super;
    margin-left: 4px;
}

.input-group.align-top {
    align-items: flex-start !important; 
}

.input-group.align-top label {
    margin-top: 0 !important; 
    padding-top: 0 !important; 
    line-height: 1 !important; 
}

.contact-section-margin {
    margin-top: 40px !important;
    margin-bottom: 30px !important;
}

.textarea-group {
    margin-top: 40px !important;
}

/* ================================================================
   폼 요소 디자인
   ================================================================ */
input[type="text"] {
    flex: 1;
    width: 100%;
    padding: 10px 0; 
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #fff;
    font-size: 15px;
    border-radius: 0 !important; 
    transition: border-color 0.3s;
    outline: none;
    font-family: inherit;
    box-shadow: none !important;
}

/* [수정] 플레이스홀더 컬러 및 텍스트 크기 확대 (15px) */
input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 15px !important;
}

input[type="text"]:focus {
    border-bottom: 1px solid #ff2c2c !important;
}

select, textarea {
    flex: 1;
    width: 100%;
    padding: 14px 16px;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #fff;
    font-size: 15px;
    border-radius: 4px !important; 
    transition: border-color 0.3s;
    outline: none;
    font-family: inherit;
    box-shadow: none !important;
    resize: none;
}

select:focus, textarea:focus {
    border: 1px solid #ff2c2c !important;
}

.select-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: '▼';
    font-size: 12px;
    color: #aaa;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 35px;
}

select option {
    background: #1a1a1a;
    color: #fff;
}

/* ================================================================
   체크박스 및 정렬
   ================================================================ */
.privacy-agreement {
    display: flex;
    justify-content: center; 
    margin-top: 10px; 
    margin-bottom: 25px; 
    width: 100%;
}

.custom-checkbox {
    display: inline-flex;
    align-items: center; 
    justify-content: center;
    position: relative;
    cursor: pointer;
    font-size: 15.5px; 
    font-weight: 500;
    color: #d1d5db;
    user-select: none;
    line-height: 1; 
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px; 
    width: 20px;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    margin-right: 12px;
    flex-shrink: 0; 
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-text {
    display: inline-block;
    padding-top: 1px; 
}

.custom-checkbox:hover input ~ .checkmark {
    border-color: #ff2c2c;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #ff2c2c;
    border-color: #ff2c2c;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .req {
    color: #ff2c2c;
    margin-left: 6px;
}

/* ================================================================
   버튼 및 결과
   ================================================================ */
.contact-result {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    min-height: 20px; 
}

.contact-send-btn {
    width: 100%;
    margin-top: 0; 
    text-align: center;
    border-radius: 4px !important; 
    padding: 18px 0 !important;
    background: #ff2c2c !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.contact-send-btn:hover {
    background: #c72626 !important; 
}

/* 라이트모드 대응 */
body.light-mode input[type="text"] {
    border-bottom: 1px solid rgba(0, 0, 0, 0.3) !important;
    color: #1a1a1a !important;
}

body.light-mode input::placeholder {
    color: rgba(0, 0, 0, 0.3);
}

body.light-mode select, 
body.light-mode textarea {
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    color: #1a1a1a !important;
}

body.light-mode select option {
    background: #fff;
    color: #1a1a1a;
}

body.light-mode .input-group label {
    color: #1a1a1a !important; 
}

body.light-mode .custom-checkbox {
    color: #1a1a1a;
}

body.light-mode .checkmark {
    border-color: rgba(0, 0, 0, 0.3);
}

/* ================================================================
   [모바일 전용 최적화] - PC 버전 영향 없음
   ================================================================ */
@media (max-width: 768px) {
    /* 1. 스크롤 유도 마우스 아이콘 숨김 (Contact 페이지 활성화 시) */
    body:has(#page-contact.active) #scroll-hint-overlay {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    /* 2. 섹션 시작점 및 레이아웃 조정 */
    #page-contact .snap-section {
        justify-content: flex-start !important; /* 위에서부터 차곡차곡 쌓임 */
        padding-top: 100px !important;         /* 헤더 높이만큼 여백 확보 */
        padding-bottom: 60px !important;        /* 하단 여유 공간 */
        height: auto !important;                /* 내용에 따라 높이 가변 */
        min-height: 100dvh !important;
    }

    #page-contact .sub-header {
        margin-top: 0 !important;
        padding-bottom: 30px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .contact-container {
        padding: 0 20px !important; /* 좌우 여백 확보 */
    }

    .contact-box {
        padding: 10px 0 !important;
    }

    /* 3. 입력 필드 자동 크기 조절 (라벨과 입력을 세로로 배치) */
    .input-group {
        flex-direction: column !important; /* 가로 배열에서 세로 배열로 변경 */
        align-items: flex-start !important;
        margin-bottom: 25px !important;
    }

    .input-group label {
        margin-right: 0 !important;
        margin-bottom: 8px !important; /* 라벨과 입력창 사이 간격 */
        font-size: 15px !important;
    }

    /* 폼 그리드 간격 조정 */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important; /* 세로 배치이므로 그룹 간 간격은 input-group의 margin이 담당 */
    }

    .contact-section-margin, .textarea-group {
        margin-top: 10px !important;
    }

    /* 체크박스 텍스트 크기 최적화 */
    .custom-checkbox {
        font-size: 14px !important;
    }

    .checkbox-text {
        line-height: 1.4 !important;
    }

/* 전송 버튼 중앙 정렬 및 너비 조정 */
    .contact-send-btn {
        display: flex !important;           /* 내부 텍스트 정렬을 위해 flex 사용 */
        justify-content: center !important;
        align-items: center !important;
        
        width: 100% !important;             /* 가로를 꽉 채우되 */
        max-width: 280px !important;        /* index.css의 버튼 제한인 280px 유지 */
        margin: 20px auto 0 auto !important; /* 핵심: 위쪽 여백 20px, 좌우 margin auto로 중앙 정렬 */
        
        padding: 16px 0 !important;
        font-size: 16px !important;
    }
}