/* Google Noto Sans KR 폰트 (필요시 임포트) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* Basic Reset & Font */
#appy-form-container {
    font-family: 'Noto Sans KR', sans-serif;
    color: #333;
    background-color: rgba(0, 0, 0, 0.5);
    line-height: 1.6;

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* 전체 높이 */
    overflow: auto; /* 폼 안에서만 스크롤 */
    z-index: 9999;

    display: none;
}

/* objfrm 폼 전체 스타일 */
.objfrm {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* 섹션 타이틀 */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    text-align: left;
}

/* 폼 섹션 간 여백 */
.form-section {
    margin-bottom: 40px;
    padding-top: 10px;
}

/* 폼 그룹 (레이블 + 입력 필드) */
.form-group {
    display: flex;
    flex-direction: column; /* 기본적으로 세로 배열 (모바일 우선) */
    margin-bottom: 20px;
    background-color: #fdfdfd;
    border-radius: 8px;
    border: 1px solid #eee;
    padding: 15px;
}

/* 두 컬럼으로 나누는 행 컨테이너 */
.form-row {
    display: flex;
    flex-wrap: wrap; /* 반응형을 위해 줄바꿈 허용 */
    gap: 20px; /* 각 폼 그룹 사이 간격 */
    margin-bottom: 20px;
}
.form-row > .form-group {
    flex: 1 1 calc(50% - 10px); /* 2개 컬럼 (간격 고려) */
    margin-bottom: 0; /* form-row가 간격 관리 */
}

/* 전체 너비를 사용하는 폼 그룹 */
.form-group.row-full {
    flex: 1 1 100%; /* 전체 너비 사용 */
}

/* 폼 레이블 */
.form-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: block; /* 블록 요소로 만들어 줄바꿈 */
    line-height: 1.4;
}

/* 폼 콘텐츠 (입력 필드, 라디오 버튼 등) */
.form-content {
    flex-grow: 1; /* 남은 공간을 채움 */
}

/* 입력 필드, select, textarea 스타일 */
.form-content input[type="text"],
.form-content select,
.form-content textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box; /* 패딩이 너비에 포함되도록 */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none; /* iOS Safari의 기본 스타일 제거 */
    -moz-appearance: none; /* Firefox의 기본 스타일 제거 */
    appearance: none; /* 기본 스타일 제거 (select 화살표 등) */
}

.form-content input[type="text"]:focus,
.form-content select:focus,
.form-content textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2);
    outline: none;
}

/* Textarea 지원 동기 */
.userApply {
    min-height: 120px; /* 최소 높이 */
    resize: vertical; /* 세로로만 크기 조절 가능 */
    line-height: 1.5;
}

/* 플레이스홀더 색상 */
::placeholder {
    color: #999;
    font-size: 0.9em;
}
:-ms-input-placeholder {
    color: #999;
    font-size: 0.9em;
}
::-ms-input-placeholder {
    color: #999;
    font-size: 0.9em;
}

/* 라디오 버튼 및 체크박스 */
.form-content input[type="radio"],
.agree input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
    transform: scale(1.15); /* 약간 크게 */
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #ccc;
    border-radius: 50%; /* 라디오 버튼은 원형 */
    width: 18px;
    height: 18px;
    outline: none;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0; /* 체크박스가 줄어들지 않도록 함 */
}

.agree input[type="checkbox"] {
    border-radius: 4px; /* 체크박스는 사각형 */
}

.form-content input[type="radio"]:checked,
.agree input[type="checkbox"]:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.form-content input[type="radio"]:checked::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
    margin: 3px;
}

.agree input[type="checkbox"]:checked::before {
    content: '\2713'; /* 체크 마크 (✔) */
    display: block;
    color: #fff;
    font-size: 12px;
    text-align: center;
    line-height: 16px; /* 높이와 맞춰 중앙 정렬 */
}

.form-content span {
    vertical-align: middle;
    margin-right: 15px; /* 라디오/체크박스 텍스트 간격 */
    font-size: 0.95rem;
    color: #333;
}

/* 특정 라디오 그룹의 줄바꿈 */
.form-content.partTime span {
    display: inline-block; /* 줄바꿈 후에도 인라인 블록 유지 */
    margin-bottom: 5px;
}
.form-content.partTime input[type="radio"] {
    margin-top: 10px; /* 라디오 버튼 위 여백 */
}

/* 교육정보 영역 */
.eduinfo {
    background-color: #e6f7ff;
    border: 1px solid #a8dadc;
    border-radius: 8px;
    padding: 15px 20px;
    line-height: 1.7;
    margin-top: 5px;
}
.eduinfo ul {
    list-style: none; /* 기본 리스트 스타일 제거 */
    padding: 0;
    margin: 0;
}
.eduinfo li {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #333;
}
.eduinfo li:last-child {
    margin-bottom: 0;
}

/* 안내 문구 */
.guide-text {
    font-size: 0.85rem;
    color: #777;
    line-height: 1.4;
    margin-top: 15px;
    background-color: #f7f7f7;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 3px solid #ccc;
}
.guide-text.ibm_p {
    color: #0056b3; /* IBM 관련 강조 색상 */
    font-weight: 500;
    border-left-color: #007bff;
    background-color: #eaf6ff;
}

/* 개인정보 동의 영역 */
.personal-info-agreement {
    margin-top: 50px; /* 섹션 간격 */
}

.agreement-content {
    background-color: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    max-height: 250px; /* 스크롤바를 위한 최대 높이 */
    overflow-y: auto; /* 내용이 넘치면 스크롤바 생성 */
    font-size: 0.9rem;
    line-height: 1.7;
    color: #555;
    margin-top: 10px;
}
.agreement-content p {
    margin-bottom: 10px;
    white-space: pre-line; /* 줄바꿈 유지 */
}
.agreement-content p:last-child {
    margin-bottom: 0;
}

/* 동의 체크박스 */
.agree {
    margin-top: 30px;
    text-align: center; /* 전체 블록은 중앙 정렬 */
    font-size: 1.1rem;
    display: flex; /* Flexbox 사용하여 내부 요소 정렬 */
    align-items: center; /* 세로 중앙 정렬 */
    justify-content: center; /* 가로 중앙 정렬 (내부 요소가 충분히 짧을 때) */
    color: #333;
    font-weight: 500;
    /* white-space: nowrap; /* 텍스트 줄바꿈 방지 (주의해서 사용) */
}
.agree span {
    margin-left: 8px; /* 체크박스와 텍스트 간격 조정 */
    flex-shrink: 0; /* 텍스트가 줄어들지 않도록 하여 한 줄 유지를 돕습니다. */
}

/* 제출 버튼 스타일 */
.submit-button {
    display: block; /* 블록 요소로 만들어 중앙 정렬 가능하게 함 */
    width: 200px; /* 버튼 너비 */
    padding: 15px 25px; /* 내부 여백 */
    margin: 40px auto 0; /* 중앙 정렬 및 상단 여백 */
    background-color: #007bff; /* 배경색 (파란색 계열) */
    color: #fff; /* 텍스트 색상 */
    font-size: 1.2rem;
    font-weight: 600;
    border: none; /* 테두리 없음 */
    border-radius: 8px; /* 둥근 모서리 */
    cursor: pointer; /* 마우스 오버 시 포인터 모양 */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease; /* 호버/클릭 효과를 위한 전환 */
    text-align: center;
    box-sizing: border-box; /* 패딩이 너비에 포함되도록 */
}

.submit-button:hover {
    background-color: #0056b3; /* 호버 시 약간 더 진한 파란색 */
    transform: translateY(-2px); /* 약간 위로 떠오르는 효과 */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* 그림자 효과 */
}

.submit-button:active {
    transform: translateY(0); /* 클릭 시 원래 위치로 돌아오는 효과 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #004085; /* 클릭 시 더 진한 파란색 */
}

