import { useState } from 'react' import { View, Text, TextInput, TouchableOpacity, StyleSheet, KeyboardAvoidingView, Platform, ActivityIndicator, Alert, ScrollView, } from 'react-native' import { useAuth } from '../../hooks/useAuth' import { COLORS } from '../../constants/Config' export default function LoginScreen() { const { login } = useAuth() const [username, setUsername] = useState('') const [password, setPassword] = useState('') const [loading, setLoading] = useState(false) const handleLogin = async () => { if (!username.trim() || !password.trim()) { Alert.alert('입력 오류', '아이디와 비밀번호를 입력해주세요.') return } setLoading(true) try { await login(username.trim(), password) } catch (e: any) { const msg = e.response?.data?.detail ?? '로그인에 실패했습니다.' Alert.alert('로그인 실패', msg) } finally { setLoading(false) } } return ( {/* 로고 영역 */} 🛡️ GUARDiA AI 인프라 자율 운영 플랫폼 (주)지오정보기술 {/* 로그인 카드 */} 로그인 아이디 비밀번호 {loading ? : 로그인 } GUARDiA ITSM 계정으로 로그인합니다 v1.0.0 · zioinfo.co.kr ) } /* Variant 스타일 로그인 — 딥네이비 배경 + 흰 카드 */ const s = StyleSheet.create({ container: { flex: 1, backgroundColor: '#001530' }, inner: { flexGrow: 1, justifyContent: 'center', padding: 28 }, logoBox: { alignItems: 'center', marginBottom: 36 }, logoIcon: { fontSize: 52, marginBottom: 10 }, logoTitle: { fontSize: 34, fontWeight: '900', color: '#fff', letterSpacing: 1.5 }, logoSub: { fontSize: 13, color: 'rgba(0,160,200,.85)', marginTop: 5 }, badge: { marginTop: 10, backgroundColor: 'rgba(0,160,200,.15)', borderWidth: 1, borderColor: 'rgba(0,160,200,.3)', paddingHorizontal: 14, paddingVertical: 5, borderRadius: 20, }, badgeText: { color: '#00A0C8', fontSize: 11, fontWeight: '700' }, card: { backgroundColor: '#fff', borderRadius: 20, padding: 28, shadowColor: '#001530', shadowOffset: { width: 0, height: 12 }, shadowOpacity: 0.25, shadowRadius: 32, elevation: 10, }, cardTitle: { fontSize: 18, fontWeight: '800', color: '#003366', marginBottom: 22, textAlign: 'center', letterSpacing: -0.3, }, field: { marginBottom: 16 }, label: { fontSize: 11, fontWeight: '700', color: '#00A0C8', marginBottom: 6, textTransform: 'uppercase', letterSpacing: .6 }, input: { borderWidth: 1.5, borderColor: '#E2E8F0', borderRadius: 12, padding: 14, fontSize: 15, color: '#1E293B', backgroundColor: '#F8FAFC', }, btn: { backgroundColor: '#00A0C8', borderRadius: 12, padding: 16, alignItems: 'center', marginTop: 8, shadowColor: '#00A0C8', shadowOffset: { width: 0, height: 4 }, shadowOpacity: .3, shadowRadius: 10, elevation: 4, }, btnDisabled: { opacity: .6 }, btnText: { color: '#fff', fontSize: 16, fontWeight: '800', letterSpacing: 0.3 }, hint: { textAlign: 'center', color: '#64748B', fontSize: 12, marginTop: 16 }, version: { textAlign: 'center', color: 'rgba(0,160,200,.4)', fontSize: 11, marginTop: 24 }, })