@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;700&display=swap');

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --error-color: #dc3545;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --border-color: #ced4da;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    margin: 0;
    padding: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* 콘텐츠가 위에서부터 시작하도록 변경 */
    min-height: 100vh;
    /* 뷰포트 높이만큼 최소 높이 확보 */
    padding: 20px;
    color: #333;
}

.container {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow-color);
    width: 100%;
    max-width: 800px;
}

/* 아래는 이전과 동일한 코드입니다. */
h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-weight: 700;
}

h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: #555;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
}

.form-section {
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.input-container {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #f8f9fa;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    background-color: #fff;
}

.input-container i {
    color: var(--secondary-color);
    margin-right: 10px;
    font-size: 1.1em;
}

input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 1em;
    padding: 0;
    outline: none;
}

.validation-message {
    font-size: 0.85em;
    margin-top: 5px;
    min-height: 1.2em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.validation-message.show {
    opacity: 1;
}

.validation-message.success {
    color: var(--success-color);
}

.validation-message.error {
    color: var(--error-color);
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #0056b3;
}

.email-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    /* 필드 간 간격 */
}

.email-input-group input[type="text"] {
    flex: 1;
    /* 가변 너비로 설정 */
}

.email-input-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    font-size: 1em;
}

/* ✅ 이메일 도메인 입력 필드를 기본적으로 숨깁니다. */
#email-domain {
    display: none;
}

/* memreg_style.css 파일 수정 */

/* 기존 spinner 관련 CSS를 아래와 같이 변경 */
.spinner {
    /* 기존 크기보다 크게 */
    width: 60px;
    /* 더 크게 */
    height: 60px;
    /* 더 크게 */
    border: 6px solid rgba(0, 0, 0, 0.2);
    /* 테두리 두께 조절 */
    border-top-color: var(--primary-color);
    /* 상단 테두리 색상 변경 (기본 파란색) */
    border-radius: 50%;
    animation: spin 0.8s ease-in-out infinite;
    /* 애니메이션 속도 및 방식 조절 */

    /* 페이지 중앙에 위치시키기 */
    position: fixed;
    /* 뷰포트 기준으로 위치 고정 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 정확히 중앙 정렬 */
    z-index: 1050;
    /* 모달(z-index 1000)보다 위에 오도록 */
    display: none;
    /* 기본적으로 숨김 */
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ⭐ 선택 사항: 로딩 오버레이 추가 ⭐ */
/* 스피너가 뜰 때 화면 전체를 어둡게 가리는 배경 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    /* 반투명 검정색 */
    z-index: 1040;
    /* 스피너보다 아래에 위치 */
    display: none;
    /* 기본적으로 숨김 */
    backdrop-filter: blur(2px);
    /* 배경 흐리게 (최신 브라우저 지원) */
}

/* PC 버전: 2열 레이아웃 */
@media (min-width: 768px) {
    .form-row {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .form-row .form-group {
        width: 48%;
    }

    .form-section>.form-group {
        width: 100%;
    }
}