/* 닫기 버튼 디자인 */
.close-btn {
    background: none;
    border: none;
    font-size: 3rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    float: right;
    margin-top: -4px;
    margin-right: 5px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.close-btn:hover {
    color: #333;
    transform: scale(1.2);
}

.required-mark {
    color: red;
    margin-left: 4px;
    font-weight: bold;
}

/* 이메일 특정 스타일 */
.email-input-group {
    display: flex;
    align-items: center; /* 세로 중앙 정렬 */
    gap: 8px; /* 요소 간 간격 */
    flex-wrap: wrap; /* 작은 화면에서 줄바꿈 허용 */
}

.email-input-group input[type="text"] {
    flex-grow: 1; /* 입력 필드가 늘어나도록 허용 */
    min-width: 100px; /* 입력 필드의 최소 너비 */
}

.email-input-group .at-sign {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    flex-shrink: 0; /* "@" 기호가 줄어들지 않도록 방지 */
}

.email-input-group select.userEmailDomainSelect {
    flex-grow: 1; /* 셀렉트 박스가 늘어나도록 허용 */
    min-width: 120px; /* 셀렉트 박스의 최소 너비 */
}

.email-input-group input.userEmailDomainDirect {
    flex-grow: 1; /* 직접 입력 필드가 늘어나도록 허용 */
    min-width: 120px; /* 직접 입력 필드의 최소 너비 */
}


/* 반응형 디자인 */
@media (max-width: 768px) {
    #appy-form-container {
        padding: 10px; /* 모바일에서 여백 */
    }

    .objfrm {
        padding: 20px;
        margin: 20px auto;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .form-group {
        padding: 12px;
        margin-bottom: 15px;
    }

    .form-row {
        flex-direction: column; /* 모바일에서 모든 폼 그룹을 세로로 정렬 */
        gap: 15px;
    }
    .form-row > .form-group {
        flex: 1 1 100%; /* 모바일에서는 항상 전체 너비 */
        margin-bottom: 0;
    }

    .form-label {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }

    .form-content input[type="text"],
    .form-content select,
    .form-content textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .form-content span {
        font-size: 0.85rem;
    }

    .eduinfo, .agreement-content {
        padding: 12px 15px;
        font-size: 0.85rem;
    }
    .eduinfo li {
        font-size: 0.88rem;
    }

    .guide-text {
        font-size: 0.78rem;
        padding: 8px 12px;
        margin-top: 10px;
    }

    /* 모바일에서 동의 체크박스 정렬 */
    .agree {
        font-size: 1rem;
        flex-direction: row; /* 모바일에서도 가로 정렬을 유지 */
        justify-content: center; /* 중앙 정렬 */
        align-items: center; /* 세로 중앙 정렬 */
        padding-left: 0; /* 모바일에서 추가 패딩 제거 */
        text-align: left; /* 텍스트 정렬 */
        flex-wrap: wrap; /* 공간 부족 시 줄바꿈 허용 */
    }
    .agree input[type="checkbox"] {
        margin-bottom: 0; /* 모바일에서 체크박스 하단 여백 제거 */
        flex-shrink: 0; /* 줄어들지 않도록 다시 명시 */
    }
    .agree span {
        margin-left: 8px; /* 체크박스와 텍스트 간격 유지 */
    }

    .submit-button {
        width: 180px; /* 모바일에서 버튼 너비 조정 */
        padding: 12px 20px;
        font-size: 1.1rem;
        margin-top: 30px;
    }

    /* 이메일 특정 모바일 스타일 */
    .email-input-group {
        flex-direction: column; /* 작은 화면에서 세로로 쌓이도록 */
        align-items: flex-start; /* 항목들을 시작점으로 정렬 */
        gap: 10px;
    }

    .email-input-group input[type="text"],
    .email-input-group select {
        width: 100%; /* 입력란과 셀렉트 박스 전체 너비 */
        min-width: auto; /* 최소 너비 제약 해제 */
    }

    .email-input-group .at-sign {
        margin-left: 0; /* 왼쪽 마진 제거 */
        text-align: left; /* "@" 기호 왼쪽 정렬 */
        width: 100%; /* 자체 라인에 있도록 전체 너비 차지 */
    }
}