/* CSS Variables */
:root {
    --primary-color: #2c5282;
    --secondary-color: #764ba2;
    --bg-white: #ffffff;
    --bg-light: #f7f7f7;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --text-light: #999999;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f5f5f5;
}

/* ========================================
   Login Page Styles
======================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}

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

.login-header {
    text-align: center;
    padding: 40px 40px 30px;
    background: var(--bg-white);
}

.login-logo {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.login-logo i {
    font-size: 3rem;
    color: #2c5282;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-body {
    padding: 0 40px 40px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-control {
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(44, 82, 130, 0.1);
    outline: none;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.input-icon-wrapper .form-control {
    padding-left: 45px;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

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

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 82, 130, 0.3);
}

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

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-light);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 12px;
}

.social-login {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.social-btn:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.social-btn i {
    font-size: 1.2rem;
}

.signup-link {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

.signup-link a {
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 5px;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    border: 1px solid transparent;
}

.alert.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

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

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

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.login-btn.loading {
    pointer-events: none;
}

.login-btn.loading .btn-text {
    display: none;
}

.login-btn.loading .loading-spinner {
    display: block;
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 768px) {
    .login-container {
        max-width: 100%;
        border-radius: 0;
    }
    
    .login-header {
        padding: 30px 30px 20px;
    }
    
    .login-body {
        padding: 0 30px 30px;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        padding: 0;
    }
    
    .login-header {
        padding: 25px 20px 15px;
    }
    
    .login-body {
        padding: 0 20px 25px;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
    
    .social-login {
        flex-direction: column;
    }
    
    .login-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* 로딩 스피너 */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.login-btn {
    position: relative;
    overflow: hidden;
}

.login-btn .btn-text {
    transition: opacity 0.3s ease;
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Alert 스타일 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
    animation: slideDown 0.3s ease;
}

.alert.show {
    display: block;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border-left: 4px solid #c33;
}

.alert-success {
    background-color: #efe;
    color: #3c3;
    border-left: 4px solid #3c3;
}

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