/* Index Page Styles - Main Login Page */

/* ===== 차세대 디자인 시스템 ===== */
:root {
    /* 메인 컬러 팔레트 */
    --primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-light: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --secondary: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    --accent: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --success: linear-gradient(135deg, #96fbc4 0%, #f9f047 100%);
    --error: linear-gradient(135deg, #fd746c 0%, #ff9068 100%);
    
    /* 뉴모피즘 컬러 */
    --neo-bg: #f0f0f3;
    --neo-shadow-1: #d1d1d4;
    --neo-shadow-2: #ffffff;
    
    /* 다크 모드 */
    --dark-bg: #1a1a2e;
    --dark-surface: #16213e;
    --dark-card: #0f3460;
    --dark-text: #e94560;
    --dark-text-secondary: #a0a9c0;
    
    /* 그라디언트 오버레이 */
    --glass-overlay: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
    
    /* 애니메이션 */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-elastic: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* 스페이싱 */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* 타이포그래피 */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--dark-text-secondary);
    background: var(--dark-bg);
    overflow-x: hidden; /* 가로 스크롤만 숨김 */
    overflow-y: auto;   /* 세로 스크롤 허용 */
    min-height: 100vh;
    position: relative;
    /* 모바일 스크롤 개선 */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* ===== 배경 애니메이션 시스템 ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: var(--dark-bg);
}

.particle-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.7;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 6s; }
.particle:nth-child(2) { left: 20%; animation-delay: -1s; animation-duration: 8s; }
.particle:nth-child(3) { left: 30%; animation-delay: -2s; animation-duration: 7s; }
.particle:nth-child(4) { left: 40%; animation-delay: -3s; animation-duration: 9s; }
.particle:nth-child(5) { left: 50%; animation-delay: -4s; animation-duration: 5s; }
.particle:nth-child(6) { left: 60%; animation-delay: -5s; animation-duration: 8s; }
.particle:nth-child(7) { left: 70%; animation-delay: -1s; animation-duration: 6s; }
.particle:nth-child(8) { left: 80%; animation-delay: -2s; animation-duration: 7s; }
.particle:nth-child(9) { left: 90%; animation-delay: -3s; animation-duration: 8s; }

@keyframes float {
    0%, 100% { 
        transform: translateY(100vh) rotate(0deg); 
        opacity: 0; 
    }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    50% { 
        transform: translateY(50vh) rotate(180deg); 
        opacity: 1; 
    }
}

.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    overflow: hidden;
    opacity: 0.3;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 200px;
    background: var(--primary);
    border-radius: 50%;
    animation: wave 10s linear infinite;
}

.wave:nth-child(2) {
    animation-delay: -5s;
    opacity: 0.5;
}

@keyframes wave {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

/* ===== 메인 컨테이너 ===== */
.login-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ===== 왼쪽 브랜딩 패널 ===== */
.branding-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-2xl);
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.1) 0%, 
        rgba(118, 75, 162, 0.1) 100%);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.brand-content {
    text-align: center;
    z-index: 2;
    max-width: 500px;
}

.brand-logo {
    width: 120px;
    height: 120px;
    background: var(--primary);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    box-shadow: 
        0 20px 40px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: brandPulse 3s ease-in-out infinite;
    position: relative;
}

.brand-logo::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--primary);
    border-radius: 32px;
    z-index: -1;
    filter: blur(8px);
    opacity: 0.7;
}

@keyframes brandPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 
            0 20px 40px rgba(102, 126, 234, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 
            0 25px 50px rgba(102, 126, 234, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}

.brand-logo i {
    font-size: 3.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.brand-title {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    background: var(--primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: var(--font-size-xl);
    color: var(--dark-text-secondary);
    font-weight: 300;
    margin-bottom: var(--space-xl);
    opacity: 0.8;
}

.feature-list {
    list-style: none;
    text-align: left;
    max-width: 350px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    padding: var(--space-sm) 0;
    font-size: var(--font-size-base);
    color: var(--dark-text-secondary);
    opacity: 0;
    animation: slideInLeft 0.6s ease-out forwards;
}

.feature-item:nth-child(1) { animation-delay: 0.2s; }
.feature-item:nth-child(2) { animation-delay: 0.4s; }
.feature-item:nth-child(3) { animation-delay: 0.6s; }
.feature-item:nth-child(4) { animation-delay: 0.8s; }

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

.feature-icon {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-sm);
    font-size: var(--font-size-sm);
    color: white;
}

/* ===== 오른쪽 로그인 패널 ===== */
.login-panel {
    flex: 0 0 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-2xl);
    background: var(--dark-surface);
    position: relative;
}

.login-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.login-content {
    position: relative;
    z-index: 2;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.login-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: var(--space-xs);
    letter-spacing: -0.01em;
}

.login-subtitle {
    color: var(--dark-text-secondary);
    font-size: var(--font-size-base);
    opacity: 0.8;
}

/* ===== 폼 스타일링 ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: var(--space-xs);
    opacity: 0.9;
}

.form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: var(--font-size-base);
    border: 2px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--dark-text);
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.form-input:focus {
    outline: none;
    border-color: var(--dark-text);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 0 0 4px rgba(233, 69, 96, 0.1),
        0 8px 25px rgba(233, 69, 96, 0.15);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: var(--dark-text-secondary);
    opacity: 0.7;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--font-size-lg);
    color: var(--dark-text-secondary);
    transition: var(--transition-smooth);
    pointer-events: none;
}

.form-input:focus + .input-icon {
    color: var(--dark-text);
    transform: translateY(-50%) scale(1.1);
}

/* ===== 로그인 버튼 ===== */
.login-button {
    width: 100%;
    padding: 1rem;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 16px;
    background: var(--primary);
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 25px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.6s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 15px 35px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.login-button:hover::before {
    left: 100%;
}

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

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    position: relative;
    z-index: 1;
}

.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 알림 시스템 ===== */
.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: var(--space-lg);
    display: none;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    animation: alertSlide 0.4s ease-out;
}

.alert.error {
    background: rgba(253, 116, 108, 0.1);
    border: 1px solid rgba(253, 116, 108, 0.3);
    color: #fd746c;
}

.alert.success {
    background: rgba(150, 251, 196, 0.1);
    border: 1px solid rgba(150, 251, 196, 0.3);
    color: #96fbc4;
}

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

/* ===== 추가 요소 ===== */
.login-footer {
    margin-top: var(--space-xl);
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    font-size: var(--font-size-sm);
    color: var(--dark-text-secondary);
    opacity: 0.7;
}

.brand-accent {
    color: var(--dark-text);
    font-weight: 600;
}

/* ===== 반응형 디자인 ===== */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .branding-panel {
        flex: 0 0 auto;
        min-height: 30vh;
        padding: var(--space-lg);
    }

    .brand-logo {
        width: 80px;
        height: 80px;
        margin-bottom: var(--space-md);
    }

    .brand-title {
        font-size: var(--font-size-2xl);
    }

    .login-panel {
        flex: 1;
        padding: var(--space-lg) var(--space-md);
    }

    .login-content {
        width: 100%;
        max-width: 400px;
        padding: 0 10px;
    }

    .login-title {
        font-size: var(--font-size-2xl);
    }

    /* 🔥 모바일 최적화: iOS 줌 방지 + 터치 타겟 */
    .form-input {
        font-size: 16px !important; /* iOS 줌 방지 (16px 필수) */
        padding: 14px 14px 14px 3rem;
        min-height: 52px; /* 터치 타겟 크기 */
    }

    .login-button {
        min-height: 52px !important; /* 터치 타겟 크기 */
        font-size: 16px !important;
        padding: 14px 1rem;
    }

    /* 🔥 키보드 표시 시 레이아웃 조정 */
    .login-form {
        gap: var(--space-md); /* 간격 축소 */
    }

    .login-header {
        margin-bottom: var(--space-lg); /* 간격 축소 */
    }

    /* 키보드로 input이 가려지지 않도록 */
    .form-input:focus {
        transform: none; /* 모바일에서는 transform 제거 */
        box-shadow:
            0 0 0 4px rgba(233, 69, 96, 0.1),
            0 4px 15px rgba(233, 69, 96, 0.15);
    }

    /* 알림 영역 축소 */
    .alert {
        padding: 0.75rem;
        font-size: var(--font-size-sm);
        margin-bottom: var(--space-md);
    }
}

/* ===== 접근성 ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --dark-bg: #f8fafc;
        --dark-surface: #ffffff;
        --dark-card: #f1f5f9;
        --dark-text: #1e293b;
        --dark-text-secondary: #64748b;
    }
}