/* 기본 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

/* 로그인 컨테이너 */
.login-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 로그인 카드 */
.login-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 48px 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    border: 1px solid #e9ecef;
}

/* 헤더 */
.login-header {
    text-align: left;
    margin-bottom: 40px;
}

.login-title {
    font-size: 32px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.login-subtitle {
    font-size: 16px;
    color: #6c757d;
    font-weight: 400;
}

/* 폼 스타일 */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #212529;
    margin-bottom: 6px;
}

/* 입력 아이콘 숨기기 */
.input-icon {
    display: none !important;
}

/* 사용자/자물쇠 아이콘 숨기기 */
.user-icon,
.lock-icon {
    display: none !important;
}

/* 입력 필드 래퍼 */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus {
    border-color: #495057;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(73, 80, 87, 0.1);
}

.form-input::placeholder {
    color: #adb5bd;
    font-size: 14px;
}

/* 비밀번호 토글 버튼 */
.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    z-index: 2;
}

.password-toggle:hover {
    background-color: #f1f3f4;
}

.eye-icon {
    width: 16px;
    height: 16px;
    color: #6c757d;
}

/* 비밀번호 input 패딩 조정 */
.input-wrapper.has-toggle .form-input {
    padding-right: 44px;
}

/* 로그인 버튼 */
.login-button {
    width: 100%;
    background: #212529;
    color: white;
    padding: 16px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    background: #343a40;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 37, 41, 0.2);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-text {
    transition: opacity 0.2s ease;
}

/* 로딩 상태 */
.login-button .loading-spinner { display: none; }
.login-button.loading .loading-spinner { display: inline-block; }
.login-button.loading .button-text { opacity: 0; }

/* 로딩 스피너 */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 푸터 */
.login-footer {
    margin-top: 32px;
    text-align: center;
}

.signup-text {
    font-size: 14px;
    color: #6c757d;
}

.signup-link {
    color: #212529;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.signup-link:hover {
    color: #495057;
    text-decoration: underline;
}

/* 에러 메시지 */
.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 6px;
    min-height: 20px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

.form-input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* 메시지 컨테이너 */
.message-container {
    margin-bottom: 24px;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-info {
    background-color: #cce7ff;
    color: #004085;
    border-color: #b8daff;
}

/* 반응형 디자인 */
@media (max-width: 640px) {
    body { 
        padding: 16px; 
    }
    
    .login-card { 
        padding: 32px 24px; 
        border-radius: 12px; 
    }
    
    .login-title { 
        font-size: 28px; 
    }
    
    .login-subtitle {
        font-size: 14px;
    }
    
    .form-input { 
        padding: 12px 14px; 
        font-size: 14px; 
    }
    
    .password-toggle { 
        right: 12px; 
    }
    
    .login-button { 
        padding: 14px 20px; 
        font-size: 15px; 
    }
}

@media (max-width: 480px) {
    .login-container {
        max-width: 100%;
    }
    
    .login-card {
        padding: 24px 20px;
    }
    
    .login-title {
        font-size: 24px;
    }
    
    .login-header {
        margin-bottom: 32px;
    }
}

/* 고대비 모드 */
@media (prefers-contrast: high) {
    .login-card { 
        background: #ffffff; 
        border: 2px solid #000000; 
    }
    
    .form-input { 
        border-color: #000000; 
    }
    
    .form-input:focus { 
        border-color: #000000; 
        box-shadow: 0 0 0 2px #000000; 
    }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
    body { 
        background: #121212; 
        color: #e0e0e0;
    }
    
    .login-card { 
        background: #1e1e1e; 
        border-color: #333333;
    }
    
    .login-title { 
        color: #ffffff; 
    }
    
    .login-subtitle { 
        color: #b0b0b0; 
    }
    
    .form-label { 
        color: #e0e0e0; 
    }
    
    .form-input { 
        background: #2a2a2a; 
        border-color: #404040; 
        color: #ffffff; 
    }
    
    .form-input:focus { 
        background: #333333; 
        border-color: #666666; 
    }
    
    .form-input::placeholder {
        color: #888888;
    }
    
    .signup-text { 
        color: #b0b0b0; 
    }
    
    .signup-link {
        color: #ffffff;
    }
    
    .signup-link:hover {
        color: #cccccc;
    }
    
    .password-toggle:hover {
        background-color: #333333;
    }
    
    .eye-icon {
        color: #b0b0b0;
    }
}