/* ==================== 변수 정의 ==================== */
:root {
    /* 색상 팔레트 */
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --primary-bg: #EEF2FF;
    
    --secondary-color: #06B6D4;
    --secondary-dark: #0891B2;
    
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    
    --border-color: #E5E7EB;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    
    /* 그라디언트 */
    --gradient-primary: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    --gradient-secondary: linear-gradient(135deg, #F093FB 0%, #F5576C 100%);
    --gradient-brand: linear-gradient(135deg, #4F46E5 0%, #06B6D4 100%);
    
    /* 그림자 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* 전환 효과 */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ==================== 전역 스타일 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== 로그인 컨테이너 ==================== */
.login-container {
    display: flex;
    min-height: 100vh;
    animation: fadeIn 0.6s ease;
}

/* ==================== 왼쪽 브랜딩 영역 ==================== */
.login-left {
    flex: 1.2;
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 3rem;
}

.brand-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    animation: slideInLeft 0.8s ease;
}

.logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: float 3s ease-in-out infinite;
}

.logo i {
    font-size: 48px;
    color: white;
}

.brand-name {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.brand-description {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 3rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-align: left;
    max-width: 350px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.feature-item i {
    font-size: 1.2rem;
    color: #10B981;
}

/* 장식용 원 */
.decoration-circles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 1;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 20s ease-in-out infinite;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    right: -50px;
    animation-delay: 5s;
}

.circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 10%;
    animation-delay: 10s;
}

/* ==================== 오른쪽 로그인 폼 영역 ==================== */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: 2rem;
}

.login-form-wrapper {
    width: 100%;
    max-width: 460px;
    animation: slideInRight 0.8s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ==================== 알림 메시지 ==================== */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    animation: slideDown 0.3s ease;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert i {
    font-size: 1.1rem;
}

/* ==================== 폼 스타일 ==================== */
.login-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-label i {
    font-size: 1rem;
    color: var(--primary-color);
}

.form-input {
    width: 100%;
    height: 52px;
    padding: 0 1.25rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--surface);
    transition: all var(--transition-base);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ==================== 폼 옵션 ==================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==================== 로그인 버튼 ==================== */
.btn-login {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--gradient-brand);
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

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

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

.btn-login span {
    position: relative;
    z-index: 1;
}

.btn-login i {
    position: relative;
    z-index: 1;
    transition: transform var(--transition-base);
}

.btn-login:hover i {
    transform: translateX(3px);
}

/* ==================== 로그인 푸터 ==================== */
.login-footer {
    text-align: center;
}

.divider {
    position: relative;
    margin: 2rem 0;
    text-align: center;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    position: relative;
    background: var(--surface);
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.signup-prompt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.signup-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.signup-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==================== SSO 버튼 (향후 구현용) ==================== */
.sso-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.sso-btn {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.sso-btn:hover {
    background: var(--background);
    border-color: var(--primary-color);
}

.sso-btn i {
    font-size: 1.1rem;
}

.sso-google i {
    color: #EA4335;
}

.sso-microsoft i {
    color: #0078D4;
}

/* ==================== 저작권 ==================== */
.copyright {
    margin-top: 3rem;
    text-align: center;
}

.copyright p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==================== 로딩 오버레이 ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==================== 애니메이션 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(1deg);
    }
    75% {
        transform: translateY(20px) rotate(-1deg);
    }
}

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

/* ==================== 반응형 디자인 ==================== */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-left {
        flex: none;
        min-height: 40vh;
        padding: 2rem;
    }
    
    .brand-name {
        font-size: 2rem;
    }
    
    .brand-tagline {
        font-size: 1.25rem;
    }
    
    .brand-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }
    
    .feature-item {
        flex: 1 1 calc(50% - 0.6rem);
        min-width: 200px;
    }
    
    .login-right {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .login-left {
        min-height: 35vh;
    }
    
    .logo {
        width: 80px;
        height: 80px;
    }
    
    .logo i {
        font-size: 36px;
    }
    
    .brand-name {
        font-size: 1.75rem;
    }
    
    .brand-tagline {
        font-size: 1.1rem;
    }
    
    .feature-item {
        flex: 1 1 100%;
    }
    
    .login-header h3 {
        font-size: 1.75rem;
    }
    
    .decoration-circles {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-left {
        padding: 1.5rem;
        min-height: 30vh;
    }
    
    .brand-description {
        display: none;
    }
    
    .features {
        display: none;
    }
    
    .login-right {
        padding: 1.5rem 1rem;
    }
    
    .login-form-wrapper {
        max-width: 100%;
    }
    
    .form-input {
        height: 48px;
        font-size: 16px; /* iOS 확대 방지 */
    }
    
    .btn-login {
        height: 48px;
    }
}

/* ==================== 다크 모드 지원 (선택적) ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F9FAFB;
        --text-secondary: #D1D5DB;
        --text-muted: #9CA3AF;
        --background: #111827;
        --surface: #1F2937;
        --border-color: #374151;
    }
    
    .login-right {
        background: var(--surface);
    }
    
    .form-input {
        background: var(--background);
        color: var(--text-primary);
    }
    
    .sso-btn {
        background: var(--background);
    }
    
    .sso-btn:hover {
        background: var(--surface);
    }
}

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

/* 포커스 가시성 개선 */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 3px;
    }
    
    .btn-login {
        border: 2px solid currentColor;
    }
}

/* ==================== 사용자 액션 영역 ==================== */
.user-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-action.btn-primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-action.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-action.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-action.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.btn-action.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

.btn-action.btn-logout:hover {
    background: var(--error-color);
    color: white;
    transform: translateY(-1px);
}

.user-name {
    font-weight: 600;
    color: var(--primary-color);
}

/* ==================== 로그인 폼 ==================== */