:root {
    /* 모던 AI 테마 색상 - 다크 모드 기반 */
    --bg-gradient-start: #0f172a; /* Slate 900 */
    --bg-gradient-end: #1e1b4b;   /* Indigo 950 */
    --primary-color: #6366f1;     /* Indigo 500 */
    --primary-hover: #4f46e5;     /* Indigo 600 */
    --accent-glow: rgba(99, 102, 241, 0.5);
    
    --box-bg: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity */
    --box-border: rgba(255, 255, 255, 0.1);
    
    --text-main: #f8fafc;         /* Slate 50 */
    --text-muted: #94a3b8;        /* Slate 400 */
    
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: #818cf8;       /* Indigo 400 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-gradient-start);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 40%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-main);
    overflow: hidden;
    position: relative;
}

/* 배경 동적 효과 */
body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 100s linear infinite;
    z-index: -1;
    opacity: 0.5;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50px, -50px); }
}

.login-container {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 10;
}

/* Glassmorphism 효과 적용 */
.login-box {
    background: var(--box-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--box-border);
    border-radius: 24px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05); /* Inner border highlight */
    padding: 48px 40px;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
}

/* 로고 이미지 스타일 */
.logo-img {
    max-width: 160px; /* 로고 크기에 맞게 조정 */
    max-height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2)); /* 은은한 빛 */
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header .subtitle {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 400;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper svg {
    position: absolute;
    left: 16px;
    color: #64748b;
    pointer-events: none;
    transition: color 0.3s ease;
    width: 20px;
    height: 20px;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 16px 16px 50px;
    font-size: 16px;
    color: var(--text-main);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper input::placeholder {
    color: #475569;
}

.input-wrapper input:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.input-wrapper input:focus + svg,
.input-wrapper:focus-within svg {
    color: var(--primary-color);
}

/* 오류 메시지 스타일 */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1); /* Red with opacity */
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: #fca5a5; /* Light Red */
    font-size: 14px;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color) 0%, #4338ca 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 버튼 호버 시 빛나는 효과 */
.submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.submit-btn:hover::after {
    transform: translateX(100%);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #475569;
}

/* 스피너 스타일 */
.spinner {
    animation: spin 1s linear infinite;
    width: 20px;
    height: 20px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-footer {
    margin-top: 40px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: #64748b;
}

/* 반응형 */
@media (max-width: 480px) {
    .login-box {
        padding: 32px 24px;
        border-radius: 20px;
    }
    
    .logo-img {
        max-width: 120px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
}
