
/* 기존 스타일 유지 */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f7fa;
    --text-color: #333;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
}

body {
    font-family: 'Noto Sans KR', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.login-container {
    background-color: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2rem;
}

form {
    display: flex;
    flex-direction: column;
}

.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

input, button {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    height: 50px; /* 고정 높이 설정 */
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

button:hover {
    background-color: #3a7bd5;
}

button:active {
    transform: scale(0.98);
}

#message {
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
}

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

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

.loading {
    display: none;
    text-align: center;
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 500;
}

.find-account-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.find-account-link a {
    color: var(--primary-color);
    text-decoration: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 12px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.find-account-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.find-account-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 12px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

/* 모달 기본 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* 스크롤 가능하도록 설정 */
    overflow-y: auto;
    padding: 20px 0;
    box-sizing: border-box;
}

/* 모달 콘텐츠 */
.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    position: relative;
    /* 최대 높이 설정 및 스크롤 */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    /* 중앙 정렬을 위한 추가 설정 */
    top: 50%;
    transform: translateY(-50%);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .modal {
        padding: 10px 0;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
        padding: 20px;
        margin: 20px auto;
        max-height: calc(100vh - 20px);
        /* 모바일에서는 상단에서 시작 */
        top: 0;
        transform: none;
        margin-top: 10px;
    }
}

/* 작은 화면에서 추가 조정 */
@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
        margin: 10px auto;
    }
    
    .modal-content h2 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
    
    .input-group {
        margin-bottom: 15px;
    }
    
    .input-group label {
        font-size: 0.9em;
    }
    
    .input-group input {
        padding: 10px;
        font-size: 14px;
    }
    
    button[type="submit"] {
        padding: 12px;
        font-size: 14px;
    }
}

/* 닫기 버튼 */
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
    z-index: 1001;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

/* 모달 내부 폼 스타일 */
.modal .input-group {
    margin-bottom: 20px;
}

.modal .input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.modal .input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.modal .input-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.modal button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.modal button[type="submit"]:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* 메시지 영역 */
.modal #findIdMessage,
.modal #resetPasswordMessage {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

/* 성공 메시지 */
.modal .success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 오류 메시지 */
.modal .error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 스크롤바 스타일 (웹킷 브라우저) */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}





:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f7fa;
    --text-color: #333;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
}

body {
    font-family: 'Noto Sans KR', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px 0;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.login-container {
    background-color: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2rem;
}

form {
    display: flex;
    flex-direction: column;
}

.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

input, button {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    height: 50px;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

button:hover:not(:disabled) {
    background-color: #3a7bd5;
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

#message {
    margin-top: 1rem;
    text-align: center;
    font-weight: 500;
}

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

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

.warning {
    color: var(--warning-color);
}

.loading {
    display: none;
    text-align: center;
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* 계정 찾기 링크 */
.account-recovery {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.recovery-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    margin: 0 0.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.recovery-link:hover {
    color: #3a7bd5;
    text-decoration: underline;
}

/* 모달 공통 스타일 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 10px 0;
}

.modal-content {
    background-color: white;
    margin: 1% auto;
    padding: 1.5rem;
    border-radius: 12px;
    width: 95%;
    max-width: 420px;
    min-width: 300px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: auto;
    height: auto;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--error-color);
}

.recovery-form {
    display: flex;
    flex-direction: column;
}

.recovery-input-group {
    margin-bottom: 0.7rem;
}

.recovery-input-group:last-of-type {
    margin-bottom: 1rem;
}

.recovery-input-group label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.recovery-input-group input {
    height: 42px;
    font-size: 0.9rem;
    padding: 0.6rem;
}

.recovery-result {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.4;
}

.recovery-result.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.recovery-result.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.recovery-result.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.recovery-info {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #1565c0;
}

.recovery-info h4 {
    margin: 0 0 0.4rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.recovery-info ul {
    margin: 0.4rem 0 0 1rem;
    padding: 0;
}

.recovery-info li {
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

/* SMS 인증 관련 스타일 - 컴팩트하게 */
.phone-input-group {
    display: flex;
    gap: 0.4rem;
    align-items: flex-end;
}

.phone-input-group input {
    flex: 1;
}

.phone-input-group button {
    width: auto;
    min-width: 85px;
    padding: 0.6rem 0.7rem;
    font-size: 0.85rem;
    height: 42px;
}

.sms-auth-section {
    display: none;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.7rem;
    margin-top: 0.6rem;
}

.sms-auth-section.show {
    display: block;
}

.auth-input-group {
    display: flex;
    gap: 0.4rem;
    align-items: flex-end;
    margin-bottom: 0.4rem;
}

.auth-input-group input {
    flex: 1;
    height: 38px;
    font-size: 0.85rem;
}

.auth-input-group button {
    width: auto;
    min-width: 75px;
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
    height: 38px;
}

.auth-timer {
    font-size: 0.75rem;
    color: var(--warning-color);
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.auth-status {
    font-size: 0.75rem;
    font-weight: 500;
}

.auth-verified {
    border-color: var(--success-color) !important;
    background-color: #f8fff9 !important;
}

.btn-success {
    background-color: var(--success-color);
}

.btn-success:hover:not(:disabled) {
    background-color: #27ae60;
}

/* 모달 내 버튼 크기 조정 */
.recovery-form button[type="submit"] {
    height: 42px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .modal {
        padding: 5px 0;
    }
    
    .modal-content {
        width: 98%;
        padding: 1.2rem;
        margin: 0.5% auto;
        max-height: 98vh;
    }
    
    .modal-title {
        font-size: 1.2rem;
    }
    
    .recovery-info {
        font-size: 0.8rem;
        padding: 0.6rem;
    }
    
    .recovery-input-group {
        margin-bottom: 0.6rem;
    }
    
    .phone-input-group {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .phone-input-group button {
        width: 100%;
        min-width: auto;
    }
    
    .auth-input-group {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .auth-input-group button {
        width: 100%;
        min-width: auto;
    }
}

@media (max-height: 600px) {
    .modal {
        padding: 2px 0;
    }
    
    .modal-content {
        margin: 0.2% auto;
        max-height: 99vh;
        padding: 1rem;
    }
    
    .recovery-info {
        padding: 0.5rem;
        margin-bottom: 0.7rem;
    }
    
    .recovery-input-group {
        margin-bottom: 0.5rem;
    }
    
    .modal-header {
        margin-bottom: 0.7rem;
        padding-bottom: 0.5rem;
    }
}

/* 스크롤바 스타일링 */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}