/* ⭐ html, body에 높이 100%를 주어 화면 중앙 정렬을 보강합니다. */
html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f2f5;
}
.form-container {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 90%; /* 화면 너비의 90%를 차지하도록 변경 */
    max-width: 400px; /* PC 화면에서도 최대 400px를 넘지 않도록 제한 */
    box-sizing: border-box; /* 패딩을 너비 계산에 포함 (중요) */
    text-align: center;
    animation: none;
    transition: none;
}
h1 {
    font-size: 26px;
    margin-top: 0;
    margin-bottom: 30px;
    color: #333;
}
.input-group { margin-bottom: 20px; }
input[type="text"], input[type="password"], input[type="number"], .password-reset-page input[type="email"], .email-setup-page input[type="email"] {
    box-sizing: border-box; width: 100%; padding: 14px;
    border: 1px solid #ccc; border-radius: 6px; font-size: 16px;
}
input:focus {
    border-color: #007bff; outline: none; box-shadow: 0 0 0 2px rgba(0,123,255,.25);
}

button {
    width: 100%; padding: 14px; border: none; border-radius: 6px;
    cursor: pointer; font-size: 16px; font-weight: bold; transition: background-color 0.2s;
}
/* ⭐⭐ 이 부분만 수정되었습니다: button#login_button → button#loginBtn ⭐⭐ */
button#loginBtn, button#signup_button {
    background-color: #007bff; color: white;
}
button:disabled { background-color: #a0c3e6; cursor: not-allowed; }

.secondary-link {
    display: block; margin-top: 15px; text-decoration: none;
    color: #6c757d; font-weight: 500;
}
.forgot-password {
    text-align: center; margin-top: 20px; font-size: 14px; color: #6c757d;
}
.forgot-password a { color: #007bff; text-decoration: none; font-weight: 500; }

.consent-container {
    border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 15px; margin: 25px 0;
}
.consent-group {
    display: flex; align-items: center; text-align: left;
    margin-bottom: 10px; font-size: 1rem;
}
.consent-group label { flex-grow: 1; display: flex; align-items: center; }
.consent-group input[type="checkbox"] { width: 20px; height: 20px; margin-right: 10px; }
.view-terms-link { color: #888; font-size: 0.9rem; margin-left: auto; }

.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 2000;
}
.modal-content {
  background-color: white; padding: 25px; border-radius: 8px;
  width: 90%; max-width: 500px; max-height: 80vh; overflow-y: auto;
}
.modal-content h2 { font-size: 1.5rem; margin-top: 0; }
.modal-content #terms-body { line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.modal-actions button { width: auto; padding: 10px 30px; background-color: #007bff; color: white;}

.hidden { display: none !important; }

/* --- 버튼 누름 효과 추가 --- */

/* 모든 버튼에 부드러운 전환 효과를 미리 적용합니다.
  기존 background-color 외에 transform 효과도 추가합니다.
*/
button {
    transition: transform 0.1s ease, background-color 0.2s;
}

/* 비활성화되지 않은 버튼을 마우스로 누르는 순간(active 상태)에
  크기를 살짝 줄여 눌리는 느낌을 줍니다.
*/
button:not(:disabled):active {
    transform: scale(0.97);
}

/* 중앙 알림 메시지 스타일 */
#notification-container {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999; /* ⭐ z-index를 매우 높게 설정하여 항상 위에 보이도록 함 */
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; pointer-events: none;
}
.notification {
    padding: 12px 25px; border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    transform: translateY(20px);
    font-size: 1.1rem; font-weight: 500; color: white; text-align: center;
    word-break: keep-all;
}
.notification.success { background-color: #28a745; }
.notification.error { background-color: #dc3545; }
.notification.info { background-color: #343a40; }
.notification.show { opacity: 1; transform: translateY(0); }

/* 입력 필드 유효성 검사 실패 시 */
.input-row input.is-invalid,
.input-row textarea.is-invalid {
    border-color: #dc3545; /* 빨간색 테두리 */
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* 가입하기 버튼 비활성화 시 스타일 (약관 동의 필요) */
#signup_button.disabled-terms {
    background-color: #6c757d; /* 회색 */
    cursor: not-allowed;
}

/* 로딩 중 버튼 스타일 (버튼 텍스트가 '가입 처리 중...' 일 때) */
#signup_button.loading {
    background-color: #007bff; /* 로딩 중임을 나타내는 색상 */
    cursor: wait;
    position: relative;
    overflow: hidden; /* 스피너가 버튼 밖으로 나가지 않도록 */
    text-indent: -9999px; /* 텍스트 숨기기 */
}

/* (선택 사항) 버튼 내부에 스피너 추가 예시 (더 복잡한 CSS) */
#signup_button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.5em;
    height: 1.5em;
    margin-top: -0.75em;
    margin-left: -0.75em;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 420px) {
    /* 로그인/회원가입 제목 크기 미세 조정 */
    .form-container h1 {
        font-size: 22px; /* 기존 26px에서 살짝 줄임 */
    }

    /* 링크들이 어색하게 줄바꿈되는 현상 방지 */
    .forgot-password a,
    .view-terms-link {
        white-space: nowrap;
    }
}
/* Public login footer. */
body.login-page {height:auto;min-height:100vh;padding:24px 0;box-sizing:border-box;}
.login-footer {margin-top:28px;font-size:12px;line-height:1.6;color:#6c757d;}
.login-footer a {color:#52677c;text-decoration:underline;}
.login-footer p {margin:8px 0 0;font-size:11px;}

.email-setup-page #email-status { overflow-wrap: anywhere; }
.email-setup-page #check-email { margin-top: 12px; }

.email-setup-page #send-email[hidden], .email-setup-page #email-send-status[hidden] {display:none;}
.email-setup-page #email-send-status {line-height:1.6;overflow-wrap:anywhere;margin:16px 0;}

.password-reset-page #reset-status { white-space:pre-line;line-height:1.6; }

.password-reset-page .form-container > p { text-align:left; }
