/* --- 데스크톱 기본 스타일 --- */
.signup-container {
    background: #ffffff;
    width: 360px;
    max-width: 100%; /* 추가: 모바일에서 화면을 넘어가지 않도록 */
    box-sizing: border-box; /* 추가: 패딩을 너비에 포함 */
    padding: 20px 20px;
    margin: auto;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
.loading-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.signup-container h2 {
    text-align: center;
    margin-bottom: 18px;
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.form-group {
    /* 수정: 고정 높이(height) 대신 최소 높이(min-height) 사용 (에러 메시지 잘림 방지) */
    min-height: 57px; 
    height: auto;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-group label {
    width: 110px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-top: 8px; /* 추가: 텍스트 상자와 시각적 높이 맞춤 */
}

/* 폼 그룹 내부 div (로그인) 및 input-wrapper (회원가입) 공통 처리 */
.form-group > div,
.input-wrapper {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
}

.form-group input, 
.form-group select,
.form-group .input-wrapper input,
.form-group .input-wrapper select {
    width: 100%; /* 수정: flex: 1 대신 width: 100% 로 꽉 채움 */
    box-sizing: border-box; /* 추가: 삐져나감 방지 */
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.password-confirm-btn {
    font-size: 11px;
    margin-top: 5px;
}

.signup-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    border: none;
    border-radius: 10px;
    background-color: #fdecef;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.signup-btn:hover {
    background-color: #fde2e7;
}

.extra-links,
.find-links {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
}

.extra-links a {
    color: #4a90e2;
    text-decoration: none;
}

.find-links a {
	color: #333;
    text-decoration: none;
}

.extra-links a:hover,
.find-links a:hover {
    text-decoration: underline;
}

.error-message {
    color: #e74c3c;
    font-size: 10px;
    margin-top: 4px;
    display: block;
    word-break: keep-all; /* 모바일에서 에러 텍스트 줄바꿈 깔끔하게 */
}

.input-error {
    border-color: #e74c3c !important;
}

.form-group input::placeholder {
    font-size: 12px;
    color: #999;
}

/* ========================================================
   모바일 환경 (화면 너비 480px 이하)을 위한 미디어 쿼리
======================================================== */
@media screen and (max-width: 480px) {
    .signup-container {
        width: 92%; /* 화면 양옆에 살짝 여백을 둠 */
        padding: 25px 15px;
    }

    .form-group {
        flex-direction: column; /* 라벨과 인풋을 가로에서 세로(위아래) 배치로 변경 */
        align-items: stretch;
        gap: 4px;
        margin-bottom: 16px; /* 모바일은 폼 간격을 조금 더 넒게 */
        min-height: auto;
    }

    .form-group label {
        width: 100%;
        margin-top: 0;
        font-size: 13px;
        margin-bottom: 2px;
    }

    .form-group input, 
    .form-group select,
    .form-group .input-wrapper input,
    .form-group .input-wrapper select {
        padding: 10px; /* 모바일 환경에서 터치하기 쉽게 패딩 확대 */
        font-size: 15px; /* 글씨 크기도 살짝 키워서 타이핑하기 쉽게 */
    }

    .signup-btn {
        padding: 14px; /* 버튼도 터치 영역 확보 */
        font-size: 16px;
        margin-top: 15px;
    }
}