
        /* Reset and Base Styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            /* iOS Color Palette */
            --primary-blue: #007AFF;
            --secondary-blue: #5AC8FA;
            --success-green: #34C759;
            --warning-orange: #FF9500;
            --error-red: #FF3B30;
            --purple: #AF52DE;
            --pink: #FF2D92;
            
            /* Light theme variables */
            --bg-primary: #F2F2F7;
            --bg-secondary: #FFFFFF;
            --bg-tertiary: rgba(255, 255, 255, 0.8);
            --bg-quaternary: rgba(255, 255, 255, 0.6);
            
            --text-primary: #000000;
            --text-secondary: #3C3C43;
            --text-tertiary: #8E8E93;
            
            --border-color: rgba(60, 60, 67, 0.12);
            --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
            --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
            --shadow-heavy: 0 8px 25px rgba(0, 0, 0, 0.2);
            
            --border-radius: 12px;
            --border-radius-large: 20px;
            --border-radius-small: 8px;
            
            --transition-duration: 0.3s;
            --transition-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        /* Dark theme variables */
        [data-theme="dark"] {
            --bg-primary: #000000;
            --bg-secondary: #1C1C1E;
            --bg-tertiary: rgba(28, 28, 30, 0.8);
            --bg-quaternary: rgba(44, 44, 46, 0.6);
            
            --text-primary: #FFFFFF;
            --text-secondary: #EBEBF5;
            --text-tertiary: #8E8E93;
            
            --border-color: rgba(84, 84, 88, 0.3);
            --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.3);
            --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.4);
            --shadow-heavy: 0 8px 25px rgba(0, 0, 0, 0.5);
        }

        /* Auto dark mode */
        @media (prefers-color-scheme: dark) {
            :root:not([data-theme="light"]) {
                --bg-primary: #000000;
                --bg-secondary: #1C1C1E;
                --bg-tertiary: rgba(28, 28, 30, 0.8);
                --bg-quaternary: rgba(44, 44, 46, 0.6);
                
                --text-primary: #FFFFFF;
                --text-secondary: #EBEBF5;
                --text-tertiary: #8E8E93;
                
                --border-color: rgba(84, 84, 88, 0.3);
                --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.3);
                --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.4);
                --shadow-heavy: 0 8px 25px rgba(0, 0, 0, 0.5);
            }
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            transition: all var(--transition-duration) var(--transition-easing);
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            position: relative;
            overflow-x: hidden;
        }

        /* Animated Background */
        .bg-animation {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            opacity: 0.1;
        }

        .floating-circle {
            position: absolute;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
            animation: float 6s ease-in-out infinite;
        }

        .floating-circle:nth-child(1) {
            width: 80px;
            height: 80px;
            top: 10%;
            left: 10%;
            animation-delay: 0s;
        }

        .floating-circle:nth-child(2) {
            width: 120px;
            height: 120px;
            top: 20%;
            right: 10%;
            animation-delay: 2s;
        }

        .floating-circle:nth-child(3) {
            width: 60px;
            height: 60px;
            bottom: 30%;
            left: 20%;
            animation-delay: 4s;
        }

        .floating-circle:nth-child(4) {
            width: 100px;
            height: 100px;
            bottom: 10%;
            right: 20%;
            animation-delay: 1s;
        }

        @keyframes float {
            0%, 100% {
                transform: translateY(0px) scale(1);
            }
            50% {
                transform: translateY(-20px) scale(1.1);
            }
        }

        /* Login Container */
        .login-container {
            background: var(--bg-secondary);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius-large);
            box-shadow: var(--shadow-heavy);
            padding: 40px;
            width: 100%;
            max-width: 420px;
            position: relative;
            overflow: hidden;
            animation: slideInUp 0.8s var(--transition-easing);
        }

        .login-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue), var(--purple));
            background-size: 200% 100%;
            animation: shimmer 3s ease-in-out infinite;
        }

        @keyframes shimmer {
            0% { background-position: -200% 0; }
            100% { background-position: 200% 0; }
        }

        /* Logo and Header */
        .login-header {
            text-align: center;
            margin-bottom: 32px;
            animation: fadeInDown 1s var(--transition-easing) 0.2s both;
        }

        .logo {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
        }

        .logo i {
            font-size: 36px;
            background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: pulse 2s ease-in-out infinite;
        }

        .logo-text {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary);
            margin-left: 8px;
        }

        .login-title {
            font-size: 28px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 8px;
        }

        .login-subtitle {
            font-size: 16px;
            color: var(--text-tertiary);
        }

        /* Form Styles */
        .login-form {
            animation: fadeInUp 1s var(--transition-easing) 0.4s both;
        }

        .form-group {
            margin-bottom: 20px;
            position: relative;
        }

        .form-label {
            display: block;
            font-size: 14px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 8px;
            transition: color 0.2s ease;
        }

        .form-input {
            width: 100%;
            padding: 16px 48px 16px 16px;
            border: 2px solid var(--border-color);
            border-radius: var(--border-radius);
            background: var(--bg-tertiary);
            color: var(--text-primary);
            font-size: 16px;
            transition: all 0.3s ease;
            outline: none;
        }

        .form-input:focus {
            border-color: var(--primary-blue);
            background: var(--bg-secondary);
            box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
            transform: translateY(-2px);
        }

        .form-input:focus + .input-icon {
            color: var(--primary-blue);
            transform: scale(1.1);
        }

        .form-input.error {
            border-color: var(--error-red);
            animation: shake 0.5s ease-in-out;
        }

        .input-icon {
            position: absolute;
            right: 16px;
            top: calc(50% + 12px); /* Offset for label height */
            transform: translateY(-50%);
            color: var(--text-tertiary);
            font-size: 16px;
            transition: all 0.3s ease;
            pointer-events: none;
        }

        .password-toggle {
            position: absolute;
            right: 16px;
            top: calc(50% + 12px); /* Offset for label height */
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--text-tertiary);
            cursor: pointer;
            font-size: 16px;
            transition: all 0.2s ease;
            padding: 4px;
            border-radius: 4px;
        }

        .password-toggle:hover {
            color: var(--text-primary);
            background: var(--bg-quaternary);
        }

        /* Error Messages */
        .error-message {
            color: var(--error-red);
            font-size: 12px;
            margin-top: 4px;
            opacity: 0;
            transform: translateY(-10px);
            transition: all 0.3s ease;
        }

        .error-message.show {
            opacity: 1;
            transform: translateY(0);
        }

        /* Remember Me and Forgot Password */
        .form-options {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            font-size: 14px;
        }

        .remember-me {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            user-select: none;
        }

        .checkbox {
            width: 18px;
            height: 18px;
            border: 2px solid var(--border-color);
            border-radius: 4px;
            background: var(--bg-tertiary);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            position: relative;
        }

        .checkbox.checked {
            background: var(--primary-blue);
            border-color: var(--primary-blue);
        }

        .checkbox.checked::after {
            content: '✓';
            color: white;
            font-size: 12px;
            font-weight: bold;
        }

        .forgot-password {
            color: var(--primary-blue);
            text-decoration: none;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .forgot-password:hover {
            text-decoration: underline;
            opacity: 0.8;
        }

        /* Buttons */
        .btn {
            width: 100%;
            padding: 16px;
            border: none;
            border-radius: var(--border-radius);
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
            color: white;
            box-shadow: var(--shadow-medium);
            margin-bottom: 16px;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-heavy);
        }

        .btn-primary:active {
            transform: translateY(0);
        }

        .btn-primary.loading {
            pointer-events: none;
        }

        .btn-primary.loading::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 20px;
            height: 20px;
            margin: -10px 0 0 -10px;
            border: 2px solid transparent;
            border-top: 2px solid white;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        .btn-secondary {
            background: var(--bg-quaternary);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
        }

        .btn-secondary:hover {
            background: var(--bg-tertiary);
            border-color: var(--primary-blue);
        }

        /* Theme Toggle */
        .theme-toggle {
            position: absolute;
            top: 20px;
            right: 20px;
            background: var(--bg-secondary);
            border: 2px solid var(--border-color);
            border-radius: 50%;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            box-shadow: var(--shadow-medium);
            color: var(--text-primary);
        }

        .theme-toggle:hover {
            background: var(--bg-tertiary);
            transform: scale(1.1);
            border-color: var(--primary-blue);
        }

        .theme-toggle i {
            font-size: 18px;
            color: var(--text-primary);
        }

        /* Forgot Password Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .modal-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        .modal {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius-large);
            box-shadow: var(--shadow-heavy);
            padding: 32px;
            width: 90%;
            max-width: 400px;
            transition: all 0.3s ease;
        }

        .modal-overlay.show .modal {
            transform: translate(-50%, -50%) scale(1);
        }

        .modal-header {
            text-align: center;
            margin-bottom: 24px;
        }

        .modal-title {
            font-size: 24px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 8px;
        }

        .modal-subtitle {
            font-size: 14px;
            color: var(--text-tertiary);
        }

        .modal-close {
            position: absolute;
            top: 16px;
            right: 16px;
            background: none;
            border: none;
            color: var(--text-tertiary);
            font-size: 20px;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            transition: all 0.2s ease;
        }

        .modal-close:hover {
            background: var(--bg-quaternary);
            color: var(--text-primary);
        }

        /* Success Message */
        .success-message {
            background: var(--success-green);
            color: white;
            padding: 12px 16px;
            border-radius: var(--border-radius);
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            opacity: 0;
            transform: translateY(-10px);
            transition: all 0.3s ease;
        }

        .success-message.show {
            opacity: 1;
            transform: translateY(0);
        }

        /* Animations */
        @keyframes slideInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeInDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Mobile Responsiveness */
        @media (max-width: 480px) {
            body {
                padding: 16px;
            }

            .login-container {
                padding: 24px;
            }

            .login-title {
                font-size: 24px;
            }

            .logo i {
                font-size: 28px;
            }

            .logo-text {
                font-size: 20px;
            }

            .form-options {
                flex-direction: column;
                gap: 12px;
                align-items: flex-start;
            }

            .modal {
                padding: 24px;
            }
        }

        /* High contrast mode */
        @media (prefers-contrast: high) {
            .form-input:focus {
                outline: 3px solid var(--primary-blue);
            }
        }

        /* Reduced motion */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }