
/* ======================== */
/* 공통 요소 초기화 및 스타일 */
/* ======================== */

input,
textarea,
.custom-select {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px;
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--color-input-surface-gray);
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-gray);
}

input:hover,
textarea:hover,
.custom-select:hover {
    border: 1px solid var(--color-input-hover);
}

input:focus,
textarea:focus,
.custom-select:focus {
    outline: 1px solid transparent;
    border: 1px solid var(--color-input-focus);
    background-color: var(--color-surface-white);
}

input:focus-visible,
textarea:focus-visible,
.custom-select:focus-visible {
    outline-color: transparent;
}

input:disabled,
textarea:disabled,
.custom-select:disabled {
    background-color: var(--color-background-disabled);
    cursor: not-allowed;
    opacity: 0.7;
}

.input-error:focus,
.select-error:focus,
.checkbox-error:focus,
.input-error:hover,
.select-error:hover,
.checkbox-error:hover {
    border-color: var(--color-text-red) !important;
    outline: none !important;
    box-shadow: none !important;
    background-color: var(--color-surface-white) !important;
}

.input-error {
    border: 1px solid var(--color-text-red) !important;
    color: #222!important;
}

label,
legend {
    color: var(--color-text-gray-darker) !important;
}

.required {
    color: var(--color-text-red);
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin-bottom: 56px;
}

/* 에러 */
.error-message {
    color: var(--color-text-red);
    display: block; /* 기본은 보이게 */
}

.hidden {
    display: none;
}



/* ======================== */
/*         섹션 구조         */
/* ======================== */

.contact-container {
    width: 100%;
    max-width: clamp(328px, 91.3vw, 1320px);
    margin: 0 auto;
    padding: 160px 0;
}

.section_tit_keyword {
    margin-bottom: var(--gap-56);
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: var(--gap-40);
    margin-bottom: var(--gap-56);
    
    position: relative;
    z-index: 1;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 40px 56px;
}


.form-field {
    position: relative;
}



.form-row .form-field,
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--gap-8);
    flex: 1 1 0;
    min-width: 280px;
}

.form-field.full-width {
    flex: 1 1 100%;
}





/* ======================== */
/*        텍스트 영역        */
/* ======================== */

#details {
    height: 200px;
    overflow-y: auto;
    resize: none;
    font-family: var(--font-spoqa-han-sans-neo), sans-serif !important;
}

textarea#details::-webkit-scrollbar {
    width: 8px;
}

textarea#details::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
}

textarea#details::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 4px;
}




/* ======================== */
/*     커스텀 셀렉트 박스    */
/* ======================== */

.custom-select {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.select-display {
    font-size: 16px;
    color: var(--color-text-gray);
}

.select-display.selected {
    color: var(--color-text-gray-darker);
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--color-surface-white);
    border: 1px solid #ccc;
    border-radius: var(--radius-small);
    max-height: 250px;
    overflow-y: auto;
    z-index: 10;
    list-style: none;
    margin-top: var(--gap-8);
    padding: 4px 0;
}

.custom-select[aria-expanded="true"] .select-options {
    display: block;
}

.select-options li {
    padding: 0 20px;
    height: 60px;
    font-weight: 400;
    color: var(--color-text-gray-darker);
    align-content: center;
}

.select-options li:hover {
    background-color: var(--color-surface-gray);
}

.select-options li.selected-option {
    font-weight: 700;
}

.custom-select img,
.select-box img {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    pointer-events: none;
    transition: transform 0.3s ease-in-out;
}

.custom-select[aria-expanded="true"] img {
    transform: translateY(-50%) rotate(180deg);
}

.select-box .select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Webkit 스크롤바 스타일 */
.select-options::-webkit-scrollbar {
    width: 4px;
}

.select-options::-webkit-scrollbar-thumb {
    background-color: #ccc; /* 스크롤바 손잡이 색 */
    border-radius: 4px;
}

.select-options::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

.select-options::-webkit-scrollbar-track {
    background-color: transparent;/* 스크롤바 배경 */
}





