:root {
    --primary: #6366F1;
    --primary-foreground: #ffffff;
    --background: #F8FAFC;
    --foreground: #0F172A;
    --muted: #F1F5F9;
    --muted-foreground: #64748B;
    --border: #E2E8F0;
    --destructive: #EF4444;
    --radius: 0.5rem;
    
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    
    --accent-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #A855F7 100%);
    --accent-gradient-hover: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #9333EA 100%);
}

[data-theme="dark"] {
    --background: #0F172A;
    --foreground: #F8FAFC;
    --muted: #1E293B;
    --muted-foreground: #94A3B8;
    --border: #334155;
    
    --glass-bg: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--foreground);
    transition: background 0.3s ease, color 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 9999;
}

.login-container {
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
}

.bg-gradient-orbs {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-gradient-orbs::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    animation: floatOrb1 20s ease-in-out infinite;
}

.bg-gradient-orbs::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    animation: floatOrb2 25s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 20px) scale(1.05); }
    66% { transform: translate(30px, -30px) scale(0.9); }
}

.left-section {
    position: relative;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    background: var(--accent-gradient);
    padding: 3rem;
    color: white;
    z-index: 1;
}

@media (min-width: 1024px) {
    .left-section {
        display: flex;
    }
}

.logo {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.characters-container {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 400px;
}

.footer-links {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 0.875rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.right-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--background);
    position: relative;
    z-index: 1;
}

.login-form-container {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    animation: slideIn 0.4s ease-out;
}

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

.mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--foreground);
}

@media (min-width: 1024px) {
    .mobile-logo {
        display: none;
    }
}

.mobile-logo .logo-icon {
    background: var(--muted);
    padding: 6px;
    border-radius: 8px;
}

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

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.login-header p {
    color: var(--muted-foreground);
    font-size: 0.9375rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

.form-group input {
    height: 48px;
    padding: 0 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--background);
    color: var(--foreground);
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

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

.password-input-wrapper input {
    width: 100%;
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

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

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: normal;
    cursor: pointer;
    color: var(--foreground);
}

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

.forgot-link {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: text-decoration 0.2s;
}

.forgot-link:hover {
    text-decoration: underline;
}

.error-message {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--destructive);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
}

.submit-btn {
    position: relative;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 9999px;
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.submit-btn span {
    display: inline-block;
    transition: all 0.3s ease;
}

.submit-btn:hover span {
    transform: translateX(3rem);
    opacity: 0;
}

.submit-btn .hover-content {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--accent-gradient);
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 9999px;
}

.submit-btn:hover .hover-content {
    opacity: 1;
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.submit-btn.loading .hover-content {
    opacity: 0;
}

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

@media (max-width: 768px) {
    .login-container {
        display: flex;
        flex-direction: column;
    }
    
    .right-section {
        padding: 1.5rem;
        min-height: 100vh;
    }
    
    .login-form-container {
        max-width: 100%;
        padding: 2rem;
    }
    
    .mobile-logo {
        margin-bottom: 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .login-header p {
        font-size: 0.875rem;
    }
    
    .form-group input {
        height: 44px;
        font-size: 16px;
    }
    
    .submit-btn {
        height: 44px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .forgot-link {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .right-section {
        padding: 1rem;
    }
    
    .login-form-container {
        padding: 1.5rem;
    }
    
    .mobile-logo {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .login-header {
        margin-bottom: 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.35rem;
    }
    
    .form-group {
        gap: 0.4rem;
    }
    
    .form-group label {
        font-size: 0.8rem;
    }
    
    .form-group input {
        height: 42px;
        font-size: 16px;
    }
    
    .checkbox-label {
        font-size: 0.8rem;
    }
    
    .forgot-link {
        font-size: 0.8rem;
    }
    
    .submit-btn {
        height: 42px;
        font-size: 0.95rem;
    }
}