/* ======================== */
/*        체크박스 그룹      */
/* ======================== */

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.check {
    margin-bottom: var(--gap-24);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 60px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: var(--gap-8);
    width: 200px;
    cursor: pointer;
}

/* 체크박스 input 숨김 */
.custom-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* 체크박스 스타일 박스 */
.checkbox-box {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 1px solid transparent;
    border-radius: var(--radius-xsmall);
    background-color: var(--color-input-surface-gray);
    position: relative;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

/* hover 시 테두리 강조 */
.checkbox-group label:hover .checkbox-box {
    border-color: var(--color-input-hover);
}

/* 체크 아이콘 이미지 (기본 숨김) */
.checkbox-box img {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* 체크됐을 때 체크박스 박스 스타일 */
input[type="checkbox"]:checked + .checkbox-box {
    background-color: var(--color-element-primary-dark);
    border-color: var(--color-element-primary-dark);
}

/* 체크됐을 때 체크 아이콘 이미지 표시 */
.custom-checkbox input[type="checkbox"]:checked + .checkbox-box img {
    display: block;
}

/* 비활성화 상태 */
.checkbox-group input[type="checkbox"]:disabled + .checkbox-box {
    background-color: var(--color-background-disabled);
    cursor: not-allowed;
    opacity: 0.7;
}





/* ======================== */
/*        라디오버튼         */
/* ======================== */

.custom-radio {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    width: 200px;
    margin-right: 16px;
}

.custom-radio input[type="radio"] {
    display: none;
}

.radio-box {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    
    width: 24px;
    height: 24px;
    margin-right: 8px;
    
    background-color: var(--color-input-surface-gray);
    border: none;
    border-radius: 50%;
    
    box-shadow: 0 0 0 1px transparent;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    
}

.custom-radio input[type="radio"]:checked + .radio-box {
    background-color: var(--color-element-white);
    box-shadow: 0 0 0 2px var(--color-border-primary-dark); /* 보더 대신 쉐도우 사용 */
}

.custom-radio input[type="radio"]:checked + .radio-box::after {
    content: '';
    
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    width: 12px;
    height: 12px;
    background-color: var(--color-border-primary-dark);
    border-radius: 50%;
}





/* ======================== */
/*     개인정보 동의 영역    */
/* ======================== */

.privacy-check {
    display: flex;
    flex-direction: column;
    gap: var(--gap-8);
    
}

.privacy-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1; /* 버튼 밀어내기 */
    min-width: 200px;
}


.privacy-check label {
    display: flex;
    align-items: center;
    gap: var(--gap-8);
    cursor: pointer;
    width: 100%;
}

.privacy-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    appearance: none;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.privacy-check input[type="checkbox"]:hover {
    border-color: var(--color-input-hover);
}

.privacy-check input[type="checkbox"]:focus {
    border-color: var(--color-input-focus);
    box-shadow: 0 0 0 2px rgba(140, 130, 212, 0.2);
}

.privacy-check input[type="checkbox"]:disabled {
    background-color: var(--color-background-disabled);
    cursor: not-allowed;
    opacity: 0.7;
}

.privacy-check input[type="checkbox"]:checked {
    border-color: var(--color-primary-purple);
    background-color: var(--color-primary-purple);
}

.privacy-check input[type="checkbox"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 6px;
    border: 2px solid #fff;
    border-top: none;
    border-right: none;
    transform: translate(-50%, -50%) rotate(-45deg);
    margin-top: -1px;
}

.privacy-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.privacy-check > .error-message {
    flex-basis: 100%; /* 한 줄 전체 너비 */
    margin-top: 4px;
    color: #FA4D3D; /* 에러 색상 */
}


.custom-checkbox:hover .checkbox-box {
    border-color: var(--color-input-hover);
}

.btn-m {
    display: none;
}





/* ======================== */
/*           버튼           */
/* ======================== */

.submit-button-wrapper {
    display: flex;
    justify-content: center;
}
